Changeset 1437

Show
Ignore:
Timestamp:
03/23/11 17:31:50 (14 months ago)
Author:
zeank
Message:

on successfully registering for a group redisplay list of all
available groups

closes #283

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • HelpIM3/branches/chatgroups/HelpIM/chatgroup/pages/Subscription.py

    r1409 r1437  
    1717    def getPanelDef(self, *args, **kwargs): 
    1818        group_id = self.checkNotEmpty('group_id') 
     19 
    1920        if self.site.userIsAuthorized( 
    2021            user=self.him_request.session.session_user, 
    2122            script=self.editFunction): 
    22             editLink = {'action': [{'name':self.editFunction, 'text':'Bewerk deze pagina'}, 
    23                                    [{'actionParm': [{'name': 'newsType', 'value':self.newsType }]}] 
     23            editLink = {'action': [{'name':self.editFunction, 
     24                                    'text':'Bewerk deze pagina'}, 
     25                                   [{'actionParm': [{'name': 'newsType', 
     26                                                     'value':self.newsType }]}] 
    2427                                   ]} 
    2528        else: 
     
    5356                     {'name': self.function, 
    5457                      'text': 'aanmelden', 
    55                       'html:onclick': 'return showChatgroupSubscriptionForm(this);'} 
     58                      'html:onclick': 
     59                      'return showChatgroupSubscriptionForm(this);'} 
    5660                     ]}] 
    5761                 ]} 
    5862             ] 
    5963            ]} 
    60         className = '' 
    61         if not group_id: 
    62             className = 'hidden' 
     64        """ we need to redisplay the subscription form only in case of 
     65        an error when posting to an id""" 
     66        className = 'hidden' 
     67        if self.errors and group_id: 
     68            className = '' 
    6369        form = {'edit_panel': [ 
    6470            {'id': 'subscribe_group_form', 
     
    95101        htmlCode = {  'htmlCode': [ him_text.himTxt_text.replace(' ', ' ') ] } 
    96102 
    97         if self.checkNotEmpty('group_id'): 
     103        if self.errors and self.checkNotEmpty('group_id'): 
     104            """ only display single group if there was an error posting to it """ 
    98105            groups = [self.site.getChatgroupById(self.site, self.getParam('group_id'))] 
    99106        else: