diff options
author | adityacp | 2019-12-20 15:34:23 +0530 |
---|---|---|
committer | adityacp | 2019-12-20 15:43:25 +0530 |
commit | d60050dcfe7e32dc720e48942c7457860da79d6b (patch) | |
tree | 1d82d6e9c21954bbe2995a89615a19becdeb7945 /yaksh/templates | |
parent | 2e4c36969b18b9ebf09314d7a04094a7debe4387 (diff) | |
download | online_test-d60050dcfe7e32dc720e48942c7457860da79d6b.tar.gz online_test-d60050dcfe7e32dc720e48942c7457860da79d6b.tar.bz2 online_test-d60050dcfe7e32dc720e48942c7457860da79d6b.zip |
Use reverse url instead of traditional url in templates
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/base.html | 20 | ||||
-rw-r--r-- | yaksh/templates/manage.html | 23 | ||||
-rw-r--r-- | yaksh/templates/registration/password_change_done.html | 14 | ||||
-rw-r--r-- | yaksh/templates/registration/password_change_form.html | 36 | ||||
-rw-r--r-- | yaksh/templates/registration/password_reset_complete.html | 17 | ||||
-rw-r--r-- | yaksh/templates/registration/password_reset_confirm.html | 12 | ||||
-rw-r--r-- | yaksh/templates/registration/password_reset_done.html | 9 | ||||
-rw-r--r-- | yaksh/templates/registration/password_reset_form.html | 21 | ||||
-rw-r--r-- | yaksh/templates/yaksh/login.html | 43 | ||||
-rw-r--r-- | yaksh/templates/yaksh/moderator_dashboard.html | 16 | ||||
-rw-r--r-- | yaksh/templates/yaksh/register.html | 25 |
11 files changed, 118 insertions, 118 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 %} <!doctype html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]--> @@ -14,12 +15,11 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="apple-touch-icon" href="apple-touch-icon.png"> - <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/bootstrap.min.css"> - - <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/custom.css" type="text/css" /> - <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/animate.min.css" type="text/css" /> - <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/font-awesome.css" type="text/css" /> - <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/ontop.css" type="text/css" /> + <link rel="stylesheet" href="{% static 'yaksh/css/bootstrap.min.css' %}"> + <link rel="stylesheet" href="{% static 'yaksh/css/custom.css' %}" type="text/css" /> + <link rel="stylesheet" href="{% static 'yaksh/css/animate.min.css' %}" type="text/css" /> + <link rel="stylesheet" href="{% static 'yaksh/css/font-awesome.css' %}" type="text/css" /> + <link rel="stylesheet" href="{% static 'yaksh/css/ontop.css' %}" type="text/css" /> {% block meta %} @@ -33,10 +33,10 @@ - <script language="JavaScript" type="text/javascript" src="{{ URL_ROOT }}/static/yaksh/js/popper.min.js"></script> - <script language="JavaScript" type="text/javascript" src="{{ URL_ROOT }}/static/yaksh/js/jquery-3.3.1.min.js"></script> - <script language="JavaScript" type="text/javascript" src="{{ URL_ROOT }}/static/yaksh/js/bootstrap.min.js"></script> - <script language="JavaScript" type="text/javascript" src="{{ URL_ROOT }}/static/yaksh/js/wow.min.js"></script> + <script language="JavaScript" type="text/javascript" src="{% static 'yaksh/js/popper.min.js' %}"></script> + <script language="JavaScript" type="text/javascript" src="{% static 'yaksh/js/jquery-3.3.1.min.js' %}"></script> + <script language="JavaScript" type="text/javascript" src="{% static 'yaksh/js/bootstrap.min.js' %}"></script> + <script language="JavaScript" type="text/javascript" src="{% static 'yaksh/js/wow.min.js' %}"></script> <script> new WOW().init(); diff --git a/yaksh/templates/manage.html b/yaksh/templates/manage.html index 3b0f82c..9557582 100644 --- a/yaksh/templates/manage.html +++ b/yaksh/templates/manage.html @@ -1,9 +1,10 @@ {% extends "base.html" %} +{% load static %} {% block nav %} <nav class="navbar navbar-expand-sm navbar-dark bg-primary fixed-top"> - <a class="navbar-brand" href="{{ URL_ROOT }}/exam/"> - <img src="{{ URL_ROOT }}/static/yaksh/images/yaksh_banner.png" alt="YAKSH"> + <a class="navbar-brand" href="{% url 'yaksh:index' %}"> + <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH"> </a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor01" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> @@ -11,32 +12,32 @@ <div class="collapse navbar-collapse" id="navbarColor01"> <ul class="navbar-nav mr-auto"> - <li class="nav-item"><a class="nav-link" href="{{ URL_ROOT }}/exam/manage/questions">Questions</a></li> - <li class="nav-item"><a class="nav-link" href="{{ URL_ROOT }}/exam/manage/courses">Courses</a></li> - <li class="nav-item"><a class="nav-link" href="{{ URL_ROOT }}/exam/manage/monitor">Monitor</a></li> - <li class="nav-item"><a class="nav-link" href="{{ URL_ROOT }}/exam/manage/gradeuser">Grade User</a></li> - <li class="nav-item"><a class="nav-link" href="{{ url_root }}/exam/manage/grader"> Regrade </a></li> + <li class="nav-item"><a class="nav-link" href="{% url 'yaksh:show_questions' %}">Questions</a></li> + <li class="nav-item"><a class="nav-link" href="{% url 'yaksh:courses' %}">Courses</a></li> + <li class="nav-item"><a class="nav-link" href="{% url 'yaksh:monitor' %}">Monitor</a></li> + <li class="nav-item"><a class="nav-link" href="{% url 'yaksh:grade_user' %}">Grade User</a></li> + <li class="nav-item"><a class="nav-link" href="{% url 'yaksh:grader' %}"> Regrade </a></li> </ul> <ul class="navbar-nav ml-auto"> <li class="nav-item dropdown my-lg-0" style="font-size: 1.2rem"> <a class="dropdown-toggle nav-link" id="user_dropdown" data-toggle="dropdown" href="#">{{user.get_full_name|title}} </a> <div class="dropdown-menu dropdown-menu-right"> - <a class="dropdown-item" href="{{ URL_ROOT }}/exam/editprofile/"> + <a class="dropdown-item" href="{% url 'yaksh:edit_profile' %}"> <i class="fa fa-user"></i> My Profile </a> <div class="dropdown-divider"></div> {% if user.profile.is_moderator %} - <a class="dropdown-item" href="{{URL_ROOT}}/exam/toggle_moderator/"><i class="fa fa-exchange"></i> + <a class="dropdown-item" href="{% url 'yaksh:toggle_moderator' %}"><i class="fa fa-exchange"></i> Switch To Student </a> <div class="dropdown-divider"></div> {% endif %} - <a class="dropdown-item" href="{{ URL_ROOT }}/exam/reset/changepassword/"> + <a class="dropdown-item" href="{% url 'password_change' %}"> <i class="fa fa-key"></i> Change Password </a> <div class="dropdown-divider"></div> - <a class="dropdown-item" id="user_logout" href="{{URL_ROOT}}/exam/logout/"> + <a class="dropdown-item" id="user_logout" href="{% url 'yaksh:logout' %}"> <i class="fa fa-sign-out"></i> Logout </a> </div> diff --git a/yaksh/templates/registration/password_change_done.html b/yaksh/templates/registration/password_change_done.html index 7e075de..ccaf312 100644 --- a/yaksh/templates/registration/password_change_done.html +++ b/yaksh/templates/registration/password_change_done.html @@ -1,18 +1,12 @@ -{% extends "base.html" %} +{% extends "manage.html" %} +{% load static %} {% block title %} Change Password {% endblock %} -{% block nav %} -<nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top"> - <a class="navbar-brand" href="{{ URL_ROOT }}/exam/"> - <img src="{{ URL_ROOT }}/static/yaksh/images/yaksh_banner.png" alt="YAKSH"> - </a> -</nav> -{% endblock %} {% block script %} <script type="text/javascript"> window.setTimeout(function() { - location.href="{{ URL_ROOT }}/exam/" + location.href="{% url 'yaksh:index' %}" }, 2000); </script> {% endblock %} @@ -25,6 +19,6 @@ <h4>Redirecting ...</h4> </div> </div> -<div class="col"><img src="{{ URL_ROOT }}/static/yaksh/images/profile_change.gif/"></div> +<div class="col"><img src="{% static 'yaksh/images/profile_change.gif' %}"></div> </center> {% 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" %} + <!DOCTYPE html> {% block pagetitle %} Change Password {% endblock %} {% block title %} Change Password {% endblock %} -{% block nav %} -<nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top"> - <a class="navbar-brand" href="{{ URL_ROOT }}/exam/"> - <img src="{{ URL_ROOT }}/static/yaksh/images/yaksh_banner.png" alt="YAKSH"> - </a> -</nav> -{% endblock %} - {% block content %} <br><br> <form action="" method="post" > - {% csrf_token %} - <center> - <table class=span1> - {{ form }} - </table> - </center> - <br> - <center><button class="btn btn-success btn-lg" type="submit">Change</button> - <button class="btn btn-primary btn-lg" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/");'>Cancel - </button></center> + {% csrf_token %} + <center> + <table class="span1"> + {{ form }} + </table> + </center> + <br> + <center> + <button class="btn btn-success btn-lg" type="submit"> + Change + </button> + <a href="{% url 'yaksh:index' %}" class="btn btn-primary btn-lg"> + Cancel + </a> + </center> </form> {% 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 %} <nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top"> - <a class="navbar-brand" href="{{ URL_ROOT }}/exam/"> - <img src="{{ URL_ROOT }}/static/yaksh/images/yaksh_banner.png" alt="YAKSH"> - </a> + <a class="navbar-brand" href="{% url 'yaksh:index' %}"> + <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH"> + </a> </nav> {% endblock %} + {% block content %} <br><br> +<center> <div class="container"> -<p>Your password has been reset. </p> -<p><a href="{{ login_url }}" class="btn btn-success">Log in</a></p> -</div> + <p>Your password has been reset. </p> + <p><a href="{{ login_url }}" class="btn btn-success btn-lg">Log in</a></p> + </div> +</center> {% 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 %} <nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top"> - <a class="navbar-brand" href="{{ URL_ROOT }}/exam/"> - <img src="{{ URL_ROOT }}/static/yaksh/images/yaksh_banner.png" alt="YAKSH"> - </a> + <a class="navbar-brand" href="{% url 'yaksh:index' %}"> + <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH"> + </a> </nav> {% endblock %} -{% block content %} +{% block content %} <br><br> <center><h4>Reset Password</h4> {% if validlink %} @@ -17,7 +19,7 @@ <form method="post"> {% csrf_token %} {{ form.as_p }} - <button class= "btn btn-success" type="submit">Submit</button> + <button class= "btn btn-success btn-lg" type="submit">Submit</button> </form> {% else %} <p>This reset link is no longer valid!</p> 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 %} <nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top"> - <a class="navbar-brand" href="{{ URL_ROOT }}/exam/"> - <img src="{{ URL_ROOT }}/static/yaksh/images/yaksh_banner.png" alt="YAKSH"> - </a> + <a class="navbar-brand" href="{% url 'yaksh:index' %}"> + <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH"> + </a> </nav> {% endblock %} @@ -17,6 +18,6 @@ Instruction for setting new password has been mailed to your registered email address </div> <br> -<a class="btn btn-primary btn-lg" href="{{URL_ROOT}}/exam/login/">Go to Login</a> +<a class="btn btn-primary btn-lg" href="{% url 'yaksh:login' %}">Go to Login</a> </center> {% 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 %} <nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top"> - <a class="navbar-brand" href="{{ URL_ROOT }}/exam/"> - <img src="{{ URL_ROOT }}/static/yaksh/images/yaksh_banner.png" alt="YAKSH"> - </a> + <a class="navbar-brand" href="{% url 'yaksh:index' %}"> + <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH"> + </a> </nav> {% endblock %} @@ -26,8 +27,12 @@ Forgot Password {{ form }} <br><br> - <button class="btn btn-success btn-lg" type="submit">Request</button> - <a class="btn btn-primary btn-lg" href="{{URL_ROOT}}/exam/login/">Cancel</a> + <button class="btn btn-success btn-lg" type="submit"> + Request + </button> + <a href="{% url 'yaksh:index' %}" class="btn btn-primary btn-lg"> + Cancel + </a> </form> </div> </div> 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 %} <nav class="navbar navbar-expand-lg navbar-dark bg-primary"> - <a class="navbar-brand" href="{{ URL_ROOT }}/exam/"> - <img src="{{ URL_ROOT }}/static/yaksh/images/yaksh_banner.png" alt="YAKSH"> - </a> + <a class="navbar-brand" href="{% url 'yaksh:index' %}"> + <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH"> + </a> </nav> {% endblock %} @@ -30,14 +31,18 @@ {% for field in form %} {% for error in field.errors %} <div class="alert alert-dismissible alert-danger"> - <button type="button" class="close" data-dismiss="alert">×</button> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> <strong>{{ error|escape }}</strong> </div> {% endfor %} {% endfor %} {% for error in form.non_field_errors %} <div class="alert alert-dismissible alert-danger"> - <button type="button" class="close" data-dismiss="alert">×</button> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> <strong>{{ error|escape }}</strong> </div> {% endfor %} @@ -49,10 +54,12 @@ </center> <div class="row justify-content-center"> <button class="btn btn-lg btn-success btn-block" type="submit" id="login-btn">Login</button> - <a href="{{URL_ROOT}}/exam/register/" class="btn btn-lg btn-primary btn-block" id="signup-btn"> + <a href="{% url 'yaksh:register' %}" class="btn btn-lg btn-primary btn-block" id="signup-btn"> NEW USER? SIGN UP </a> - <a class="btn btn-lg btn-primary btn-block" href="{{URL_ROOT}}/exam/reset/forgotpassword/" id="forgot-btn">Forgot Password?</a> + <a class="btn btn-lg btn-primary btn-block" href="{% url 'password_reset' %}" id="forgot-btn"> + Forgot Password? + </a> </div> <hr> <center><h1> OR </h1></center> @@ -72,25 +79,3 @@ </div> </div> {% endblock content %} - - -{% block footer %} - <!--footer--> - <!-- <footer class="container-fluid yakshfooter text-center" id="contact"> - {% block info %} - {% endblock %} - Developed by FOSSEE team, IIT Bombay - <hr style="background-color: white"> - <nav class="nav nav-pills nav-fill col-lg-12"> - - <li class="nav-item"> - <a class = "btn btn-social-icon btn-github nav-link" href ="https://github.com/fossee/online_test"> - Fork us at: <span class="fa fa-github" style="font-size:20px;"></span> - </a> - </li> - <li class="nav-item"><span class="nav-link"> Email : info@fossee.in</span></li> - <li class="nav-item"><a href="https://fossee.in" class="nav-link">FOSSEE website</a></li> - </nav> - </footer> --> - <!--footer end--> -{% 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 %} -<script language="JavaScript" type="text/javascript" src="{{ URL_ROOT }}/static/yaksh/js/moderator_dashboard.js"></script> -{% endblock %} - {% block content %} <br><br> <div class="container"> @@ -16,10 +12,10 @@ </center> <hr> <center> - <a href="{{URL_ROOT}}/exam/manage/add_course" class="btn btn-success btn-lg"> + <a href="{% url 'yaksh:add_course' %}" class="btn btn-success btn-lg"> <span class=" fa fa-plus-circle"></span> Add Course </a> - <a href="{{URL_ROOT}}/exam/manage/create_demo_course" class="btn btn-primary btn-lg"> + <a href="{% url 'yaksh:create_demo_course' %}" class="btn btn-primary btn-lg"> Create Demo Course </a> <center> @@ -27,7 +23,9 @@ {% if msg %} <div class="container"> <div class="alert alert-dismissible alert-info"> - <button type="button" class="close" data-dismiss="alert">×</button> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> <strong>{{ msg }}</strong> </div> </div> @@ -62,7 +60,7 @@ {% endif %} </div> <div class="col-md-3"> - <a href="{{URL_ROOT}}/exam/manage/course_detail/{{course.id}}" class="btn btn-primary btn-lg"> + <a href="{% url 'yaksh:course_detail' course.id %}" class="btn btn-primary btn-lg"> Manage Course </a> </div> @@ -89,7 +87,7 @@ {% for quiz, users_no, passed, failed in course_details %} <tr> <td> - <a href="{{URL_ROOT}}/exam/manage/monitor/{{ quiz.id }}/{{course.id}}" > + <a href="{% url 'yaksh:monitor' quiz.id course.id %}" > {{ quiz.description }} </a> </td> 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 %} <nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top"> - <a class="navbar-brand" href="{{ URL_ROOT }}/exam/"> - <img src="{{ URL_ROOT }}/static/yaksh/images/yaksh_banner.png" alt="YAKSH"> - </a> + <a class="navbar-brand" href="{% url 'yaksh:index' %}"> + <img src="{% static 'yaksh/images/yaksh_banner.png' %}" alt="YAKSH"> + </a> </nav> {% endblock %} @@ -25,14 +26,18 @@ {% for field in form %} {% for error in field.errors %} <div class="alert alert-dismissible alert-danger"> - <button type="button" class="close" data-dismiss="alert">×</button> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> <strong>{{ error|escape }}</strong> </div> {% endfor %} {% endfor %} {% for error in form.non_field_errors %} <div class="alert alert-dismissible alert-danger"> - <button type="button" class="close" data-dismiss="alert">×</button> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> <strong>{{ error|escape }}</strong> </div> {% endfor %} @@ -44,8 +49,14 @@ <br> <br> </center> - <center class="yakshwell"><button class="btn btn-success btn-lg" type="submit">Register</button> - <a href="{{URL_ROOT}}/exam" class="btn btn-primary btn-lg">Cancel</a></center> + <center> + <button class="btn btn-success btn-lg" type="submit"> + Register + </button> + <a href="{% url 'yaksh:index' %}" class="btn btn-primary btn-lg"> + Cancel + </a> + </center> </fieldset> </form> </div> |