From d60050dcfe7e32dc720e48942c7457860da79d6b Mon Sep 17 00:00:00 2001
From: adityacp
Date: Fri, 20 Dec 2019 15:34:23 +0530
Subject: Use reverse url instead of traditional url in templates
---
yaksh/templates/base.html | 20 +++++-----
yaksh/templates/manage.html | 23 ++++++------
.../registration/password_change_done.html | 14 ++-----
.../registration/password_change_form.html | 36 +++++++++---------
.../registration/password_reset_complete.html | 17 ++++++---
.../registration/password_reset_confirm.html | 12 +++---
.../registration/password_reset_done.html | 9 +++--
.../registration/password_reset_form.html | 21 +++++++----
yaksh/templates/yaksh/login.html | 43 +++++++---------------
yaksh/templates/yaksh/moderator_dashboard.html | 16 ++++----
yaksh/templates/yaksh/register.html | 25 +++++++++----
yaksh/urls.py | 11 +++---
12 files changed, 124 insertions(+), 123 deletions(-)
diff --git a/yaksh/templates/base.html b/yaksh/templates/base.html
index e300a76..9021e3d 100644
--- a/yaksh/templates/base.html
+++ b/yaksh/templates/base.html
@@ -1,3 +1,4 @@
+{% load static %}
@@ -14,12 +15,11 @@
-
-
-
-
-
-
+
+
+
+
+
{% block meta %}
@@ -33,10 +33,10 @@
-
-
-
-
+
+
+
+
{% endblock %}
@@ -25,6 +19,6 @@
Redirecting ...
-
+
{% endblock %}
diff --git a/yaksh/templates/registration/password_change_form.html b/yaksh/templates/registration/password_change_form.html
index 18dfa2e..4b2218f 100644
--- a/yaksh/templates/registration/password_change_form.html
+++ b/yaksh/templates/registration/password_change_form.html
@@ -1,28 +1,26 @@
-{% extends "base.html" %}
+{% extends "manage.html" %}
+
{% block pagetitle %} Change Password {% endblock %}
{% block title %} Change Password {% endblock %}
-{% block nav %}
-
-{% endblock %}
-
{% block content %}
{% endblock content %}
diff --git a/yaksh/templates/registration/password_reset_complete.html b/yaksh/templates/registration/password_reset_complete.html
index d606db9..20dc697 100644
--- a/yaksh/templates/registration/password_reset_complete.html
+++ b/yaksh/templates/registration/password_reset_complete.html
@@ -1,17 +1,22 @@
{% extends "base.html" %}
+{% load static %}
+
{% block title %} Forgot Password {% endblock %}
{% block nav %}
{% endblock %}
+
{% block content %}
+
-
Your password has been reset.
-
Log in
-
+ Your password has been reset.
+ Log in
+
+
{% endblock %}
diff --git a/yaksh/templates/registration/password_reset_confirm.html b/yaksh/templates/registration/password_reset_confirm.html
index 110a82c..ef2d1f2 100644
--- a/yaksh/templates/registration/password_reset_confirm.html
+++ b/yaksh/templates/registration/password_reset_confirm.html
@@ -1,15 +1,17 @@
{% extends "base.html" %}
+{% load static %}
+
{% block title %} Forgot Password {% endblock %}
{% block nav %}
{% endblock %}
-{% block content %}
+{% block content %}
Reset Password
{% if validlink %}
@@ -17,7 +19,7 @@
{% else %}
This reset link is no longer valid!
diff --git a/yaksh/templates/registration/password_reset_done.html b/yaksh/templates/registration/password_reset_done.html
index a6f30a0..036d691 100644
--- a/yaksh/templates/registration/password_reset_done.html
+++ b/yaksh/templates/registration/password_reset_done.html
@@ -1,11 +1,12 @@
{% extends "base.html" %}
+{% load static %}
{% block title %} Forgot Password {% endblock %}
{% block nav %}
{% endblock %}
@@ -17,6 +18,6 @@
Instruction for setting new password has been mailed to your registered email address
-Go to Login
+Go to Login
{% endblock %}
diff --git a/yaksh/templates/registration/password_reset_form.html b/yaksh/templates/registration/password_reset_form.html
index fd2220f..eeca8f2 100644
--- a/yaksh/templates/registration/password_reset_form.html
+++ b/yaksh/templates/registration/password_reset_form.html
@@ -1,12 +1,13 @@
{% extends "base.html" %}
-{% block title %}
-Forgot Password
-{% endblock %}
+{% load static %}
+
+{% block title %} Forgot Password {% endblock %}
+
{% block nav %}
{% endblock %}
@@ -26,8 +27,12 @@ Forgot Password
{{ form }}
-
- Cancel
+
+
+ Cancel
+
diff --git a/yaksh/templates/yaksh/login.html b/yaksh/templates/yaksh/login.html
index c1477c7..464a8dd 100644
--- a/yaksh/templates/yaksh/login.html
+++ b/yaksh/templates/yaksh/login.html
@@ -1,12 +1,13 @@
{% extends "base.html" %}
+{% load static %}
{% block title %} Login {% endblock %}
{% block nav %}
{% endblock %}
@@ -30,14 +31,18 @@
{% for field in form %}
{% for error in field.errors %}
-
+
{{ error|escape }}
{% endfor %}
{% endfor %}
{% for error in form.non_field_errors %}
-
+
{{ error|escape }}
{% endfor %}
@@ -49,10 +54,12 @@
OR
@@ -72,25 +79,3 @@
{% endblock content %}
-
-
-{% block footer %}
-
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/yaksh/templates/yaksh/moderator_dashboard.html b/yaksh/templates/yaksh/moderator_dashboard.html
index f6fd4de..33671aa 100644
--- a/yaksh/templates/yaksh/moderator_dashboard.html
+++ b/yaksh/templates/yaksh/moderator_dashboard.html
@@ -3,10 +3,6 @@
{% block title %} Moderartor Dashboard {% endblock %}
-{% block script %}
-
-{% endblock %}
-
{% block content %}
@@ -89,7 +87,7 @@
{% for quiz, users_no, passed, failed in course_details %}
-
+
{{ quiz.description }}
|
diff --git a/yaksh/templates/yaksh/register.html b/yaksh/templates/yaksh/register.html
index 060e961..33bc561 100644
--- a/yaksh/templates/yaksh/register.html
+++ b/yaksh/templates/yaksh/register.html
@@ -1,12 +1,13 @@
{% extends "base.html" %}
+{% load static %}
{% block title %} Register {% endblock %}
{% block nav %}
{% endblock %}
@@ -25,14 +26,18 @@
{% for field in form %}
{% for error in field.errors %}
-
+
{{ error|escape }}
{% endfor %}
{% endfor %}
{% for error in form.non_field_errors %}
-
+
{{ error|escape }}
{% endfor %}
@@ -44,8 +49,14 @@
-
- Cancel
+
+
+
+ Cancel
+
+
diff --git a/yaksh/urls.py b/yaksh/urls.py
index 8397017..d453381 100644
--- a/yaksh/urls.py
+++ b/yaksh/urls.py
@@ -2,9 +2,9 @@ from django.conf.urls import url
from yaksh import views
urlpatterns = [
- url(r'^$', views.index),
+ url(r'^$', views.index, name="index"),
url(r'^login/$', views.user_login, name='login'),
- url(r'^logout/$', views.user_logout),
+ url(r'^logout/$', views.user_logout, name="logout"),
url(r'^update_email/$', views.update_email, name="update_email"),
url(r'^activate/(?P.+)$', views.activate_user, name="activate"),
url(r'^new_activation/$', views.new_activation, name='new_activation'),
@@ -144,9 +144,9 @@ urlpatterns = [
url(r'^manage/remove_teachers/(?P\d+)/$', views.remove_teachers,
name='remove_teacher'),
url(r'^manage/download_questions/$', views.show_all_questions,
- name="show_questions"),
+ name="download_questions"),
url(r'^manage/upload_questions/$', views.show_all_questions,
- name="show_questions"),
+ name="upload_questions"),
url(r'^manage/grader/$', views.grader, name='grader'),
url(r'^manage/regrade/question/(?P\d+)/(?P\d+)/$',
views.regrade, name='regrade'),
@@ -160,7 +160,8 @@ urlpatterns = [
views.regrade, name='regrade'),
url(r'^manage/(?Pgodmode|usermode)/(?P\d+)/'
'(?P\d+)/$', views.test_quiz),
- url(r'^manage/create_demo_course/$', views.create_demo_course),
+ url(r'^manage/create_demo_course/$', views.create_demo_course,
+ name="create_demo_course"),
url(r'^manage/courses/download_course_csv/(?P\d+)/$',
views.download_course_csv, name="download_course_csv"),
url(r'^manage/download/user_assignment/(?P\d+)/'
--
cgit