class IScheduleEventAddForm(Interface): """Schema for schedule calendar event adding form.""" title = zope.schema.TextLine(title=_("Title"), required=False) allday = zope.schema.Bool(title=_("All day"), required=False) start_date = zope.schema.Date(title=_("Date"), required=False) start_time = zope.schema.TextLine( title=_("Time"), description=_("Start time in 24h format"), required=False) duration = zope.schema.Int(title=_("Duration"), required=False, default=60) duration_type = zope.schema.Choice(title=_("Duration Type"), required=False, default="minutes", vocabulary=vocabulary([ ("minutes", _("Minutes")), ("hours", _("Hours")), ("days", _("Days")) ])) location = zope.schema.TextLine(title=_("Location"), required=False) description = HtmlFragment(title=_("Description"), required=False)
def getLimitKeyVocabularyForResourceFields( resource_field_description_container): return vocabulary([ ('resource', _('Resource')), ('location', _('Location')), ('equipment', _('Equipment')), ])
class IApplicationPreferences(ICalendarDisplayPreferences): """Preferences stored in an annotation on the SchoolToolApplication.""" title = zope.schema.TextLine( title=_("Title"), required=True, description=_( "The name for the school or organization running " "this server. This will be displayed on the public calendar, the " "bottom of all pages and in the page title.")) frontPageCalendar = zope.schema.Bool( title=_("Front Page Calendar"), description=_( "Display site-wide calendar as the front page of the site."), required=False, default=True) logo = Image( title=_("School logo"), format="JPEG", required=False) name_sorting = zope.schema.Choice( title=_('Name sorting'), vocabulary=vocabulary([('first_name', _('First name')), ('last_name', _('Last name'))]))
class IDeleteRecurringEventForm(Interface): delete = zope.schema.Choice( title=_("Delete"), vocabulary=vocabulary([ ("all", _("All occurrences of this event")), ("current", _("Only current occurrence")), ("future", _("This and all future occurrences"))]), default="current", required=True, )
class IBasicPerson(Interface): """Marker interface for a basic person.""" prefix = TextLine( title=_(u"Prefix"), required=False, ) first_name = TextLine( title=_(u"First name"), required=True, ) middle_name = TextLine( title=_(u"Middle name"), required=False, ) last_name = TextLine( title=_(u"Last name"), required=True, ) suffix = TextLine( title=_(u"Suffix"), required=False, ) preferred_name = TextLine( title=_(u"Preferred name"), required=False, ) gender = Choice( title=_(u"Gender"), vocabulary=vocabulary([ ('male', _('Male')), ('female', _('Female')), ]), required=False, ) birth_date = Date( title=_(u"Birth date"), description=_(u"(yyyy-mm-dd)"), required=False, ) advisors = Attribute("""Advisors of the person""") advisees = Attribute("""Advisees of the person""") levels = Attribute("""Levels of the student""")
class ICalendarDisplayPreferences(Interface): """Preferences for displaying calendar events.""" timezone = Choice( title=_("Time Zone"), values=pytz.common_timezones) timeformat = Choice( title=_("Time Format"), vocabulary=vocabulary([("%H:%M", _("HH:MM")), ("%I:%M %p", _("HH:MM am/pm"))])) dateformat = Choice( title=_("Date Format"), vocabulary=vocabulary([("%m/%d/%y", _("MM/DD/YY")), ("%Y-%m-%d", _("YYYY-MM-DD")), ("%d %B, %Y", _("Day Month, Year"))])) # SUNDAY and MONDAY are integers, 6 and 0 respectivley weekstart = Choice( title=_("Week starts on"), vocabulary=vocabulary([(calendar.SATURDAY, _("Saturday")), (calendar.SUNDAY, _("Sunday")), (calendar.MONDAY, _("Monday"))]))
def getLimitKeyVocabularyForResourceFields(resource_field_description_container): return vocabulary([ ('resource', _('Resource')), ('location', _('Location')), ('equipment', _('Equipment')), ])
from schooltool.app.interfaces import ISchoolToolCalendarEvent from schooltool.app.interfaces import ISchoolToolCalendar from schooltool.app.interfaces import IHaveCalendar from schooltool.app.utils import vocabulary from schooltool.calendar.interfaces import ICalendar from schooltool.common import SchoolToolMessage as _ # # Schedule # activity_types = vocabulary( [("lesson", _("Lesson")), ("homeroom", _("Homeroom")), ("free", _("Free")), ("lunch", _("Lunch")), ]) class IPeriod(IContained): """A period of activity.""" title = zope.schema.TextLine( title=u"Title of the period.", required=False) activity_type = zope.schema.Choice( title=_("Activity type."), required=True, default="lesson",
def getLimitKeyVocabularyForPersonFields(person_field_description_container): return vocabulary([ ('students', _('Students')), ('teachers', _('Teachers')), ('administrators', _('Administrators')), ])