summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
authoradityacp2016-04-27 16:42:32 +0530
committeradityacp2016-04-27 16:42:32 +0530
commit6b09383890b8367628124a854810326d7bbac7c4 (patch)
tree474ea52387e80a20580bba57120ef88b33f4c310 /yaksh/templates
parentfa11260fdbe76f377909483d9c482ecf72ab3364 (diff)
downloadonline_test-6b09383890b8367628124a854810326d7bbac7c4.tar.gz
online_test-6b09383890b8367628124a854810326d7bbac7c4.tar.bz2
online_test-6b09383890b8367628124a854810326d7bbac7c4.zip
changes after comments
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/yaksh/addteacher.html23
-rw-r--r--yaksh/templates/yaksh/courses.html38
-rw-r--r--yaksh/templates/yaksh/viewcourse.html51
3 files changed, 50 insertions, 62 deletions
diff --git a/yaksh/templates/yaksh/addteacher.html b/yaksh/templates/yaksh/addteacher.html
index b438262..790c06c 100644
--- a/yaksh/templates/yaksh/addteacher.html
+++ b/yaksh/templates/yaksh/addteacher.html
@@ -25,8 +25,10 @@
<center><h3>No results found</h3></center>
{% else %}
<center><b><u>Search Results</u></b></center><br>
+ <center><b>Search results does not include teachers already added</b></center><br>
<table>
<th></th>
+ <th>Username</th>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
@@ -34,8 +36,10 @@
<th>Department</th>
<th>Position</th>
{% for teacher in teachers %}
+ {% if teacher not in course.get_teachers %}
<tr>
<td><input type="checkbox" name="check" value="{{ teacher.id }}"></td>
+ <td>{{ teacher.username }}</td>
<td>{{ teacher.first_name }}</td>
<td>{{ teacher.last_name }}</td>
<td>{{ teacher.email }}</td>
@@ -43,6 +47,7 @@
<td>{{ teacher.profile.department }}</td>
<td>{{ teacher.profile.position }}</td>
</tr>
+ {% endif %}
{% endfor %}
</table>
<button class="btn" type="submit">Add</button>
@@ -51,31 +56,35 @@
</form>
{% if status == True and teachers_added or teachers_rejected %}
<center>
-<h4>Note: Teacher(s) without profile are rejected</h4>
+<h4>Teacher(s) without profile are rejected</h4>
<div class="row">
<div class="span6 wrap">
<center><b><u>Teacher(s) Added</u></b></center><br>
+ {% if teachers_added %}
{% for teacher in teachers_added %}
<div class="well">
<div class="row">
- <div class="span3" style="padding-top:10px">
- <h5>{{ teacher.get_full_name }}</h5>
- </div>
+ <h5>{{ teacher.get_full_name }}</h5>
</div>
</div>
{% endfor %}
+ {% else %}
+ <center><b>No Teacher(s) Added</b></center>
+ {% endif %}
</div>
<div class="span6 wrap">
<center><b><u>Teacher(s) Rejected</u></b></center><br>
+ {% if teachers_rejected %}
{% for teacher in teachers_rejected %}
<div class="well">
<div class="row">
- <div class="span4" style="padding-top:10px">
- <h5>{{ teacher.get_full_name }}</h5>
- </div>
+ <h5>{{ teacher.get_full_name }}</h5>
</div>
</div>
{% endfor %}
+ {% else %}
+ <center><b>No Teacher(s) Rejected</b></center>
+ {% endif %}
</div>
</div>
</center>
diff --git a/yaksh/templates/yaksh/courses.html b/yaksh/templates/yaksh/courses.html
index 245c3cb..43a9535 100644
--- a/yaksh/templates/yaksh/courses.html
+++ b/yaksh/templates/yaksh/courses.html
@@ -11,10 +11,13 @@
{% block manage %}
<a href="{{URL_ROOT}}/exam/manage/viewcourse/">View Allotted Courses</a><br>
{% if not courses %}
- <center><h5> You have not created any courses </h5></center>
+ <center><h4> No new Courses added </h4></center>
{% else %}
-<center><h3> Course(s) created by you </h3></center>
+<center><h3> Course(s) Added</h3></center>
{% for course in courses %}
+ {% if user != course.creator %}
+ <h4> {{course.creator.get_full_name}} added you to this course</h4>
+ {% endif %}
<div class="row show-grid">
<div class="span14">
<div class="row">
@@ -28,11 +31,39 @@
{% endif %}
</p>
<a href="{{URL_ROOT}}/exam/manage/course_detail/{{course.id}}/">{{ course.name }}</a>
- </br>
+ </br></br>
+ {% if user == course.creator %}
+ <div class="row">
+ <div class="span6 wrap">
+ <center><b><u>Teacher(s) Added to {{ course }}</u></b></center>
+ {% if course.get_teachers %}
+ <div align="left">
+ <form action="{{URL_ROOT}}/exam/manage/remove_teachers/{{ course.id }}/" method="post">
+ {% csrf_token %}
+ {% for teacher in course.get_teachers %}
+ <div class="well">
+ <div class="row">
+ <div class="span3" style="width: auto;">
+ <input type="checkbox" name="remove" value="{{ teacher.id }}">&nbsp;{{ teacher.get_full_name }}
+ </div>
+ </div>
+ </div>
+ {% endfor %}
+ <button class="btn success" type="submit">Remove Selected</button>
+ </div>
+ {% else %}
+ <center><b>No Teacher(s) Added</b></center>
+ {% endif %}
+ </form>
+ </div>
+ </div>
+ {% endif %}
</div>
+ {% if user == course.creator %}
<div class="span6">
<p><b><a href="{{URL_ROOT}}/exam/manage/searchteacher/{{course.id}}/">Add Teacher</a></b></p>
</div>
+ {% endif %}
<div class="span6">
<p><b><u>Quiz(zes)</u></b></p>
{% if course.get_quizzes %}
@@ -48,7 +79,6 @@
</div>
<br><br>
{% endfor %}
-
<button class="btn primary" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/add_course");'>Add New Course</button>
<button class="btn primary" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/addquiz");'>Add New Quiz</button>
{% endif %}
diff --git a/yaksh/templates/yaksh/viewcourse.html b/yaksh/templates/yaksh/viewcourse.html
deleted file mode 100644
index a3ef3e6..0000000
--- a/yaksh/templates/yaksh/viewcourse.html
+++ /dev/null
@@ -1,51 +0,0 @@
-{% extends "manage.html" %}
-
-{% block title %} Courses {% endblock title %}
-
-{% block subtitle %} Courses {% endblock %}
-
-{% block css %}
-<link rel="stylesheet" media="all" type="text/css" href="{{ URL_ROOT }}/static/yaksh/css/course.css" />
-{% endblock %}
-
-{% block manage %}
-<center><h3> Course(s) Allotted </h3></center><br>
-{% if not courses %}
- <center><h3> You are not added to any course(s) </h3></center>
-{% else %}
-{% for course in courses %}
-<h4>{{ course.creator.get_full_name }} added you to this course</h4>
-<div class="row show-grid">
- <div class="span14">
- <div class="row">
- <div class="span6">
- <p>
- <b><u>Course</u></b>
- {% if course.active %}
- <span class="label success">Active</span>
- {% else %}
- <span class="label important">Closed</span>
- {% endif %}
- </p>
- <a href="{{URL_ROOT}}/exam/manage/course_detail/{{ course.id }}/">{{ course.name }}</a>
- </br>
- </div>
- <div class="span6">
- <p><b><u>Quiz(zes)</u></b></p>
- {% if course.get_quizzes %}
- {% for quiz in course.get_quizzes %}
- <a href="{{URL_ROOT}}/exam/manage/addquiz/{{ quiz.id }}/">{{ quiz.description }}</a><br>
- {% endfor %}
- {% else %}
- <p><b>No quiz </b>
- {% endif %}
- </div>
- </div>
- </div>
- </div>
- <br><br>
-{% endfor %}
-<button class="btn primary" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/add_course");'>Add New Course</button>
-<button class="btn primary" type="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/addquiz");'>Add New Quiz</button>
-{% endif %}
-{% endblock %}