summaryrefslogtreecommitdiff
path: root/yaksh/forms.py
diff options
context:
space:
mode:
authoradityacp2020-01-02 15:35:07 +0530
committeradityacp2020-01-02 15:35:07 +0530
commit887cfb20d0ba158aa0e0838d6b40f334084d202e (patch)
tree3c74882521f3a3c358871e8eabd94b8e1f6ef304 /yaksh/forms.py
parent29f93bce956af26e1b3ffe5ffc04e02c9f32de59 (diff)
downloadonline_test-887cfb20d0ba158aa0e0838d6b40f334084d202e.tar.gz
online_test-887cfb20d0ba158aa0e0838d6b40f334084d202e.tar.bz2
online_test-887cfb20d0ba158aa0e0838d6b40f334084d202e.zip
Change courses page with new UI
Diffstat (limited to 'yaksh/forms.py')
-rw-r--r--yaksh/forms.py38
1 files changed, 34 insertions, 4 deletions
diff --git a/yaksh/forms.py b/yaksh/forms.py
index aa4d7b9..8cc3d0a 100644
--- a/yaksh/forms.py
+++ b/yaksh/forms.py
@@ -308,6 +308,30 @@ class QuestionFilterForm(forms.Form):
class CourseForm(forms.ModelForm):
""" course form for moderators """
+ def __init__(self, *args, **kwargs):
+ super(CourseForm, self).__init__(*args, **kwargs)
+ self.fields['name'].widget.attrs.update(
+ {'class': form_input_class, 'placeholder': 'Course Name'}
+ )
+ self.fields['enrollment'].widget.attrs.update(
+ {'class': 'custom-select'}
+ )
+ self.fields['code'].widget.attrs.update(
+ {'class': form_input_class, 'placeholder': 'Course Code'}
+ )
+ self.fields['instructions'].widget.attrs.update(
+ {'class': form_input_class, 'placeholder': 'Course instructions'}
+ )
+ self.fields['start_enroll_time'].widget.attrs.update(
+ {'class': form_input_class, 'placeholder': 'Course Start DateTime'}
+ )
+ self.fields['end_enroll_time'].widget.attrs.update(
+ {'class': form_input_class, 'placeholder': 'Course End DateTime'}
+ )
+ self.fields['grading_system'].widget.attrs.update(
+ {'class': 'custom-select'}
+ )
+
def save(self, commit=True, *args, **kwargs):
instance = super(CourseForm, self).save(commit=False)
if instance.code:
@@ -346,18 +370,24 @@ class ProfileForm(forms.ModelForm):
user = kwargs.pop('user')
super(ProfileForm, self).__init__(*args, **kwargs)
self.fields['first_name'].initial = user.first_name
+ self.fields['first_name'].widget.attrs.update(
+ {'class': form_input_class, 'placeholder': 'First Name'}
+ )
self.fields['last_name'].initial = user.last_name
+ self.fields['last_name'].widget.attrs.update(
+ {'class': form_input_class, 'placeholder': 'Last Name'}
+ )
self.fields['institute'].widget.attrs.update(
- {'class': form_input_class}
+ {'class': form_input_class, 'placeholder': 'Institute'}
)
self.fields['department'].widget.attrs.update(
- {'class': form_input_class}
+ {'class': form_input_class, 'placeholder': 'Department'}
)
self.fields['roll_number'].widget.attrs.update(
- {'class': form_input_class}
+ {'class': form_input_class, 'placeholder': 'Roll Number'}
)
self.fields['position'].widget.attrs.update(
- {'class': form_input_class}
+ {'class': form_input_class, 'placeholder': 'Position'}
)
self.fields['timezone'] = forms.ChoiceField(
choices=[(tz, tz) for tz in pytz.common_timezones],