示例#1
0
 def _before(self, *args, **kw):
     '''Prepare tmpl_context with navigation menus'''
     if self.assignment:
         c.sub_menu = menu(self.assignment, True)
     elif self.sheet:
         c.sub_menu = menu(self.sheet, True)
     elif self.event:
         c.sub_menu = menu(self.event, True)
示例#2
0
 def _before(self, *args, **kwargs):
     '''Prepare tmpl_context with navigation menus'''
     c.sub_menu = menu(self.submission)
     if request.user:
         c.newer = self.submission.newer_submissions()
         if c.newer:
             log.debug('Newer submissions than %d: ' % (self.submission.id)
                 + ','.join(str(s.id) for s in c.newer))
     else:
         c.newer = []
示例#3
0
 def _before(self, *args, **kwargs):
     '''Prepare tmpl_context with navigation menus'''
     c.sub_menu = menu(self.submission)
     if request.user:
         c.newer = self.submission.newer_submissions()
         if c.newer:
             log.debug('Newer submissions than %r: %s',
                 self.submission, ','.join(str(s.id) for s in c.newer))
     else:
         c.newer = []
示例#4
0
    def __init__(self, event):
        self.event = event
        self.sheets = SheetsController(event=self.event)
        self.lessons = LessonsController(event=self.event)
        self.admin = EventAdminController(event=self.event)
        c.event = self.event

        self.allow_only = Any(
            is_public(self.event),
            has_teacher(self.event),
            has_permission('manage'),
            msg=u'This Event is not public'
        )

        c.sub_menu = menu(self.event, True)
示例#5
0
 def _before(self, *args, **kwargs):
     '''Prepare tmpl_context with navigation menus'''
     #c.side_menu = entity_menu(self.event, 'Sheets', self.event.sheets)
     c.sub_menu = menu(self.event)
示例#6
0
 def _before(self, *args, **kwargs):
     '''Prepare tmpl_context with navigation menus'''
     c.sub_menu = menu(self.assignment)
示例#7
0
 def _before(self, *args, **kw):
     '''Prepare tmpl_context with navigation menus'''
     c.sub_menu = menu(self.lesson.event, True)
     super(LessonController, self)._before(*args, **kw)