1858
1858
app_states_name = 'section-instruction'
1861
class SectionSignInOutPDFView(SignInOutPDFView):
1861
class SectionPDFViewBase(object):
1864
def subtitles_left(self):
1865
section = removeSecurityProxy(self.context)
1866
instructors = '; '.join([person.title
1867
for person in section.instructors])
1868
locations = '; '.join([r.title for r in self.context.resources
1869
if ILocation(r, None) is not None])
1870
instructors_message = _('Instructors: ${instructors}',
1871
mapping={'instructors': instructors})
1872
locations_message = _('Locations: ${locations}',
1873
mapping={'locations': locations})
1875
'%s (%s)' % (section.title, section.__name__),
1876
instructors_message,
1883
term = ITerm(self.context)
1884
schoolyear = term.__parent__
1885
return '%s | %s' % (term.title, schoolyear.title)
1889
return ', '.join([course.title for course in self.context.courses])
1892
class SectionSignInOutPDFView(SectionPDFViewBase, SignInOutPDFView):
1864
1895
def message_title(self):
1865
1896
return _("section ${title} sign in & out",
1866
1897
mapping={'title': self.context.title})
1868
def formatDate(self, date, format='mediumDate'):
1871
formatter = getMultiAdapter((date, self.request), name=format)
1876
term = ITerm(self.context)
1877
schoolyear = term.__parent__
1878
return '%s | %s' % (term.title, schoolyear.title)
1881
def subtitles_left(self):
1882
section = removeSecurityProxy(self.context)
1883
instructors = '; '.join([person.title
1884
for person in section.instructors])
1885
instructors_message = _('Instructors: ${instructors}',
1886
mapping={'instructors': instructors})
1888
'%s (%s)' % (section.title, section.__name__),
1889
instructors_message,
1895
return ', '.join([course.title for course in self.context.courses])
1898
1900
def base_filename(self):
1899
1901
courses = [c.__name__ for c in self.context.courses]
1914
1916
return _("section ${title} roster",
1915
1917
mapping={'title': self.context.title})
1917
def formatDate(self, date, format='mediumDate'):
1920
formatter = getMultiAdapter((date, self.request), name=format)
1925
term = ITerm(self.context)
1926
schoolyear = term.__parent__
1927
return '%s | %s' % (term.title, schoolyear.title)
1930
def subtitles_left(self):
1931
section = removeSecurityProxy(self.context)
1932
instructors = '; '.join([person.title
1933
for person in section.instructors])
1934
instructors_message = _('Instructors: ${instructors}',
1935
mapping={'instructors': instructors})
1937
'%s (%s)' % (section.title, section.__name__),
1938
instructors_message,
1944
return ', '.join([course.title for course in self.context.courses])
1947
1920
def base_filename(self):
1948
1921
courses = [c.__name__ for c in self.context.courses]
2025
1998
mapping={'title': self.context.title})
2029
term = ITerm(self.context)
2030
schoolyear = term.__parent__
2031
return '%s | %s' % (term.title, schoolyear.title)
2034
def subtitles_left(self):
2035
section = removeSecurityProxy(self.context)
2036
instructors = '; '.join([person.title
2037
for person in section.instructors])
2038
instructors_message = _('Instructors: ${instructors}',
2039
mapping={'instructors': instructors})
2041
'%s (%s)' % (section.title, section.__name__),
2042
instructors_message,
2048
return ', '.join([course.title for course in self.context.courses])
2051
2001
def base_filename(self):
2052
2002
courses = [c.__name__ for c in self.context.courses]
2053
2003
return 'section_mailing_labels_%s' % '_'.join(courses)