diff options
-rw-r--r-- | yaksh/templates/yaksh/course_added_modules.html | 2 | ||||
-rw-r--r-- | yaksh/templates/yaksh/course_forum.html | 3 | ||||
-rw-r--r-- | yaksh/templates/yaksh/lessons_forum.html | 26 | ||||
-rw-r--r-- | yaksh/templates/yaksh/sidebar.html | 18 | ||||
-rw-r--r-- | yaksh/views.py | 4 |
5 files changed, 41 insertions, 12 deletions
diff --git a/yaksh/templates/yaksh/course_added_modules.html b/yaksh/templates/yaksh/course_added_modules.html index 80d87c0..b0662dd 100644 --- a/yaksh/templates/yaksh/course_added_modules.html +++ b/yaksh/templates/yaksh/course_added_modules.html @@ -100,7 +100,7 @@ ---- {% else %} {% get_lesson_views course.id unit.lesson.id as views %} - {{views.0}} views out of {{views.1}} + {{views.0}} completed out of {{views.1}} {% endif %} </td> <td> diff --git a/yaksh/templates/yaksh/course_forum.html b/yaksh/templates/yaksh/course_forum.html index b98688b..b352654 100644 --- a/yaksh/templates/yaksh/course_forum.html +++ b/yaksh/templates/yaksh/course_forum.html @@ -5,7 +5,6 @@ {% endblock title %} {% block content %} <div id="wrapper" class="d-flex"> - {% include "yaksh/sidebar.html" %} <div class="container" id="page-content-wrapper"> <div> <h2><center>{{course.name}}</center></h2> @@ -69,6 +68,8 @@ </div> </div> <br> + {% include "yaksh/sidebar.html" %} + <br> {% with objects as posts %} {% if posts %} <div class="row justify-content-center"> diff --git a/yaksh/templates/yaksh/lessons_forum.html b/yaksh/templates/yaksh/lessons_forum.html index 58fb360..26825b9 100644 --- a/yaksh/templates/yaksh/lessons_forum.html +++ b/yaksh/templates/yaksh/lessons_forum.html @@ -5,8 +5,11 @@ {% endblock title %} {% block content %} <div id="wrapper" class="d-flex"> - {% include "yaksh/sidebar.html" %} <div class="container" id="page-content-wrapper"> + <div> + <h2><center>{{course.name}}</center></h2> + <center>Discussion Forum</center> + </div> <div class="d-flex p-2 bd-highlight"> <div class="col-md-4"> {% if moderator %} @@ -20,11 +23,24 @@ {% endif %} </div> </div> - {% if posts %} + {% if messages %} <div> - <h2><center>{{course.name}}</center></h2> - <center>Discussion Forum</center> - </div> + <center> + {% for message in messages %} + <div class="alert alert-dismissible alert-{{ message.tags }}"> + <button type="button" class="close" data-dismiss="alert"> + <i class="fa fa-close"></i> + </button> + <strong>{{ message }}</strong> + </div> + {% endfor %} + </center> + </div> + {% endif %} + <br> + {% include "yaksh/sidebar.html" %} + <br> + {% if posts %} <table class="table"> <thead class="thread-inverse"> <tr> diff --git a/yaksh/templates/yaksh/sidebar.html b/yaksh/templates/yaksh/sidebar.html index 7d0ac74..5808608 100644 --- a/yaksh/templates/yaksh/sidebar.html +++ b/yaksh/templates/yaksh/sidebar.html @@ -1,8 +1,16 @@ <!-- Sidebar --> -<div class="bg-light border-right" id="sidebar-wrapper"> - <div class="list-group list-group-flush"> - <a href="{% url 'yaksh:course_forum' course.id %}" class="list-group-item list-group-item-action {% if '/course_forum/' in request.path %}active{% endif %}">Course Forum</a> - <a href="{% url 'yaksh:lessons_forum' course.id %}" class="list-group-item list-group-item-action {% if '/lessons_forum/' in request.path %}active{% endif %}">Lessons Forum</a> - </div> +<div class="bg-light"> + <ul class="nav nav-pills"> + <li class="nav-item"> + <a href="{% url 'yaksh:course_forum' course.id %}" class="nav-link {% if '/course_forum/' in request.path %}active{% endif %}"> + Course Forum + </a> + </li> + <li class="nav-item"> + <a href="{% url 'yaksh:lessons_forum' course.id %}" class="nav-link {% if '/lessons_forum/' in request.path %}active{% endif %}"> + Lessons Forum + </a> + </li> + </ul> </div> <!-- /#sidebar-wrapper --> diff --git a/yaksh/views.py b/yaksh/views.py index 95a7218..11a77b8 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -3507,6 +3507,7 @@ def course_forum(request, course_id): new_post.target = course new_post.anonymous = request.POST.get('anonymous', '') == 'on' new_post.save() + messages.success(request, "Added post successfully") return redirect('yaksh:post_comments', course_id=course.id, uuid=new_post.uid) else: @@ -3565,6 +3566,7 @@ def post_comments(request, course_id, uuid): new_comment.post_field = post new_comment.anonymous = request.POST.get('anonymous', '') == 'on' new_comment.save() + messages.success(request, "Added comment successfully") return redirect(request.path_info) return render(request, 'yaksh/post_comments.html', { 'post': post, @@ -3589,6 +3591,7 @@ def hide_post(request, course_id, uuid): post.comment.active = False post.active = False post.save() + messages.success(request, "Post deleted successfully") return redirect('yaksh:course_forum', course_id) @@ -3606,6 +3609,7 @@ def hide_comment(request, course_id, uuid): post_uid = comment.post_field.uid comment.active = False comment.save() + messages.success(request, "Post comment deleted successfully") return redirect('yaksh:post_comments', course_id, post_uid) |