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

Denote session in button.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
3 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
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r14285 r14286  
    31913191            self.current_academic_session).title
    31923192        self.tickets = self._searchCatalog(self.current_academic_session)
    3193         self.editable_tickets = [
    3194             ticket for ticket in self.tickets if ticket.editable_by_lecturer]
    31953193        if not self.tickets:
    31963194            self.flash(_('No student found.'), type="warning")
    31973195            self.redirect(self.url(self.context))
    31983196            return
     3197        self.editable_tickets = [
     3198            ticket for ticket in self.tickets if ticket.editable_by_lecturer]
    31993199        if not 'UPDATE_TABLE' in form and not 'UPDATE_FILE' in form:
    32003200            return
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r13936 r14286  
    39493949        self.app['faculties']['fac1']['dep1'].score_editing_disabled = True
    39503950        self.browser.open(self.course_url)
    3951         self.browser.getLink("Update scores").click()
     3951        self.browser.getLink("Update session 2004/2005 scores").click()
    39523952        self.assertTrue('Score editing disabled' in self.browser.contents)
    39533953        self.app['faculties']['fac1']['dep1'].score_editing_disabled = False
    39543954        self.browser.open(self.course_url)
    3955         self.browser.getLink("Update scores").click()
     3955        self.browser.getLink("Update session 2004/2005 scores").click()
    39563956        self.assertFalse('Score editing disabled' in self.browser.contents)
    39573957
Note: See TracChangeset for help on using the changeset viewer.