Changeset 1379 for HelpIM3

Show
Ignore:
Timestamp:
01/20/11 14:23:29 (16 months ago)
Author:
zeank
Message:

some code cleanup
refs #251

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • HelpIM3/branches/chatgroups/HelpIM/questionair/templates/ShowQuestionairsPanel.py

    r693 r1379  
    1515 
    1616    def getMenuAttributes(self, *pargs, **kwargs): 
    17         return { 'currentMenu':     'Vragen', 
    18                  'currentSubMenu':   'Enquetes' 
    19             } 
     17        return { 'currentMenu':     'Vragen'} 
    2018 
    2119    def getPanelDef(self, *pargs, **kwargs): 
    22         """ This is the base/default-getPanelDef-method and needs to be overridden  
    23         for useful functionality. 
    24         Its purpose is to return a panel-definition that is displayable in (most probably) a browser. 
    25         """ 
    2620        self.log.debug('PageBase.getPanelDef()') 
    27         addAction = {    'action': [  {'name':'AddQuestionair', 'text':'Voeg een enquete toe'} ] } 
    28         table = self.getTableDef(addAction)   
    29         panel_def = {  'panel_def': [  [   table ]  ] } 
    30         return [table] 
    31          
    32     def getTableDef(self, addAction): 
    33         """ This is the base/default-getPanelDef-method and needs to be overridden  
    34         for useful functionality. 
    35         Its purpose is to return a panel-definition that is displayable in (most probably) a browser. 
    36         """ 
    37         self.log.debug('.getTableDef()') 
    38         table = {  'table_panel': [   
    39                      [    {  'table_column': [  {     'heading':'Enquete-naam', 
    40                                                                 'attrName':'questionair_name', 
    41                                                 } 
    42                                              ]  
    43                           }, 
    44                           {  'table_column': [  {    'heading':'Start-datum', 
    45                                                      'attrName': 'questionair_start_date' 
    46                                                      } 
    47                                                  ]  
    48                           }, 
    49                           {  'table_column': [  {    'heading':'Eind-datum', 
    50                                                      'attrName': 'questionair_end_date' 
    51                                                      } 
    52                                                  ]  
    53                           }, 
    54                           {  'table_column': [   {    'type':'action' }, 
    55                                                  [ {    'action': [  {'name':self.editAction, 'text':'details'}, 
    56                                                                   [  {'actionParm': [    {'name': 'questionair_id', 'valueAttr':'questionair_id' } ]         }] 
     21        table = {'table_panel': [ 
     22            {'panelName': self.panelName}, 
     23            [ 
     24            {'table_column': [{'heading':'Enquete-naam', 
     25                               'attrName':'questionair_name'}]}, 
     26            {'table_column': [{'heading':'Start-datum', 
     27                               'attrName': 'questionair_start_date'}]}, 
     28            {'table_column': [{'heading':'Eind-datum', 
     29                               'attrName': 'questionair_end_date'}]}, 
     30            {'table_column': [{'type':'action'}, 
     31                              [{'action': 
     32                                [{'name':self.editAction, 
     33                                  'text':'details'}, 
     34                                 [{'actionParm': 
     35                                   [{'name': 'questionair_id', 
     36                                     'valueAttr':'questionair_id'}] 
     37                                   }] 
     38                                  ] 
     39                                }] 
     40                              ]}, 
     41            {'action': [{'name':'AddQuestionair', 
     42                         'text':'Voeg een enquete toe'}]} 
     43            ]]} 
    5744 
    58                                                                  ] 
    59  
    60                                                  }] 
    61                                              ]  
    62                           }, 
    63                           {  'table_column': [   {    'type':'action' }, 
    64                                                  [ {    'action': [  {'name':'ShowQuestions', 'text':'vragen'}, 
    65                                                                   [  {'actionParm': [    {'name': 'questionair_id', 'valueAttr':'questionair_id' } ]         }] 
    66                              
    67                                                                  ] 
    68                              
    69                                                  }] 
    70                                          ]  
    71                           }, 
    72                           addAction 
    73                       ] 
    74                          ] } 
    75  
    76         return table 
     45        return [{'panel_def': [[table]]}]