Ignore:
Timestamp:
27 Feb 2012, 16:14:12 (13 years ago)
Author:
Henrik Bettermann
Message:

Backup work in progress

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py

    r7708 r7710  
    6161    grok.name('index')
    6262    grok.require('waeup.Public')
    63     label = 'Application Section'
     63    label = _('Application Section')
    6464    pnav = 3
    6565
     
    7373    grok.name('manage')
    7474    grok.template('applicantsrootmanagepage')
    75     label = 'Manage application section'
     75    label = _('Manage application section')
    7676    pnav = 3
    7777    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')
    8283
    8384    def update(self):
     
    101102        return get_users_with_local_roles(self.context)
    102103
    103     @jsaction('Remove selected')
     104    @jsaction(_('Remove selected'))
    104105    def delApplicantsContainers(self, **data):
    105106        form = self.request.form
     
    113114                deleted.append(id)
    114115            except:
    115                 self.flash('Could not delete %s: %s: %s' % (
     116                self.flash(_('Could not delete:') + ' %s: %s: %s' % (
    116117                        id, sys.exc_info()[0], sys.exc_info()[1]))
    117118        if len(deleted):
    118             self.flash('Successfully removed: %s' % ', '.join(deleted))
     119            self.flash(_('Successfully removed:') + ' %s' % ', '.join(deleted))
    119120        self.redirect(self.url(self.context, '@@manage'))
    120121        return
    121122
    122     @action('Add applicants container', validator=NullValidator)
     123    @action(_('Add applicants container'), validator=NullValidator)
    123124    def addApplicantsContainer(self, **data):
    124125        self.redirect(self.url(self.context, '@@add'))
    125126        return
    126127
    127     @action('Cancel', validator=NullValidator)
     128    @action(_('Cancel'), validator=NullValidator)
    128129    def cancel(self, **data):
    129130        self.redirect(self.url(self.context))
    130131        return
    131132
    132     @action('Add local role', validator=NullValidator)
     133    @action(_('Add local role'), validator=NullValidator)
    133134    def addLocalRole(self, **data):
    134135        return add_local_role(self,3, **data)
    135136
    136     @action('Remove selected local roles')
     137    @action(_('Remove selected local roles'))
    137138    def delLocalRoles(self, **data):
    138139        return del_local_roles(self,3,**data)
     
    143144    grok.name('add')
    144145    grok.template('applicantscontaineraddpage')
    145     label = 'Add applicants container'
     146    label = _('Add applicants container')
    146147    pnav = 3
    147148
     
    155156        return super(ApplicantsContainerAddFormPage, self).update()
    156157
    157     @action('Add applicants container')
     158    @action(_('Add applicants container'))
    158159    def addApplicantsContainer(self, **data):
    159160        year = data['year']
     
    164165        if code in self.context.keys():
    165166            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.'))
    168168            return
    169169        # Add new applicants container...
     
    174174        container.title = title
    175175        self.context[code] = container
    176         self.flash('Added: "%s".' % code)
     176        self.flash(_('Added:') + ' "%s".' % code)
    177177        self.redirect(self.url(self.context, u'@@manage'))
    178178        return
    179179
    180     @action('Cancel', validator=NullValidator)
     180    @action(_('Cancel'), validator=NullValidator)
    181181    def cancel(self, **data):
    182182        self.redirect(self.url(self.context, '@@manage'))
     
    186186    """
    187187    grok.context(IApplicantsRoot)
    188     title = u'Applicants'
     188    title = _(u'Applicants')
    189189
    190190class ApplicantsContainerBreadcrumb(Breadcrumb):
     
    250250    form_fields = grok.AutoFields(IApplicantsContainer).omit(
    251251        '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')]
    256256    # Use friendlier date widget...
    257257    form_fields['startdate'].custom_widget = FriendlyDateWidget('le')
     
    261261    @property
    262262    def label(self):
    263         return 'Manage applicants container'
     263        return _('Manage applicants container')
    264264
    265265    pnav = 3
     
    301301        self.applyData(self.context, **data)
    302302        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'))
    307307    def delApplicant(self, **data):
    308308        form = self.request.form
     
    310310            child_id = form['val_id']
    311311        else:
    312             self.flash('No applicant selected!')
     312            self.flash(_('No applicant selected!'))
    313313            self.redirect(self.url(self.context, '@@manage')+'?tab2')
    314314            return
     
    321321                deleted.append(id)
    322322            except:
    323                 self.flash('Could not delete %s: %s: %s' % (
     323                self.flash(_('Could not delete:') + ' %s: %s: %s' % (
    324324                        id, sys.exc_info()[0], sys.exc_info()[1]))
    325325        if len(deleted):
    326             self.flash('Successfully removed: %s' % ', '.join(deleted))
     326            self.flash(_('Successfully removed:') + ' %s' % ', '.join(deleted))
    327327        self.redirect(self.url(self.context, u'@@manage')+'?tab2')
    328328        return
    329329
    330     @action('Add applicant', validator=NullValidator)
     330    @action(_('Add applicant'), validator=NullValidator)
    331331    def addApplicant(self, **data):
    332332        self.redirect(self.url(self.context, 'addapplicant'))
    333333        return
    334334
    335     @action('Cancel', validator=NullValidator)
     335    @action(_('Cancel'), validator=NullValidator)
    336336    def cancel(self, **data):
    337337        self.redirect(self.url(self.context))
    338338        return
    339339
    340     @action('Add local role', validator=NullValidator)
     340    @action(_('Add local role'), validator=NullValidator)
    341341    def addLocalRole(self, **data):
    342342        return add_local_role(self,3, **data)
    343343
    344     @action('Remove selected local roles')
     344    @action(_('Remove selected local roles'))
    345345    def delLocalRoles(self, **data):
    346346        return del_local_roles(self,3,**data)
Note: See TracChangeset for help on using the changeset viewer.