Ignore:
Timestamp:
17 Nov 2016, 21:27:49 (8 years ago)
Author:
Henrik Bettermann
Message:

Denote session in button.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/viewlets.py

    r13935 r14286  
    3434from waeup.kofa.interfaces import (
    3535    IKofaUtils, IKofaObject,
    36     IDataCenter, IUserAccount)
     36    IDataCenter, IUserAccount,
     37    academic_sessions_vocab)
    3738from waeup.kofa.utils.helpers import get_user_account
    3839
     
    558559    grok.require('waeup.editScores')
    559560    icon = 'actionicon_scores.png'
    560     text = _('Update scores')
    561561    target = 'edit_scores'
    562562    grok.order(4)
     563
     564    @property
     565    def target_url(self):
     566        ca = grok.getSite()[
     567            'configuration'].current_academic_session
     568        if not ca:
     569            return ''
     570        return self.view.url(self.view.context, self.target)
     571
     572    @property
     573    def text(self):
     574        ca = grok.getSite()[
     575            'configuration'].current_academic_session
     576        st = academic_sessions_vocab.getTerm(ca).title
     577        return _('Update session ${a} scores', mapping = {'a':st})
    563578
    564579
Note: See TracChangeset for help on using the changeset viewer.