From 1212811391eaafb7e86a2fdc825b4b0ecc20df45 Mon Sep 17 00:00:00 2001 From: adityacp Date: Fri, 28 Feb 2020 11:46:41 +0530 Subject: Change in views, change password, paginator - Add bootstrap form control class in change password - Show alert messages in change password - Increase number of pages in paginator - Reduce number of course pages in moderator dashboard --- .../registration/password_change_form.html | 82 +++++++++++++++++++--- yaksh/templates/yaksh/paginator.html | 2 +- yaksh/views.py | 2 +- 3 files changed, 76 insertions(+), 10 deletions(-) diff --git a/yaksh/templates/registration/password_change_form.html b/yaksh/templates/registration/password_change_form.html index f286741..8d8424e 100644 --- a/yaksh/templates/registration/password_change_form.html +++ b/yaksh/templates/registration/password_change_form.html @@ -2,23 +2,89 @@ {% load static %} -{% block pagetitle %} - + +{% endblock %} +{% block pagetitle %} Change Password {% endblock %} {% block title %} Change Password {% endblock %} +{% block script %} + +{% endblock %} {% block content %}
{% csrf_token %}
- - {{ form }} -
+
+ + {% if form.errors %} + {% for field in form %} + {% for error in field.errors %} +
+ + {{ error|escape }} +
+ {% endfor %} + {% endfor %} + {% for error in qform.non_field_errors %} +
+ + {{ error|escape }} +
+ {% endfor %} + {% endif %} + {% for field in form %} + + + + + {% endfor %} +
{{ field.label }}{{ field }} {{ field.help_text }}
+

diff --git a/yaksh/templates/yaksh/paginator.html b/yaksh/templates/yaksh/paginator.html index 5438b77..5f0df7a 100644 --- a/yaksh/templates/yaksh/paginator.html +++ b/yaksh/templates/yaksh/paginator.html @@ -15,7 +15,7 @@
  • {{ n }}(current)
  • - {% elif n > objects.number|add:'-3' and n < objects.number|add:'3' %} + {% elif n > objects.number|add:'-5' and n < objects.number|add:'5' %}
  • {{ n }}
  • {% endif %} {% endfor %} diff --git a/yaksh/views.py b/yaksh/views.py index 8ac8343..5d26822 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -409,7 +409,7 @@ def prof_manage(request, msg=None): courses = Course.objects.get_queryset().filter( Q(creator=user) | Q(teachers=user), is_trial=False).distinct().order_by("-active") - paginator = Paginator(courses, 30) + paginator = Paginator(courses, 20) page = request.GET.get('page') try: courses = paginator.page(page) -- cgit