Beispiel #1
0
 def __init__(self, *args, **kwargs):
     super(CreateUpdateForm, self).__init__(*args, **kwargs)
     self.fields['long_name'].help_text = _(
         'Type the name of your semester.')
     self.fields['start_time'].widget = DateTimePickerWidget(
         required=True,
         buttonlabel_novalue=pgettext_lazy(
             'CrAdmin datetime picker typo fix', 'Select a date/time'))
     self.fields['end_time'].widget = DateTimePickerWidget(
         required=True,
         buttonlabel_novalue=pgettext_lazy(
             'CrAdmin datetime picker typo fix', 'Select a date/time'))
Beispiel #2
0
    def __init__(self, *args, **kwargs):
        self.period = kwargs.pop('period')
        super(CreateForm, self).__init__(*args, **kwargs)
        self.fields['long_name'].help_text = _(
            'Type the name of your assignment.')
        self.fields['short_name'].help_text = _(
            'Up to 20 letters of lowercase english letters (a-z), '
            'numbers, underscore ("_") and hyphen ("-").')
        self.fields['first_deadline'].widget = DateTimePickerWidget(
            required=True,
            minimum_datetime=timezone.now() +
            timedelta(minutes=settings.
                      DEVILRY_ASSIGNMENT_PUBLISHING_TIME_DELAY_MINUTES),
            maximum_datetime=self.period.end_time)
        self.fields['first_deadline'].required = True
        self.fields['first_deadline'].label = _('Set first deadline')
        self.fields['first_deadline'].help_text = _(
            'The first deadline for this assignment. This is shared by all the '
            'students on the assignment.')

        # We ignore this, we just need to include it to be able to
        # change the value in clean()
        self.fields['publishing_time'].widget = forms.HiddenInput()
        self.fields['publishing_time'].required = False

        # We ignore this, we just need to include it to be able to
        # change the value in clean()
        self.fields['parentnode'].widget = forms.HiddenInput()
        self.fields['parentnode'].required = False
Beispiel #3
0
 def __init__(self, *args, **kwargs):
     self.last_deadline = kwargs.pop('last_deadline')
     super(ManageDeadlineForm, self).__init__(*args, **kwargs)
     self.fields['new_deadline'].widget = DateTimePickerWidget(
         buttonlabel_novalue=pgettext_lazy('CrAdmin datetime picker typo fix', 'Select a date/time'),
         minimum_datetime=self.get_minimum_datetime()
     )
     self.fields['new_deadline'].help_text = ugettext_lazy('Pick a date and time from the '
                                                           'calendar, or select one of the suggested deadlines.')
    def __init__(self, *args, **kwargs):
        self.period = kwargs.pop('period')
        super(CreateForm, self).__init__(*args, **kwargs)
        self.fields['long_name'].help_text = _(
            'Type the name of your assignment.')
        self.fields['short_name'].help_text = _(
            'Up to 20 letters of lowercase english letters (a-z), '
            'numbers, underscore ("_") and hyphen ("-").')

        # Set student import options data.
        self.fields['student_import_option'].help_text = _(
            'Choose how you would like to set up students for the new '
            'assignment. You can add all students from the semester, no '
            'students or copy students and examiners from previous '
            'assignments.')
        self.fields['student_import_option'].choices = []
        self.fields[
            'student_import_option'].choices = self.__create_student_import_choices(
            )

        self.fields['first_deadline'].widget = DateTimePickerWidget(
            buttonlabel_novalue=pgettext_lazy(
                'CrAdmin datetime picker typo fix', 'Select a date/time'),
            required=True,
            minimum_datetime=timezone.now() +
            timedelta(minutes=settings.
                      DEVILRY_ASSIGNMENT_PUBLISHING_TIME_DELAY_MINUTES),
            maximum_datetime=self.period.end_time)
        self.fields['first_deadline'].required = True
        self.fields['first_deadline'].label = _('Set first deadline')
        self.fields['first_deadline'].help_text = _(
            'The first deadline for this assignment. This is shared by all the '
            'students on the assignment.')

        # We ignore this, we just need to include it to be able to
        # change the value in clean()
        self.fields['publishing_time'].widget = forms.HiddenInput()
        self.fields['publishing_time'].required = False

        # We ignore this, we just need to include it to be able to
        # change the value in clean()
        self.fields['parentnode'].widget = forms.HiddenInput()
        self.fields['parentnode'].required = False
Beispiel #5
0
 def __init__(self, *args, **kwargs):
     super(AssignmentFirstDeadlineForm, self).__init__(*args, **kwargs)
     self.fields['first_deadline'].widget = DateTimePickerWidget()
     self.fields['first_deadline'].label = ugettext_lazy('First deadline')
Beispiel #6
0
 def __init__(self, *args, **kwargs):
     super(CreateUpdateForm, self).__init__(*args, **kwargs)
     self.fields['long_name'].help_text = _('Type the name of your semester.')
     self.fields['start_time'].widget = DateTimePickerWidget(required=True)
     self.fields['end_time'].widget = DateTimePickerWidget(required=True)