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
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
def enabled(self): courses = ICourseContainer(self.schoolyear) if not flourish.canEdit(courses): return False return super(ImportCoursesLinkViewlet, self).enabled
def enabled(self): if not flourish.canEdit(self.schoolyears): return False return super(FlourishActivateNewYearLink, self).enabled
def enabled(self): year = self.view.schoolyear if year is None or not flourish.canEdit(year): return False return super(TermAddLinkViewlet, self).enabled
def enabled(self): prefs = IPersonPreferences(self.context) if not flourish.canEdit(prefs): return False return super(FlourishPersonPreferencesLink, self).enabled