class SessionForm(IndicoForm): title = StringField(_('Title'), [DataRequired()]) code = StringField( _('Session code'), description=_('The code that will identify the session in the Book of ' 'Abstracts.')) description = TextAreaField(_('Description')) default_contribution_duration = TimeDeltaField( _('Default contribution duration'), units=('minutes', 'hours'), description=_('Duration that a contribution created within this ' 'session will have by default.'), default=timedelta(minutes=20)) type = QuerySelectField(_("Type"), get_label='name', allow_blank=True, blank_text=_("No type selected")) location_data = IndicoLocationField( _("Default location"), description=_("Default location for blocks inside the session.")) colors = IndicoPalettePickerField(_('Colours'), color_list=get_colors()) def __init__(self, *args, **kwargs): event = kwargs.pop('event') super(SessionForm, self).__init__(*args, **kwargs) if event.type != 'conference': del self.code del self.type else: self.type.query = SessionType.query.with_parent(event) if not self.type.query.has_rows(): del self.type
class SessionForm(IndicoForm): title = StringField(_('Title'), [DataRequired()]) code = StringField( _('Session code'), description=_('The code that will identify the session in the Book of ' 'Abstracts.')) description = TextAreaField(_('Description')) default_contribution_duration = TimeDeltaField( _('Default contribution duration'), units=('minutes', 'hours'), description=_('Duration that a contribution created within this ' 'session will have by default.'), default=timedelta(minutes=20)) location_data = IndicoLocationField( _("Default location"), description=_("Default location for blocks inside the session.")) colors = IndicoPalettePickerField(_('Colours'), color_list=get_colors()) is_poster = BooleanField( _('Poster session'), widget=SwitchWidget(), description= _('Whether the session is a poster session or contains normal presentations.' )) def __init__(self, *args, **kwargs): event = kwargs.pop('event') super(SessionForm, self).__init__(*args, **kwargs) if event.type != 'conference': del self.is_poster del self.code
class BreakEntryForm(EntryFormMixin, IndicoForm): _entry_type = TimetableEntryType.BREAK _default_duration = timedelta(minutes=20) _display_fields = ('title', 'description', 'time', 'duration', 'location_data', 'colors') title = StringField(_("Title"), [DataRequired()]) description = TextAreaField(_("Description")) location_data = IndicoLocationField(_("Location")) colors = IndicoPalettePickerField(_('Colours'), color_list=get_colors())