Example #1
0
    def __init__(self, user, *args, **kwargs):
        super(EventForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.form_class = 'well'
        css_class = 'col-md-6'
        self.helper.layout = Layout(
            Fieldset(_('Event Settings')),
            Div(
                Div('title', css_class=css_class),
                Div('calendar', css_class=css_class),
                Div('creator', css_class=css_class),
                Div('created_on', css_class=css_class),
                Div('rule', css_class=css_class),
                Div('end_recurring_period', css_class=css_class),
                Div('start', css_class=css_class),
                Div('end', css_class=css_class),
                css_class='row'
            ),
            Div(
                Div('description', css_class=css_class),
                Div('data', css_class=css_class),
                css_class='row'
            ),
        )
        if self.instance.id:
            common_submit_buttons(self.helper.layout, 'update')
        else:
            common_submit_buttons(self.helper.layout)

        calendar_user_list = get_calendar_user_id_list(user)
        self.fields['calendar'].choices = get_calendar_list(calendar_user_list)
        self.fields['creator'].choices = get_calendar_user_list(calendar_user_list)
Example #2
0
 def __init__(self, user, *args, **kwargs):
     super(EventSearchForm, self).__init__(*args, **kwargs)
     calendar_user_list = get_calendar_user_id_list(user)
     self.fields['calendar_id'].choices = get_calendar_list(calendar_user_list)
     self.fields['calendar_user_id'].choices = get_calendar_user_list(calendar_user_list)
     for i in ['calendar_id', 'calendar_user_id']:
         self.fields[i].widget.attrs['class'] = "form-control"
Example #3
0
    def __init__(self, user, *args, **kwargs):
        super(EventForm, self).__init__(*args, **kwargs)
        self.fields.keyOrder = [
            'title', 'calendar', 'creator', 'rule', 'start', 'end',
            'end_recurring_period', 'description', 'data'
        ]

        for i in self.fields.keyOrder:
            self.fields[i].widget.attrs['class'] = "form-control"
        calendar_user_list = get_calendar_user_id_list(user)
        self.fields['calendar'].choices = get_calendar_list(calendar_user_list)
        self.fields['creator'].choices = get_calendar_user_list(calendar_user_list)
Example #4
0
 def __init__(self, user, *args, **kwargs):
     super(CalendarForm, self).__init__(*args, **kwargs)
     self.helper = FormHelper()
     self.helper.form_class = 'well'
     self.helper.layout = Layout(
         Fieldset('', 'name', 'user', 'max_concurrent', css_class='col-xs-4')
     )
     if self.instance.id:
         form_action = common_submit_buttons(default_action='update')
     else:
         form_action = common_submit_buttons(default_action='add')
     self.helper.layout.append(form_action)
     calendar_user_list = get_calendar_user_id_list(user)
     self.fields['user'].choices = get_calendar_user_list(calendar_user_list)
Example #5
0
 def __init__(self, user, *args, **kwargs):
     super(EventSearchForm, self).__init__(*args, **kwargs)
     self.helper = FormHelper()
     self.helper.form_class = 'well'
     css_class = 'col-md-4'
     self.helper.layout = Layout(
         Div(
             Div('start_date', css_class=css_class),
             Div('calendar_id', css_class=css_class),
             Div('calendar_user_id', css_class=css_class),
             css_class='row'
         ),
     )
     common_submit_buttons(self.helper.layout, 'search')
     calendar_user_list = get_calendar_user_id_list(user)
     self.fields['calendar_id'].choices = get_calendar_list(calendar_user_list)
     self.fields['calendar_user_id'].choices = get_calendar_user_list(calendar_user_list)
Example #6
0
    def __init__(self, *args, **kwargs):
        super(EventAdminForm, self).__init__(*args, **kwargs)

        calendar_user_list = get_all_calendar_user_id_list()
        self.fields['creator'].choices = get_calendar_user_list(calendar_user_list)
Example #7
0
 def __init__(self, user, *args, **kwargs):
     super(CalendarForm, self).__init__(*args, **kwargs)
     calendar_user_list = get_calendar_user_id_list(user)
     self.fields['user'].choices = get_calendar_user_list(calendar_user_list)
     for i in self.fields.keyOrder:
         self.fields[i].widget.attrs['class'] = "form-control"