- Timestamp:
- 27 Feb 2012, 16:14:12 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r7708 r7710 61 61 grok.name('index') 62 62 grok.require('waeup.Public') 63 label = 'Application Section'63 label = _('Application Section') 64 64 pnav = 3 65 65 … … 73 73 grok.name('manage') 74 74 grok.template('applicantsrootmanagepage') 75 label = 'Manage application section'75 label = _('Manage application section') 76 76 pnav = 3 77 77 grok.require('waeup.manageApplication') 78 taboneactions = ['Add applicants container', 'Remove selected','Cancel'] 79 tabtwoactions1 = ['Remove selected local roles'] 80 tabtwoactions2 = ['Add local role'] 81 subunits = 'Applicants Containers' 78 taboneactions = [_('Add applicants container'), _('Remove selected'), 79 _('Cancel')] 80 tabtwoactions1 = [_('Remove selected local roles')] 81 tabtwoactions2 = [_('Add local role')] 82 subunits = _('Applicants Containers') 82 83 83 84 def update(self): … … 101 102 return get_users_with_local_roles(self.context) 102 103 103 @jsaction( 'Remove selected')104 @jsaction(_('Remove selected')) 104 105 def delApplicantsContainers(self, **data): 105 106 form = self.request.form … … 113 114 deleted.append(id) 114 115 except: 115 self.flash( 'Could not delete%s: %s: %s' % (116 self.flash(_('Could not delete:') + ' %s: %s: %s' % ( 116 117 id, sys.exc_info()[0], sys.exc_info()[1])) 117 118 if len(deleted): 118 self.flash( 'Successfully removed:%s' % ', '.join(deleted))119 self.flash(_('Successfully removed:') + ' %s' % ', '.join(deleted)) 119 120 self.redirect(self.url(self.context, '@@manage')) 120 121 return 121 122 122 @action( 'Add applicants container', validator=NullValidator)123 @action(_('Add applicants container'), validator=NullValidator) 123 124 def addApplicantsContainer(self, **data): 124 125 self.redirect(self.url(self.context, '@@add')) 125 126 return 126 127 127 @action( 'Cancel', validator=NullValidator)128 @action(_('Cancel'), validator=NullValidator) 128 129 def cancel(self, **data): 129 130 self.redirect(self.url(self.context)) 130 131 return 131 132 132 @action( 'Add local role', validator=NullValidator)133 @action(_('Add local role'), validator=NullValidator) 133 134 def addLocalRole(self, **data): 134 135 return add_local_role(self,3, **data) 135 136 136 @action( 'Remove selected local roles')137 @action(_('Remove selected local roles')) 137 138 def delLocalRoles(self, **data): 138 139 return del_local_roles(self,3,**data) … … 143 144 grok.name('add') 144 145 grok.template('applicantscontaineraddpage') 145 label = 'Add applicants container'146 label = _('Add applicants container') 146 147 pnav = 3 147 148 … … 155 156 return super(ApplicantsContainerAddFormPage, self).update() 156 157 157 @action( 'Add applicants container')158 @action(_('Add applicants container')) 158 159 def addApplicantsContainer(self, **data): 159 160 year = data['year'] … … 164 165 if code in self.context.keys(): 165 166 self.flash( 166 'An applicants container for the same application ' 167 'type and entrance year exists already in the database.') 167 _('An applicants container for the same application type and entrance year exists already in the database.')) 168 168 return 169 169 # Add new applicants container... … … 174 174 container.title = title 175 175 self.context[code] = container 176 self.flash( 'Added:"%s".' % code)176 self.flash(_('Added:') + ' "%s".' % code) 177 177 self.redirect(self.url(self.context, u'@@manage')) 178 178 return 179 179 180 @action( 'Cancel', validator=NullValidator)180 @action(_('Cancel'), validator=NullValidator) 181 181 def cancel(self, **data): 182 182 self.redirect(self.url(self.context, '@@manage')) … … 186 186 """ 187 187 grok.context(IApplicantsRoot) 188 title = u'Applicants'188 title = _(u'Applicants') 189 189 190 190 class ApplicantsContainerBreadcrumb(Breadcrumb): … … 250 250 form_fields = grok.AutoFields(IApplicantsContainer).omit( 251 251 'title', 'description_dict') 252 taboneactions = [ 'Save','Cancel']253 tabtwoactions = [ 'Add applicant', 'Remove selected','Cancel']254 tabthreeactions1 = [ 'Remove selected local roles']255 tabthreeactions2 = [ 'Add local role']252 taboneactions = [_('Save'),_('Cancel')] 253 tabtwoactions = [_('Add applicant'), _('Remove selected'),_('Cancel')] 254 tabthreeactions1 = [_('Remove selected local roles')] 255 tabthreeactions2 = [_('Add local role')] 256 256 # Use friendlier date widget... 257 257 form_fields['startdate'].custom_widget = FriendlyDateWidget('le') … … 261 261 @property 262 262 def label(self): 263 return 'Manage applicants container'263 return _('Manage applicants container') 264 264 265 265 pnav = 3 … … 301 301 self.applyData(self.context, **data) 302 302 self.context.description_dict = self._description() 303 self.flash( 'Form has been saved.')304 return 305 306 @jsaction( 'Remove selected')303 self.flash(_('Form has been saved.')) 304 return 305 306 @jsaction(_('Remove selected')) 307 307 def delApplicant(self, **data): 308 308 form = self.request.form … … 310 310 child_id = form['val_id'] 311 311 else: 312 self.flash( 'No applicant selected!')312 self.flash(_('No applicant selected!')) 313 313 self.redirect(self.url(self.context, '@@manage')+'?tab2') 314 314 return … … 321 321 deleted.append(id) 322 322 except: 323 self.flash( 'Could not delete%s: %s: %s' % (323 self.flash(_('Could not delete:') + ' %s: %s: %s' % ( 324 324 id, sys.exc_info()[0], sys.exc_info()[1])) 325 325 if len(deleted): 326 self.flash( 'Successfully removed:%s' % ', '.join(deleted))326 self.flash(_('Successfully removed:') + ' %s' % ', '.join(deleted)) 327 327 self.redirect(self.url(self.context, u'@@manage')+'?tab2') 328 328 return 329 329 330 @action( 'Add applicant', validator=NullValidator)330 @action(_('Add applicant'), validator=NullValidator) 331 331 def addApplicant(self, **data): 332 332 self.redirect(self.url(self.context, 'addapplicant')) 333 333 return 334 334 335 @action( 'Cancel', validator=NullValidator)335 @action(_('Cancel'), validator=NullValidator) 336 336 def cancel(self, **data): 337 337 self.redirect(self.url(self.context)) 338 338 return 339 339 340 @action( 'Add local role', validator=NullValidator)340 @action(_('Add local role'), validator=NullValidator) 341 341 def addLocalRole(self, **data): 342 342 return add_local_role(self,3, **data) 343 343 344 @action( 'Remove selected local roles')344 @action(_('Remove selected local roles')) 345 345 def delLocalRoles(self, **data): 346 346 return del_local_roles(self,3,**data)
Note: See TracChangeset for help on using the changeset viewer.