Example #1
0
 def enabled(self):
     gradebook = removeSecurityProxy(self.context)
     worksheet = gradebook.context
     if worksheet.hidden:
         return False
     courses = list(ISection(gradebook).courses)
     if not courses:
         return False
     for course in courses:
         if not flourish.canEdit(course):
             return False
     return super(DeployAsCourseWorksheetLinkViewlet, self).enabled
Example #2
0
 def courses(self):
     courses = []
     request_courses = self.request.get('courses', [])
     for course in ISection(self.context).courses:
         if not flourish.canEdit(course):
             continue
         checked = ('SUBMIT' not in self.request
                    or course.__name__ in request_courses)
         courses.append({
             'name': course.__name__,
             'title': course.title,
             'checked': checked and 'checked' or '',
             'obj': course,
         })
     return courses
Example #3
0
 def enabled(self):
     courses = ICourseContainer(self.schoolyear)
     if not flourish.canEdit(courses):
         return False
     return super(ImportCoursesLinkViewlet, self).enabled
Example #4
0
 def enabled(self):
     if not flourish.canEdit(self.schoolyears):
         return False
     return super(FlourishActivateNewYearLink, self).enabled
Example #5
0
 def enabled(self):
     if not flourish.canEdit(self.schoolyears):
         return False
     return super(FlourishActivateNewYearLink, self).enabled
Example #6
0
 def enabled(self):
     year = self.view.schoolyear
     if year is None or not flourish.canEdit(year):
         return False
     return super(TermAddLinkViewlet, self).enabled
Example #7
0
 def enabled(self):
     prefs = IPersonPreferences(self.context)
     if not flourish.canEdit(prefs):
         return False
     return super(FlourishPersonPreferencesLink, self).enabled
Example #8
0
 def enabled(self):
     courses = ICourseContainer(self.schoolyear)
     if not flourish.canEdit(courses):
         return False
     return super(ImportCoursesLinkViewlet, self).enabled
Example #9
0
 def enabled(self):
     prefs = IPersonPreferences(self.context)
     if not flourish.canEdit(prefs):
         return False
     return super(FlourishPersonPreferencesLink, self).enabled