Ignore:
Timestamp:
18 Nov 2016, 07:19:25 (8 years ago)
Author:
Henrik Bettermann
Message:

Lecturers can edit current session and previous session courses whenever they like. All restrictions are removed.

File:
1 edited

Legend:

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

    r13357 r14288  
    1818
    1919import grok
    20 from waeup.kofa.interfaces import IKofaObject
    21 from waeup.kofa.browser.viewlets import PrimaryNavTab
     20from waeup.kofa.interfaces import IKofaObject, academic_sessions_vocab
     21from waeup.kofa.browser.viewlets import (
     22    PrimaryNavTab, ManageActionButton, UpdateScoresActionButton)
    2223from waeup.aaue.interfaces import MessageFactory as _
    2324
     
    4142            return self.view.application_url('applicants') + '/checkstatus'
    4243        return
     44
     45
     46class UpdatePreviousSessionScoresActionButton(UpdateScoresActionButton):
     47    """ 'Update scores' button in course.
     48    """
     49    grok.name('updateprevscores')
     50    target = 'edit_prev_scores'
     51
     52    @property
     53    def target_url(self):
     54        ca = grok.getSite()[
     55            'configuration'].current_academic_session
     56        if not ca:
     57            return ''
     58        return self.view.url(self.view.context, self.target)
     59
     60    @property
     61    def text(self):
     62        ca = grok.getSite()[
     63            'configuration'].current_academic_session
     64        st = academic_sessions_vocab.getTerm(ca-1).title
     65        return _('Update session ${a} scores', mapping = {'a':st})
     66
Note: See TracChangeset for help on using the changeset viewer.