summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCruiseDevice2021-05-24 17:37:48 +0530
committerCruiseDevice2021-05-24 17:37:48 +0530
commitcdab789f4e06f8484ef1c79ca66f37bb971be454 (patch)
treedf1702a0a883f0ea8dce9b4d06087d690b2c9cc7
parentf5dc8f1e3271fcbd2e5b5d8d7e2e1e299c413acf (diff)
downloadonline_test-cdab789f4e06f8484ef1c79ca66f37bb971be454.tar.gz
online_test-cdab789f4e06f8484ef1c79ca66f37bb971be454.tar.bz2
online_test-cdab789f4e06f8484ef1c79ca66f37bb971be454.zip
Fix minor ui issue in moderator interface
- Move 'Deactivate course' to the end of the dropdown. - First page of 'Manage Course' shows enrollments.
-rw-r--r--yaksh/templates/yaksh/course_detail.html29
-rw-r--r--yaksh/templates/yaksh/course_detail_options.html149
-rw-r--r--yaksh/templates/yaksh/courses.html76
-rw-r--r--yaksh/urls.py2
-rw-r--r--yaksh/views.py39
5 files changed, 159 insertions, 136 deletions
diff --git a/yaksh/templates/yaksh/course_detail.html b/yaksh/templates/yaksh/course_detail.html
index 8661aea..04a11e8 100644
--- a/yaksh/templates/yaksh/course_detail.html
+++ b/yaksh/templates/yaksh/course_detail.html
@@ -58,35 +58,6 @@
{% elif is_upload_download_md %}
{% include "yaksh/upload_download_course_md.html" %}
{% else %}
- <div class="jumbotron">
- <h1 class="display-4">Manage Course</h1>
- <hr class="my-4">
- <p>
- <ul>
- <li>
- Students enrollments
- </li>
- <li>
- Add and View Modules, Lessons and Quizzes
- </li>
- <li>
- Send mail to the students
- </li>
- <li>
- View Students course progress
- </li>
- <li>
- Add and View Teachers/TAs
- </li>
- </ul>
- </p>
- <p class="lead">
- <a class="btn btn-primary btn-lg" href="https://yaksh.readthedocs.io/en/latest/moderator_docs/creating_course.html" role="button" target="blank">
- <i class="fa fa-info-circle"></i>
- Learn more
- </a>
- </p>
- </div>
{% endif %}
</div>
</div>
diff --git a/yaksh/templates/yaksh/course_detail_options.html b/yaksh/templates/yaksh/course_detail_options.html
index f9393ed..0910c01 100644
--- a/yaksh/templates/yaksh/course_detail_options.html
+++ b/yaksh/templates/yaksh/course_detail_options.html
@@ -1,51 +1,104 @@
-<a href="{% url 'yaksh:courses' %}" class="btn btn-primary" title="View all the courses" data-placement="top" data-toggle="tooltip">
- <i class="fa fa-arrow-left"></i>&nbsp;Back
+<a
+ href="{% url 'yaksh:courses' %}"
+ class="btn btn-primary"
+ title="View all the courses"
+ data-placement="top"
+ data-toggle="tooltip">
+ <i class="fa fa-arrow-left"></i>&nbsp;Back
</a>
<br><br>
-<ul class="nav nav-pills nav-fill flex-column flex-sm-row" role="tablist">
- <li class="nav-item">
- <a href="{% url 'yaksh:course_students' course.id %}" id="enroll-students" class="nav-link {% if is_students %} active {% endif %}" title="View the course requested, rejected and enrolled students" data-placement="top" data-toggle="tooltip">
- Enrollments
- </a>
- </li>
- <li class="nav-item">
- <a class="nav-link {% if is_modules %} active {% endif %}" href="{% url 'yaksh:get_course_modules' course.id %}" title="View modules added to the course" data-placement="top" data-toggle="tooltip">
- Course Modules
- </a>
- </li>
- <li class="nav-item">
- <a class="nav-link {% if is_design_course %} active {% endif %}" href="{% url 'yaksh:design_course' course.id %}" title="Additional course settings" data-placement="top" data-toggle="tooltip">
- Design Course
- </a>
- </li>
- <li class="nav-item">
- <a href="{% url 'yaksh:course_status' course.id %}" class="nav-link {% if is_progress %} active {% endif %}" title="View Students course progress" data-placement="top" data-toggle="tooltip">
- Course Progress
- </a>
- </li>
- <li class="nav-item">
- <a href="{% url 'yaksh:send_mail' course.id %}" class="nav-link {% if is_mail %} active {% endif %}" title="Send mail to course students" data-placement="top" data-toggle="tooltip">
- Send Mail
- </a>
- </li>
- <li class="nav-item">
- <a href="{% url 'yaksh:course_forum' course.id %}" class="nav-link" title="Discussion forum of this course" data-placement="top" data-toggle="tooltip">
- Discussion Forum
- </a>
- </li>
- <li class="nav-item">
- <a class="nav-link {% if is_add_teacher %} active {% endif %}" href="{% url 'yaksh:search_teacher' course.id %}" data-toggle="tooltip" title="Add Teachers/TAs to this course" data-placement="top">
- Add Teachers/TAs
- </a>
- </li>
- <li class="nav-item">
- <a class="nav-link {% if is_teachers %} active {% endif %}" href="{% url 'yaksh:course_teachers' course.id %}" data-toggle="tooltip" title="View all the Teachers/TAs for this course" data-placement="top">
- Current Teachers/TAs
- </a>
- </li>
- <li class="nav-item">
- <a class="nav-link list-group-item {% if is_upload_download_md %} active {% endif %}" href="{% url 'yaksh:upload_download_course_md' course.id %}" data-toggle="tooltip" title="Upload / Download MD files" data-placement="top">
- Upload / Download MD
- </a>
- </li>
+<ul
+ class="nav nav-pills nav-fill flex-column flex-sm-row"
+ role="tablist">
+ <li class="nav-item">
+ <a
+ href="{% url 'yaksh:course_detail' course.id %}"
+ id="enroll-students"
+ class="nav-link {% if is_students %} active {% endif %}"
+ title="View the course requested, rejected and enrolled students"
+ data-placement="top"
+ data-toggle="tooltip">
+ Enrollments
+ </a>
+ </li>
+ <li class="nav-item">
+ <a
+ class="nav-link {% if is_modules %} active {% endif %}"
+ href="{% url 'yaksh:get_course_modules' course.id %}"
+ title="View modules added to the course"
+ data-placement="top"
+ data-toggle="tooltip">
+ Course Modules
+ </a>
+ </li>
+ <li class="nav-item">
+ <a
+ class="nav-link {% if is_design_course %} active {% endif %}"
+ href="{% url 'yaksh:design_course' course.id %}"
+ title="Additional course settings"
+ data-placement="top"
+ data-toggle="tooltip">
+ Design Course
+ </a>
+ </li>
+ <li class="nav-item">
+ <a
+ href="{% url 'yaksh:course_status' course.id %}"
+ class="nav-link {% if is_progress %} active {% endif %}"
+ title="View Students course progress"
+ data-placement="top"
+ data-toggle="tooltip">
+ Course Progress
+ </a>
+ </li>
+ <li class="nav-item">
+ <a
+ href="{% url 'yaksh:send_mail' course.id %}"
+ class="nav-link {% if is_mail %} active {% endif %}"
+ title="Send mail to course students"
+ data-placement="top"
+ data-toggle="tooltip">
+ Send Mail
+ </a>
+ </li>
+ <li class="nav-item">
+ <a
+ href="{% url 'yaksh:course_forum' course.id %}"
+ class="nav-link"
+ title="Discussion forum of this course"
+ data-placement="top"
+ data-toggle="tooltip">
+ Discussion Forum
+ </a>
+ </li>
+ <li class="nav-item">
+ <a
+ class="nav-link {% if is_add_teacher %} active {% endif %}"
+ href="{% url 'yaksh:search_teacher' course.id %}"
+ data-toggle="tooltip"
+ title="Add Teachers/TAs to this course"
+ data-placement="top">
+ Add Teachers/TAs
+ </a>
+ </li>
+ <li class="nav-item">
+ <a
+ class="nav-link {% if is_teachers %} active {% endif %}"
+ href="{% url 'yaksh:course_teachers' course.id %}"
+ data-toggle="tooltip"
+ title="View all the Teachers/TAs for this course"
+ data-placement="top">
+ Current Teachers/TAs
+ </a>
+ </li>
+ <li class="nav-item">
+ <a
+ class="nav-link list-group-item {% if is_upload_download_md %} active {% endif %}"
+ href="{% url 'yaksh:upload_download_course_md' course.id %}"
+ data-toggle="tooltip"
+ title="Upload / Download MD files"
+ data-placement="top">
+ Upload / Download MD
+ </a>
+ </li>
</ul> \ No newline at end of file
diff --git a/yaksh/templates/yaksh/courses.html b/yaksh/templates/yaksh/courses.html
index b9e48d6..1d6ee7f 100644
--- a/yaksh/templates/yaksh/courses.html
+++ b/yaksh/templates/yaksh/courses.html
@@ -122,38 +122,54 @@
</div>
<div>
<div class="nav-item dropdown">
- <a class="dropdown-toggle nav-link" data-toggle="dropdown" href="#" style="color: blue;">More
+ <a
+ class="dropdown-toggle nav-link"
+ data-toggle="dropdown"
+ href="#"
+ style="color: blue;"
+ >
+ More
</a>
<div class="dropdown-menu dropdown-menu-right">
- <a class="dropdown-item" href="{% url 'yaksh:toggle_course_status' course.id %}">
- {% if course.active %}
- <i class="fa fa-toggle-on fa-2x"></i>
- Deactivate Course
- {% else %}
- <i class="fa fa-toggle-off fa-2x"></i>
- Activate Course
- {% endif %}
- </a>
- <div class="dropdown-divider"></div>
- <a class="dropdown-item" href="{% url 'yaksh:course_detail' course.id %}">
- <i class="fa fa-tasks"></i>
- Manage Course
- </a>
- <div class="dropdown-divider"></div>
- <a class="dropdown-item" href="{% url 'yaksh:duplicate_course' course.id %}">
- <i class="fa fa-clone"></i>
- Clone Course
- </a>
- <div class="dropdown-divider"></div>
- <a class="dropdown-item" href="{% url 'yaksh:download_course_csv' course.id %}">
- <i class="fa fa-download"></i>
- Download CSV
- </a>
- <div class="dropdown-divider"></div>
- <a class="dropdown-item" href="{% url 'yaksh:download_course' course.id %}">
- <i class="fa fa-download"></i>
- Download Course
- </a>
+ <a
+ class="dropdown-item"
+ href="{% url 'yaksh:course_detail' course.id %}">
+ <i class="fa fa-tasks"></i>
+ Manage Course
+ </a>
+ <div class="dropdown-divider"></div>
+ <a
+ class="dropdown-item"
+ href="{% url 'yaksh:duplicate_course' course.id %}">
+ <i class="fa fa-clone"></i>
+ Clone Course
+ </a>
+ <div class="dropdown-divider"></div>
+ <a
+ class="dropdown-item"
+ href="{% url 'yaksh:download_course_csv' course.id %}">
+ <i class="fa fa-download"></i>
+ Download CSV
+ </a>
+ <div class="dropdown-divider"></div>
+ <a
+ class="dropdown-item"
+ href="{% url 'yaksh:download_course' course.id %}">
+ <i class="fa fa-download"></i>
+ Download Course
+ </a>
+ <div class="dropdown-divider"></div>
+ <a
+ class="dropdown-item"
+ href="{% url 'yaksh:toggle_course_status' course.id %}">
+ {% if course.active %}
+ <i class="fa fa-toggle-on fa-2x"></i>
+ Deactivate Course
+ {% else %}
+ <i class="fa fa-toggle-off fa-2x"></i>
+ Activate Course
+ {% endif %}
+ </a>
</div>
</div>
</div>
diff --git a/yaksh/urls.py b/yaksh/urls.py
index a1aa607..f31e450 100644
--- a/yaksh/urls.py
+++ b/yaksh/urls.py
@@ -220,8 +220,6 @@ urlpatterns = [
views.download_course, name="download_course"),
url(r'^download_course/(?P<course_id>\d+)/$',
views.download_course, name="download_course"),
- url(r'^manage/course/enrollments/(?P<course_id>\d+)',
- views.course_students, name="course_students"),
url(r'^manage/course/all/modules/(?P<course_id>\d+)',
views.get_course_modules, name="get_course_modules"),
url(r'^manage/course/teachers/(?P<course_id>\d+)',
diff --git a/yaksh/views.py b/yaksh/views.py
index 4a6f462..4a97d1a 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -1182,7 +1182,6 @@ def courses(request):
@email_verified
def course_detail(request, course_id):
user = request.user
-
if not is_moderator(user):
raise Http404('You are not allowed to view this page')
@@ -1190,9 +1189,18 @@ def course_detail(request, course_id):
if not course.is_creator(user) and not course.is_teacher(user):
raise Http404('This course does not belong to you')
- return my_render_to_response(
- request, 'yaksh/course_detail.html', {'course': course}
- )
+ enrolled_users = course.get_enrolled()
+ requested_users = course.get_requests()
+ rejected_users = course.get_rejected()
+ context = {
+ "enrolled_users": enrolled_users,
+ "requested_users": requested_users,
+ "course": course,
+ "rejected_users": rejected_users,
+ "is_students": True
+ }
+
+ return my_render_to_response(request, 'yaksh/course_detail.html', context)
@login_required
@@ -3348,29 +3356,6 @@ def download_course(request, course_id):
@login_required
@email_verified
-def course_students(request, course_id):
- user = request.user
- if not is_moderator(user):
- raise Http404('You are not allowed to view this page!')
- course = get_object_or_404(Course, pk=course_id)
- if not course.is_creator(user) and not course.is_teacher(user):
- raise Http404("You are not allowed to view {0}".format(
- course.name))
- enrolled_users = course.get_enrolled()
- requested_users = course.get_requests()
- rejected_users = course.get_rejected()
- context = {
- "enrolled_users": enrolled_users,
- "requested_users": requested_users,
- "course": course,
- "rejected_users": rejected_users,
- "is_students": True
- }
- return my_render_to_response(request, 'yaksh/course_detail.html', context)
-
-
-@login_required
-@email_verified
def course_teachers(request, course_id):
user = request.user
if not is_moderator(user):