Ignore:
Timestamp:
14 Oct 2005, 13:01:35 (19 years ago)
Author:
joachim
Message:

=weitere

Location:
waeup_product/trunk/skins/waeup_default
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • waeup_product/trunk/skins/waeup_default/getWAeUPLayouts.py

    r45 r47  
     1#-*- mode: python; mode: fold -*-
    12##parameters=
    23# $Id$
    34"""Return custom layouts types."""
    4 layouts = {}
    5 
    6 # common header layout
    7 common_layout = {
     5
     6##    'widgets': { ###(
     7##        '': {
     8##            'type': 'String Widget',
     9##            'data': {
     10##                'title': '',
     11##                'fields': ('',),
     12##                'is_required': False,
     13##                'label': '',
     14##                'label_edit': '',
     15##                'description': '',
     16##                'help': '',
     17##                'is_i18n': False,
     18##                'readonly_layout_modes': (),
     19##                'hidden_layout_modes': (),
     20##                'hidden_readonly_layout_modes': (),
     21##                'hidden_empty': False,
     22##                'hidden_if_expr': '',
     23##                'css_class': '',
     24##                'widget_mode_expr': '',
     25##                'display_width': 10,
     26##                'size_max': 0,
     27##            },
     28
     29###)
     30
     31common_layout = {###(
    832    'widgets': {
    933        'LanguageSelector': {
     
    7094        },
    7195    }
    72 layouts['waeup_common'] = common_layout
    7396#
    74 #
    75 student_layout = {
     97###)
     98
     99student_layout = { ###(
    76100    'widgets': {
    77101        'jamb_is_admitted': {
     
    119143            },
    120144        },
    121         'jamb_pin_usage': {
    122             'type': 'Int Widget',
    123             'data': {
    124                 'title': 'Jamb Pin usage',
    125                 'fields': ('jamb_pin_usage',),
    126                 'is_required': False,
    127                 'label': 'Nr of Cardusage',
    128                 'label_edit': 'Nr of Cardusage',
    129                 'description': '',
    130                 'help': 'How many times has the scratchcard been used',
    131                 'is_i18n': False,
    132                 'readonly_layout_modes': (),
    133                 'hidden_layout_modes': (),
    134                 'hidden_readonly_layout_modes': (),
    135                 'hidden_empty': False,
    136                 'hidden_if_expr': '',
    137                 'css_class': '',
    138                 'widget_mode_expr': '',
    139                 'display_width': 2,
    140                 'size_max': 2,
    141             },
    142         },
     145##        'jamb_pin_usage': {
     146##            'type': 'Int Widget',
     147##            'data': {
     148##                'title': 'Jamb Pin usage',
     149##                'fields': ('jamb_pin_usage',),
     150##                'is_required': False,
     151##                'label': 'Nr of Cardusage',
     152##                'label_edit': 'Nr of Cardusage',
     153##                'description': '',
     154##                'help': 'How many times has the scratchcard been used',
     155##                'is_i18n': False,
     156##                'readonly_layout_modes': (),
     157##                'hidden_layout_modes': (),
     158##                'hidden_readonly_layout_modes': (),
     159##                'hidden_empty': False,
     160##                'hidden_if_expr': '',
     161##                'css_class': '',
     162##                'widget_mode_expr': '',
     163##                'display_width': 2,
     164##                'size_max': 2,
     165##            },
     166##        },
    143167        'faculty': {
    144168            'type': 'String Widget',
     
    171195            [{'widget_id': 'jamb_is_admitted', 'ncols': 1},],
    172196            [{'widget_id': 'jamb_where_admitted', 'ncols': 1},],
    173             [{'widget_id': 'jamb_pin_usage', 'ncols': 1},],
     197            #[{'widget_id': 'jamb_pin_usage', 'ncols': 1},],
    174198            [{'widget_id': 'faculty', 'ncols': 1},],
    175199        ]
    176200    },
    177201}
    178 layouts['student'] = student_layout
    179 #
    180 #
    181 scratch_card = {
     202###)
     203
     204student_personal_layout = { ###(
     205    'widgets': {
     206        'firstname': {
     207            'type': 'String Widget',
     208            'data': {
     209                'title': '',
     210                'fields': ('firstname',),
     211                'is_required': False,
     212                'label': 'First Name',
     213                'label_edit': 'First Name',
     214                'description': '',
     215                'help': '',
     216                'is_i18n': False,
     217                'readonly_layout_modes': (),
     218                'hidden_layout_modes': (),
     219                'hidden_readonly_layout_modes': (),
     220                'hidden_empty': False,
     221                'hidden_if_expr': '',
     222                'css_class': '',
     223                'widget_mode_expr': '',
     224                'display_width': 10,
     225                'size_max': 0,
     226            },
     227        },
     228        'middlename': {
     229            'type': 'String Widget',
     230            'data': {
     231                'title': '',
     232                'fields': ('middlename',),
     233                'is_required': False,
     234                'label': 'Middle Name',
     235                'label_edit': 'Middle Name',
     236                'description': '',
     237                'help': '',
     238                'is_i18n': False,
     239                'readonly_layout_modes': (),
     240                'hidden_layout_modes': (),
     241                'hidden_readonly_layout_modes': (),
     242                'hidden_empty': False,
     243                'hidden_if_expr': '',
     244                'css_class': '',
     245                'widget_mode_expr': '',
     246                'display_width': 10,
     247                'size_max': 0,
     248            },
     249        },
     250        'lastname': {
     251            'type': 'String Widget',
     252            'data': {
     253                'title': '',
     254                'fields': ('lastname',),
     255                'is_required': False,
     256                'label': 'Last Name',
     257                'label_edit': 'Last Name',
     258                'description': '',
     259                'help': '',
     260                'is_i18n': False,
     261                'readonly_layout_modes': (),
     262                'hidden_layout_modes': (),
     263                'hidden_readonly_layout_modes': (),
     264                'hidden_empty': False,
     265                'hidden_if_expr': '',
     266                'css_class': '',
     267                'widget_mode_expr': '',
     268                'display_width': 10,
     269                'size_max': 0,
     270            },
     271        },
     272        'sex': {
     273            'type': 'Boolean Widget',
     274            'data': {
     275                'title': '',
     276                'fields': ('sex',),
     277                'is_required': False,
     278                'label': 'Sex',
     279                'label_edit': 'Sex',
     280                'label_false': 'male',
     281                'label_true': 'female',
     282                'description': '',
     283                'help': '',
     284                'is_i18n': False,
     285                'readonly_layout_modes': (),
     286                'hidden_layout_modes': (),
     287                'hidden_readonly_layout_modes': (),
     288                'hidden_empty': False,
     289                'hidden_if_expr': '',
     290                'css_class': '',
     291                'widget_mode_expr': '',
     292                'display_width': 10,
     293                'size_max': 0,
     294            },
     295        },
     296        'birthday': {
     297            'type': 'Date Widget',
     298            'data': {
     299                'title': '',
     300                'fields': ('birthday',),
     301                'is_required': False,
     302                'label': '',
     303                'label_edit': 'Day of birth',
     304                'description': 'Day of birth',
     305                'help': '',
     306                'is_i18n': False,
     307                'readonly_layout_modes': (),
     308                'hidden_layout_modes': (),
     309                'hidden_readonly_layout_modes': (),
     310                'hidden_empty': False,
     311                'hidden_if_expr': '',
     312                'css_class': '',
     313                'widget_mode_expr': '',
     314                'display_width': 10,
     315                'size_max': 0,
     316            },
     317        },
     318    },
     319    'layout': {
     320        'style_prefix': 'layout_default_',
     321        'flexible_widgets': (),
     322        'ncols': 1,
     323        'rows': [
     324            [{'widget_id': 'firstname', 'ncols': 1},],
     325            [{'widget_id': 'middlename', 'ncols': 1},],
     326            [{'widget_id': 'lastname', 'ncols': 1},],
     327            [{'widget_id': 'sex', 'ncols': 1},],
     328            [{'widget_id': 'birthday', 'ncols': 1},],
     329        ]
     330    },
     331}
     332
     333###)
     334
     335scratch_card = { ###(
    182336    'widgets': {
    183337        'sc_id': {
     
    237391}
    238392
    239 layouts['scratch_card'] = scratch_card
    240 
    241 jamb_layout = {
     393
     394###)
     395
     396admission = { ###(
     397    'widgets': {
     398        'sc_id': {
     399            'type': 'String Widget',
     400            'data': {
     401                'title': 'SC ID',
     402                'fields': ('admission_sc_id',),
     403                'is_required': False,
     404                'label': 'Card Serial Number ',
     405                'label_edit': 'Card Serial Number',
     406                'description': 'Card Serial Number ',
     407                'help': 'This can be found on the bottom right of the reverse side of your Scratch Card',
     408                'is_i18n': False,
     409                'readonly_layout_modes': (),
     410                'hidden_layout_modes': (),
     411                'hidden_readonly_layout_modes': (),
     412                'hidden_empty': False,
     413                'hidden_if_expr': 'python:1',
     414                'css_class': '',
     415                'widget_mode_expr': '',
     416                'display_width': 10,
     417                'size_max': 0,
     418            },
     419        },
     420        'sc_pin': {
     421            'type': 'String Widget',
     422            'data': {
     423                'title': 'SC Pin',
     424                'fields': ('admission_sc_pin'),
     425                'is_required': True,
     426                'label': 'PIN',
     427                'label_edit': 'PIN',
     428                'description': '',
     429                'help': 'PIN-(Personal Identification Number) is an 8 or 12 digit number on the reverse side of the scratch card which you can purchase from many Banks',
     430                'is_i18n': False,
     431                'readonly_layout_modes': (),
     432                'hidden_layout_modes': (),
     433                'hidden_readonly_layout_modes': (),
     434                'hidden_empty': False,
     435                'hidden_if_expr': '',
     436                'css_class': '',
     437                'widget_mode_expr': '',
     438                'display_width': 10,
     439                'size_max': 10,
     440            },
     441        },
     442        'jamb_id': {
     443            'type': 'StudentId Widget',
     444            'data': {
     445                'title': 'Registration Number',
     446                'fields': ('reg_nr'),
     447                'is_required': True,
     448                'label': 'Registration Number',
     449                'label_edit': 'Registration Number',
     450                'description': '',
     451                'help': 'This is the combination of 8 digits and 2 letters you are assigned when you purchase an examination form.',
     452                'is_i18n': False,
     453                'readonly_layout_modes': (),
     454                'hidden_layout_modes': (),
     455                'hidden_readonly_layout_modes': (),
     456                'hidden_empty': False,
     457                'hidden_if_expr': '',
     458                'css_class': '',
     459                'widget_mode_expr': '',
     460                'display_width': 10,
     461                'size_max': 10,
     462            },
     463        },
     464    },
     465   'layout': {
     466        'style_prefix': 'layout_admission_',
     467        'flexible_widgets': (),
     468        'ncols': 1,
     469        'rows': [
     470            [{'widget_id': 'sc_id', 'ncols': 1},],
     471            [{'widget_id': 'sc_pin', 'ncols': 1},],
     472            [{'widget_id': 'jamb_id', 'ncols': 1},],
     473        ]
     474    },
     475}
     476
     477###)
     478
     479jamb_layout = { ###(
    242480    'widgets': {
    243481        'reg_nr': {
     
    459697    },
    460698}
    461 
     699###)
     700
     701layouts = {}
     702layouts['waeup_common'] = common_layout
     703layouts['student'] = student_layout
     704layouts['student_personal'] = student_personal_layout
     705layouts['scratch_card'] = scratch_card
     706layouts['admission'] = admission
    462707layouts['jamb'] = jamb_layout
    463 
    464708return layouts
  • waeup_product/trunk/skins/waeup_default/getWAeUPSchemas.py

    r45 r47  
    1 university_schema = {
     1#-*- mode: python; mode: fold -*-
     2# $Id$
     3
     4university_schema = { ###(
    25   'allow_discussion': {
    36        'type': 'CPS Int Field',
     
    912}
    1013
    11 students_folder_schema = {
     14###)
     15
     16students_folder_schema = { ###(
    1217   'allow_discussion': {
    1318        'type': 'CPS Int Field',
     
    1924}
    2025
    21 student_schema = {
     26###)
     27
     28student_schema = { ###(
    2229   'allow_discussion': {
    2330        'type': 'CPS Int Field',
     
    8188        },
    8289    },
    83     'jamb_pin_usage': {
    84         'type': 'CPS Int Field',
    85         'data': {
    86             'default_expr': 'python:0',
    87             'is_searchabletext': False,
    88             'acl_read_permissions': '',
    89             'acl_read_roles': '',
    90             'acl_read_expr': '',
    91             'acl_write_permissions': '',
    92             'acl_write_roles': '',
    93             'acl_write_expr': '',
    94             'read_ignore_storage': False,
    95             'read_process_expr': '',
    96             'read_process_dependent_fields': (),
    97             'write_ignore_storage': False,
    98             'write_process_expr': '',
    99         },
    100     },
    10190}
    10291#
     92###)
     93
     94student_personal_schema = { ###(
     95   'allow_discussion': {
     96        'type': 'CPS Int Field',
     97        'data': {
     98            'default_expr': 'python:0',
     99            'is_searchabletext': 0,
     100            },
     101        },
     102     'firstname': {
     103        'type': 'CPS String Field',
     104        'data': {
     105            'is_searchabletext': 1,
     106        },
     107    },
     108    'middlename': {
     109        'type': 'CPS String Field',
     110        'data': {
     111            'is_searchabletext': 1,
     112        },
     113    },
     114     'lastname': {
     115        'type': 'CPS String Field',
     116        'data': {
     117            'is_searchabletext': 1,
     118        },
     119    },
     120     'sex': {
     121        'type': 'CPS Boolean Field',
     122        'data': {
     123            'is_searchabletext': 1,
     124        },
     125    },
     126     'birthday': {
     127        'type': 'CPS DateTime Field',
     128        'data': {
     129            'is_searchabletext': 1,
     130        },
     131    },
     132}
    103133#
    104 jamb_schema = {
     134###)
     135
     136jamb_schema = { ###(
    105137   'allow_discussion': {
    106138        'type': 'CPS Int Field',
     
    115147            'default_expr': 'string:',
    116148            'is_searchabletext': True,
     149            'acl_read_permissions': '',
     150            'acl_read_roles': '',
     151            'acl_read_expr': '',
     152            'acl_write_permissions': '',
     153            'acl_write_roles': '',
     154            'acl_write_expr': '',
     155            'read_ignore_storage': False,
     156            'read_process_expr': '',
     157            'read_process_dependent_fields': (),
     158            'write_ignore_storage': False,
     159            'write_process_expr': '',
     160        },
     161    },
     162    'admission_sc_id': {
     163        'type': 'CPS String Field',
     164        'data': {
     165            'default_expr': '',
     166            'is_searchabletext': True,
     167            'acl_read_permissions': '',
     168            'acl_read_roles': '',
     169            'acl_read_expr': '',
     170            'acl_write_permissions': '',
     171            'acl_write_roles': '',
     172            'acl_write_expr': '',
     173            'read_ignore_storage': False,
     174            'read_process_expr': '',
     175            'read_process_dependent_fields': (),
     176            'write_ignore_storage': False,
     177            'write_process_expr': '',
     178        },
     179    },
     180    'admission_sc_pin': {
     181        'type': 'CPS String Field',
     182        'data': {
     183            'is_searchabletext': True,
     184            'acl_read_permissions': '',
     185            'acl_read_roles': '',
     186            'acl_read_expr': '',
     187            'acl_write_permissions': '',
     188            'acl_write_roles': '',
     189            'acl_write_expr': '',
     190            'read_ignore_storage': False,
     191            'read_process_expr': '',
     192            'read_process_dependent_fields': (),
     193            'write_ignore_storage': False,
     194            'write_process_expr': '',
     195        },
     196    },
     197    'admission_sc_pin_usage': {
     198        'type': 'CPS Int Field',
     199        'data': {
     200            'default_expr': 'python:0',
     201            'is_searchabletext': False,
    117202            'acl_read_permissions': '',
    118203            'acl_read_roles': '',
     
    274359}
    275360
    276 scratch_card = {
    277    'allow_discussion': {
    278         'type': 'CPS Int Field',
    279         'data': {
    280             'default_expr': 'python:0',
    281             'is_searchabletext': 0,
    282             },
    283         },
    284      'sc_id': {
    285         'type': 'CPS String Field',
    286         'data': {
    287             'default_expr': '',
    288             'is_searchabletext': 0,
    289             'acl_read_permissions': '',
    290             'acl_read_roles': '',
    291             'acl_read_expr': '',
    292             'acl_write_permissions': '',
    293             'acl_write_roles': '',
    294             'acl_write_expr': '',
    295             'read_ignore_storage': False,
    296             'read_process_expr': '',
    297             'read_process_dependent_fields': (),
    298             'write_ignore_storage': False,
    299             'write_process_expr': '',
    300         },
    301     },
    302      'sc_pin': {
    303         'type': 'CPS String Field',
    304         'data': {
    305             'default_expr': '',
    306             'is_searchabletext': 0,
    307             'acl_read_permissions': '',
    308             'acl_read_roles': '',
    309             'acl_read_expr': '',
    310             'acl_write_permissions': '',
    311             'acl_write_roles': '',
    312             'acl_write_expr': '',
    313             'read_ignore_storage': False,
    314             'read_process_expr': '',
    315             'read_process_dependent_fields': (),
    316             'write_ignore_storage': False,
    317             'write_process_expr': '',
    318         },
    319     },
    320 }
     361###)
     362
     363##scratch_card = { ###(
     364####   'allow_discussion': {
     365####        'type': 'CPS Int Field',
     366####        'data': {
     367####            'default_expr': 'python:0',
     368####            'is_searchabletext': 0,
     369####            },
     370####        },
     371##     'sc_id': {
     372##        'type': 'CPS String Field',
     373##        'data': {
     374##            'default_expr': '',
     375##            'is_searchabletext': 0,
     376##            'acl_read_permissions': '',
     377##            'acl_read_roles': '',
     378##            'acl_read_expr': '',
     379##            'acl_write_permissions': '',
     380##            'acl_write_roles': '',
     381##            'acl_write_expr': '',
     382##            'read_ignore_storage': False,
     383##            'read_process_expr': '',
     384##            'read_process_dependent_fields': (),
     385##            'write_ignore_storage': False,
     386##            'write_process_expr': '',
     387##        },
     388##    },
     389##     'sc_pin': {
     390##        'type': 'CPS String Field',
     391##        'data': {
     392##            'default_expr': '',
     393##            'is_searchabletext': 0,
     394##            'acl_read_permissions': '',
     395##            'acl_read_roles': '',
     396##            'acl_read_expr': '',
     397##            'acl_write_permissions': '',
     398##            'acl_write_roles': '',
     399##            'acl_write_expr': '',
     400##            'read_ignore_storage': False,
     401##            'read_process_expr': '',
     402##            'read_process_dependent_fields': (),
     403##            'write_ignore_storage': False,
     404##            'write_process_expr': '',
     405##        },
     406##    },
     407##}
    321408schemas = {}
     409###)
     410
    322411schemas['university'] = university_schema
    323412schemas['students'] = students_folder_schema
    324413schemas['student'] = student_schema
     414schemas['student_personal'] = student_personal_schema
    325415schemas['jamb'] = jamb_schema
    326 schemas['scratch_card'] = scratch_card
     416#schemas['scratch_card'] = scratch_card
    327417
    328418return schemas
  • waeup_product/trunk/skins/waeup_default/getWAeUPTypes.py

    r45 r47  
     1#-*- mode: python; mode: fold -*-
    12##parameters=
    23# $Id$
     
    89ChangePermissions = 'Change permissions'
    910
    10 university_type = {
     11university_type = { ###(
    1112    'title': 'WAeUP Base Folder',
    1213    'description': 'The WAeUP Container',
     
    5556}
    5657
    57 students_folder_type = {
     58###)
     59
     60students_folder_type = { ###(
    5861    'title': 'WAeUP Student Folder',
    5962    'description': 'The WAeUP Student Folder',
     
    103106}
    104107
    105 student_type = {
     108###)
     109
     110student_type = { ###(
    106111    'title': 'WAeUP Student',
    107112    'description': '',
     
    116121    'global_allow': True,
    117122    'filter_content_types': True,
    118     'allowed_content_types': ('Jamb',),
     123    'allowed_content_types': ('Jamb','StudentPersonal'),
    119124    'allow_discussion': False,
    120125    'cps_is_searchable': True,
     
    130135         {'id': 'view',
    131136          'name': 'action_view',
    132           #'action': 'string:${object_url}/student_view',
    133           'action': 'string:${object_url}/cpsdocument_view',
     137          'action': 'string:${object_url}/student_view',
     138          #'action': 'string:${object_url}/cpsdocument_view',
    134139          'condition': '',
    135140          'permission': ('View',),
     
    137142          'visible': True,},
    138143         {'id': 'new_content',
    139           'name': 'Add Jamb Data',
     144          'name': 'Add Data',
    140145          'action': 'string:${object_url}/folder_factories',
    141           'condition': "python:len(object.contentItems()) == 0 ",
     146          'condition': "python:1 or len(object.contentItems()) == 0 ",
    142147          'permission': ('Modify portal content',),
    143148          'category': 'object',
     
    146151          'name': 'action_folder_contents',
    147152          'action': 'string:${object_url}/folder_contents',
    148           'condition': "python:object.getTypeInfo().cps_proxy_type != 'document'",
     153          'condition': "python:1 or object.getTypeInfo().cps_proxy_type != 'document'",
    149154          'permission': ('Modify portal content',),
    150155          'category': 'object',
     
    159164    )
    160165}
    161 scratch_card = {
     166
     167###)
     168
     169scratch_card = { ###(
    162170    'title': 'WAeUP Scratchcard',
    163171    'description': '',
     
    210218}
    211219#
    212 #
    213 jamb_type = {
     220###)
     221
     222jamb_type = { ###(
    214223    'title': "JAMB data",
    215224    'description': 'The data from JAMB',
     
    229238    #'schemas': ['common','metadata','jamb'],
    230239    'schemas': ['jamb'],
    231     'layouts': ['jamb',],
     240    'layouts': ['jamb'],
     241    'flexible_layouts': (),
     242    'storage_methods': ('admitted:store_admission_pin'),
     243    'cps_workspace_wf': 'workspace_content_wf',
     244    'cps_section_wf': 'section_content_wf',
     245}
     246
     247###)
     248
     249student_personal_type = { ###(
     250    'title': "Student personal data",
     251    'description': '',
     252    'content_icon': '',
     253    'content_meta_type': 'CPS Document',
     254    'product': 'CPSDocument',
     255    'factory': 'addCPSDocument',
     256    'immediate_view': 'cpsdocument_view',
     257    'global_allow': True,
     258    'filter_content_types': True,
     259    'allowed_content_types': (),
     260    'allow_discussion': False,
     261    'cps_is_searchable': True,
     262    'cps_proxy_type': 'document',
     263    'cps_display_as_document_in_listing': True,
     264    'cps_is_portalbox': False,
     265    #'schemas': ['common','metadata','jamb'],
     266    'schemas': ['student_personal'],
     267    'layouts': ['student_personal'],
    232268    'flexible_layouts': (),
    233269    'storage_methods': (),
     
    235271    'cps_section_wf': 'section_content_wf',
    236272}
     273###)
    237274
    238275types = {}
     
    240277types['StudentsFolder'] = students_folder_type
    241278types['Student'] = student_type
     279types['StudentPersonal'] = student_personal_type
    242280types['ScratchCard'] = scratch_card
    243281types['Jamb'] = jamb_type
  • waeup_product/trunk/skins/waeup_default/portlet_studentnavigation.pt

    r46 r47  
    11<tal:block define="mtool here/portal_membership;
    2                    anonymous mtool/isAnonymousUser"
     2                   anonymous mtool/isAnonymousUser;
     3                   user python: mtool.getAuthenticatedMember();
     4                   folder_id python:str(user)[1:]"
    35                   >
    4   <tal:block condition="not:anonymous">
     6  <tal:block condition="python: not anonymous">
    57    <a href="" i18n:translate=""
    6        tal:attributes="href string:${here/portal_url}/sections/unidemo/students">Studentadministration</a>
     8       tal:attributes="href string:${here/portal_url}/sections/unidemo/students/${folder_id}">Studentadministration</a>
    79  </tal:block>
    810  <tal:block condition="anonymous">
Note: See TracChangeset for help on using the changeset viewer.