From f2d1d8fe76109a5b7c53e68de2bd86230874ba90 Mon Sep 17 00:00:00 2001
From: adityacp
Date: Wed, 19 Feb 2020 11:09:16 +0530
Subject: Change views, test_views, templates
- Change message text in duplicate course view function
- Remove clone course option from course detail page and show it in
courses page
- Show download course option in courses page
- Show message for search results in student dashboard
- Fix views tests
- Show collapse requested students list
---
yaksh/templates/yaksh/course_detail_options.html | 5 --
yaksh/templates/yaksh/course_students.html | 2 +-
yaksh/templates/yaksh/courses.html | 63 +++++++++++++++++++-----
yaksh/templates/yaksh/quizzes_user.html | 4 +-
yaksh/test_views.py | 4 +-
yaksh/views.py | 9 ++--
6 files changed, 62 insertions(+), 25 deletions(-)
(limited to 'yaksh')
diff --git a/yaksh/templates/yaksh/course_detail_options.html b/yaksh/templates/yaksh/course_detail_options.html
index 43422ed..6f9a711 100644
--- a/yaksh/templates/yaksh/course_detail_options.html
+++ b/yaksh/templates/yaksh/course_detail_options.html
@@ -19,11 +19,6 @@
Course Progress
-
-
- Clone Course
-
-
Design Course
diff --git a/yaksh/templates/yaksh/course_students.html b/yaksh/templates/yaksh/course_students.html
index fe64ce4..2052a69 100644
--- a/yaksh/templates/yaksh/course_students.html
+++ b/yaksh/templates/yaksh/course_students.html
@@ -52,7 +52,7 @@
-
+
{% if requested %}
diff --git a/yaksh/templates/yaksh/courses.html b/yaksh/templates/yaksh/courses.html
index 6a98ee3..0eb9a38 100644
--- a/yaksh/templates/yaksh/courses.html
+++ b/yaksh/templates/yaksh/courses.html
@@ -144,23 +144,45 @@
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
@@ -224,22 +246,41 @@
-
+
-
+
-
diff --git a/yaksh/templates/yaksh/quizzes_user.html b/yaksh/templates/yaksh/quizzes_user.html
index 7771954..a9f5a43 100644
--- a/yaksh/templates/yaksh/quizzes_user.html
+++ b/yaksh/templates/yaksh/quizzes_user.html
@@ -8,7 +8,7 @@
{% block main %}
- All Courses
+ {{title}}
@@ -25,7 +25,7 @@
- {% if title == "Search" %}
+ {% if "Search" in title %}
Clear search
diff --git a/yaksh/test_views.py b/yaksh/test_views.py
index 569b468..58c6633 100644
--- a/yaksh/test_views.py
+++ b/yaksh/test_views.py
@@ -448,7 +448,7 @@ class TestStudentDashboard(TestCase):
}
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, "yaksh/quizzes_user.html")
- self.assertEqual(response.context['title'], 'Search')
+ self.assertEqual(response.context['title'], 'Search Results')
self.assertEqual(response.context['courses'][0], courses_in_context)
@@ -2121,7 +2121,7 @@ class TestCourses(TestCase):
follow=True
)
err_msg = "You do not have permissions"
- self.assertEqual(response.status_code, 404)
+ self.assertEqual(response.status_code, 200)
messages = [m.message for m in get_messages(response.wsgi_request)]
self.assertIn(err_msg, messages[0])
diff --git a/yaksh/views.py b/yaksh/views.py
index 59efc59..0ae4a14 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -174,7 +174,7 @@ def quizlist_user(request, enrolled=None, msg=None):
course_code = request.POST.get('course_code')
hidden_courses = Course.objects.get_hidden_courses(code=course_code)
courses = hidden_courses
- title = 'Search'
+ title = 'Search Results'
else:
courses = list(Course.objects.filter(
active=True, is_trial=False,
@@ -2425,8 +2425,9 @@ def duplicate_course(request, course_id):
duplicate_course = course.create_duplicate_course(user)
msg = dedent(
'''\
- Course duplication successful with the name {0} , please check
- the courses page.'''.format(duplicate_course.name)
+ Course duplication successful with the name {0}'''.format(
+ duplicate_course.name
+ )
)
messages.success(request, msg)
else:
@@ -2436,7 +2437,7 @@ def duplicate_course(request, course_id):
your instructor/administrator.'''.format(course.name)
)
messages.warning(request, msg)
- return my_redirect(reverse('yaksh:course_detail', args=[course_id]))
+ return my_redirect(reverse('yaksh:courses'))
@login_required
--
cgit