From 887cfb20d0ba158aa0e0838d6b40f334084d202e Mon Sep 17 00:00:00 2001 From: adityacp Date: Thu, 2 Jan 2020 15:35:07 +0530 Subject: Change courses page with new UI --- yaksh/forms.py | 38 +- yaksh/static/yaksh/css/custom.css | 2 +- yaksh/static/yaksh/images/yaksh_circular_logo.png | Bin 0 -> 11577 bytes .../registration/password_change_done.html | 2 +- .../registration/password_change_form.html | 2 +- yaksh/templates/yaksh/add_course.html | 87 ++- yaksh/templates/yaksh/courses.html | 618 +++++---------------- yaksh/templates/yaksh/editprofile.html | 12 +- yaksh/templates/yaksh/moderator_dashboard.html | 70 +-- yaksh/templates/yaksh/paginator.html | 2 +- yaksh/templates/yaksh/profile_updated.html | 11 +- yaksh/templatetags/custom_filters.py | 6 + yaksh/urls.py | 2 + yaksh/views.py | 41 +- 14 files changed, 330 insertions(+), 563 deletions(-) create mode 100644 yaksh/static/yaksh/images/yaksh_circular_logo.png 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], diff --git a/yaksh/static/yaksh/css/custom.css b/yaksh/static/yaksh/css/custom.css index 92a1fc7..d0d5c82 100644 --- a/yaksh/static/yaksh/css/custom.css +++ b/yaksh/static/yaksh/css/custom.css @@ -26,4 +26,4 @@ body, .dropdown-menu { #login-btn, #signup-btn, #forgot-btn{ width: 75%; -} \ No newline at end of file +} diff --git a/yaksh/static/yaksh/images/yaksh_circular_logo.png b/yaksh/static/yaksh/images/yaksh_circular_logo.png new file mode 100644 index 0000000..ab5daed Binary files /dev/null and b/yaksh/static/yaksh/images/yaksh_circular_logo.png differ diff --git a/yaksh/templates/registration/password_change_done.html b/yaksh/templates/registration/password_change_done.html index ccaf312..9dd04b5 100644 --- a/yaksh/templates/registration/password_change_done.html +++ b/yaksh/templates/registration/password_change_done.html @@ -1,4 +1,4 @@ -{% extends "manage.html" %} +{% extends "base.html" %} {% load static %} {% block title %} Change Password {% endblock %} diff --git a/yaksh/templates/registration/password_change_form.html b/yaksh/templates/registration/password_change_form.html index 4b2218f..b4880c6 100644 --- a/yaksh/templates/registration/password_change_form.html +++ b/yaksh/templates/registration/password_change_form.html @@ -1,4 +1,4 @@ -{% extends "manage.html" %} +{% extends "base.html" %} {% block pagetitle %} Change Password {% endblock %} diff --git a/yaksh/templates/yaksh/add_course.html b/yaksh/templates/yaksh/add_course.html index 64cc9ff..2f584c9 100644 --- a/yaksh/templates/yaksh/add_course.html +++ b/yaksh/templates/yaksh/add_course.html @@ -1,32 +1,81 @@ {% extends "manage.html" %} +{% load static %} -{% block subtitle %}Add Course{% endblock %} +{% block title %}Add Course{% endblock %} {% block css %} - + {% endblock %} {% block script %} - + {% endblock %} {% block content %} -