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(-) (limited to 'yaksh') 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 From b4751e0c1783a71c6672554114ccdf5a78c6b47f Mon Sep 17 00:00:00 2001 From: adityacp Date: Fri, 28 Feb 2020 12:05:56 +0530 Subject: Order courses by active courses --- yaksh/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'yaksh') diff --git a/yaksh/views.py b/yaksh/views.py index 5d26822..1ab3503 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -1237,7 +1237,7 @@ def monitor(request, quiz_id=None, course_id=None): courses = Course.objects.filter( Q(creator=user) | Q(teachers=user), is_trial=False - ).order_by("-id").distinct() + ).order_by("-active").distinct() paginator = Paginator(courses, 30) page = request.GET.get('page') try: @@ -1706,7 +1706,7 @@ def grade_user(request, quiz_id=None, user_id=None, attempt_number=None, if not course_id: courses = Course.objects.filter( Q(creator=current_user) | Q(teachers=current_user), is_trial=False - ).order_by("-id").distinct() + ).order_by("-active").distinct() paginator = Paginator(courses, 30) page = request.GET.get('page') try: -- cgit From 78368a851231507557c4d524707da7ff5197509c Mon Sep 17 00:00:00 2001 From: adityacp Date: Fri, 28 Feb 2020 15:25:03 +0530 Subject: Fix UI in forgot and change password --- .../registration/password_change_form.html | 34 ++++++++--------- .../registration/password_reset_confirm.html | 44 +++++++++++++++++++++- 2 files changed, 59 insertions(+), 19 deletions(-) (limited to 'yaksh') diff --git a/yaksh/templates/registration/password_change_form.html b/yaksh/templates/registration/password_change_form.html index 8d8424e..37f6e93 100644 --- a/yaksh/templates/registration/password_change_form.html +++ b/yaksh/templates/registration/password_change_form.html @@ -58,8 +58,17 @@ Change Password
    {% if form.errors %} - {% for field in form %} - {% for error in field.errors %} + {% for field in form %} + {% for error in field.errors %} +
    + + {{ error|escape }} +
    + {% endfor %} + {% endfor %} + {% for error in form.non_field_errors %}
    {% endfor %} + {% endif %} + {% for field in form %} + + + + {% endfor %} - {% for error in qform.non_field_errors %} -
    - - {{ error|escape }} -
    - {% endfor %} - {% endif %} - {% for field in form %} - - - - - {% endfor %}
    {{ field.label }}{{ field }} {{ field.help_text }}
    {{ field.label }}{{ field }} {{ field.help_text }}
    diff --git a/yaksh/templates/registration/password_reset_confirm.html b/yaksh/templates/registration/password_reset_confirm.html index ef2d1f2..02f1228 100644 --- a/yaksh/templates/registration/password_reset_confirm.html +++ b/yaksh/templates/registration/password_reset_confirm.html @@ -11,18 +11,58 @@ {% endblock %} +{% block script %} + +{% endblock %} + {% block content %}

    Reset Password

    +
    {% if validlink %} -

    Please enter your new password twice so we can verify you typed it in correctly

    . +

    Please enter your new password twice so we can verify you typed it in correctly +

    . {% csrf_token %} - {{ form.as_p }} + + {% if form.errors %} + {% for field in form %} + {% for error in field.errors %} +
    + + {{ error|escape }} +
    + {% endfor %} + {% endfor %} + {% for error in form.non_field_errors %} +
    + + {{ error|escape }} +
    + {% endfor %} + {% endif %} + {% for field in form %} + + + + + {% endfor %} +
    {{ field.label }}{{ field }} {{ field.help_text }}
    {% else %}

    This reset link is no longer valid!

    {% endif %} +
    {% endblock %} -- cgit From baa6211f10fc2c8427387987f74a9f2631e6a1a3 Mon Sep 17 00:00:00 2001 From: adityacp Date: Fri, 28 Feb 2020 16:14:13 +0530 Subject: Fix UI for email account verification --- yaksh/templates/yaksh/activation_status.html | 141 ++++++++++++++------------- yaksh/views.py | 2 +- 2 files changed, 76 insertions(+), 67 deletions(-) (limited to 'yaksh') diff --git a/yaksh/templates/yaksh/activation_status.html b/yaksh/templates/yaksh/activation_status.html index c196300..059aa21 100644 --- a/yaksh/templates/yaksh/activation_status.html +++ b/yaksh/templates/yaksh/activation_status.html @@ -1,79 +1,88 @@ {% extends "base.html" %} - -{% block pagetitle %} Yaksh Account Activation {% endblock %} -{% block title %} Yaksh Account Activation {% endblock %} -{% block css%} - -{% endblock %} +{% load static %} +{% block pagetitle %} Account Activation {% endblock %} +{% block title %} Account Activation {% endblock %} {% block nav %} - +
    + +
    {% endblock %} {% block content %} -{% if success %} -
    - - Home -
    -{% else %} - {% if msg %} +
    + {% if success %}
    -
    -
    - {% csrf_token %} + {% else %} + {% if msg %} +
    + +
    +
    +
    + + {% csrf_token %} +

    + + +
    +
    + {% endif %} + {% endif %} +
    + {% if activation_msg %}
    - Enter Email Address for verification:

    - + + Home
    - {% endif %} -{% endif %} -
    -{% if activation_msg %} -
    - - Home -
    -{% endif %} -{% if email_err_msg %} -
    - -
    -
    - {% csrf_token %} -
    - - - - - - - - - -
    Enter Username:
    Enter New Email Address:
    -
    - -
    -
    -{% endif %} + {% if email_err_msg %} +
    + +
    +
    +
    +
    + {% csrf_token %} + +
    + +
    + +
    +
    +
    + {% endif %} +
    {% endblock content %} diff --git a/yaksh/views.py b/yaksh/views.py index 1ab3503..5d2d560 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -2171,7 +2171,7 @@ def new_activation(request, email=None): try: user = User.objects.get(email=email) except MultipleObjectsReturned: - context['email_err_msg'] = "Multiple entries found for this email"\ + context['email_err_msg'] = "Multiple entries found for this email "\ "Please change your email" return my_render_to_response( request, 'yaksh/activation_status.html', context -- cgit