summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
authoradityacp2020-03-28 17:18:34 +0530
committeradityacp2020-03-28 17:18:34 +0530
commitf5d0545d45eccfc100b337cea45c5a6805deca0a (patch)
treeea21e0f77be67894d38171925d0809109da627e7 /yaksh
parentb835440b1e2ca0059e95b6848cb87cc5724ee967 (diff)
downloadonline_test-f5d0545d45eccfc100b337cea45c5a6805deca0a.tar.gz
online_test-f5d0545d45eccfc100b337cea45c5a6805deca0a.tar.bz2
online_test-f5d0545d45eccfc100b337cea45c5a6805deca0a.zip
Change in course modules template, views
- Remove redirect url from views - Allow to edit module
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/templates/yaksh/course_added_modules.html4
-rw-r--r--yaksh/views.py8
2 files changed, 5 insertions, 7 deletions
diff --git a/yaksh/templates/yaksh/course_added_modules.html b/yaksh/templates/yaksh/course_added_modules.html
index 7ea55e8..9055340 100644
--- a/yaksh/templates/yaksh/course_added_modules.html
+++ b/yaksh/templates/yaksh/course_added_modules.html
@@ -15,7 +15,9 @@
{% for module in modules %}
<div class="card">
<div class="card-header">
- {{module.name}}
+ <a href="{% url 'yaksh:edit_module' course.id module.id %}">
+ <i class="fa fa-edit"></i>&nbsp;{{module.name}}
+ </a>
</div>
<div class="card-body">
<div class="row">
diff --git a/yaksh/views.py b/yaksh/views.py
index e5f9bc2..9e81b2d 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -2479,9 +2479,7 @@ def edit_lesson(request, course_id=None, module_id=None, lesson_id=None):
course = get_object_or_404(Course, id=course_id)
if not course.is_creator(user) and not course.is_teacher(user):
raise Http404('This Lesson does not belong to you')
- redirect_url = reverse("yaksh:get_course_modules", args=[course_id])
- else:
- redirect_url = reverse("yaksh:show_all_lessons")
+
context = {}
if request.method == "POST":
if "Save" in request.POST:
@@ -2516,7 +2514,7 @@ def edit_lesson(request, course_id=None, module_id=None, lesson_id=None):
return redirect(
reverse("yaksh:edit_lesson",
args=[course_id, module_id, lesson.id])
- )
+ )
else:
context['lesson_form'] = lesson_form
context['error'] = lesson_form["video_file"].errors
@@ -2699,12 +2697,10 @@ def add_module(request, course_id=None, module_id=None):
user = request.user
if not is_moderator(user):
raise Http404('You are not allowed to view this page!')
- redirect_url = reverse("yaksh:show_all_modules")
if course_id:
course = Course.objects.get(id=course_id)
if not course.is_creator(user) and not course.is_teacher(user):
raise Http404('This course does not belong to you')
- redirect_url = reverse("yaksh:get_course_modules", args=[course_id])
if module_id:
module = LearningModule.objects.get(id=module_id)
if not module.creator == user and not course_id: