diff options
Diffstat (limited to 'yaksh')
-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/show_lesson_statistics.html | 6 | ||||
-rw-r--r-- | yaksh/templates/yaksh/sidebar.html | 18 | ||||
-rw-r--r-- | yaksh/templatetags/custom_filters.py | 2 | ||||
-rw-r--r-- | yaksh/views.py | 4 |
7 files changed, 45 insertions, 16 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/show_lesson_statistics.html b/yaksh/templates/yaksh/show_lesson_statistics.html index a7c2ebd..dfce52c 100644 --- a/yaksh/templates/yaksh/show_lesson_statistics.html +++ b/yaksh/templates/yaksh/show_lesson_statistics.html @@ -1,7 +1,7 @@ {% extends "manage.html" %} {% load static %} {% load custom_filters %} -{% block title %} Lesson Statistics {% endblock %} +{% block title %} Lesson Quiz Stats {% endblock %} {% block pagetitle %} Statistics for {{lesson}} {% endblock %} {% block script %} <script type="text/javascript" src="{% static 'yaksh/js/jquery.tablesorter.min.js' %}"> @@ -135,8 +135,8 @@ <div class="progress" style="width: 30%"> {% if percent %} <div class="progress-bar bg-success" role="progressbar" aria-valuenow="{{percent}}" - aria-valuemin="0" aria-valuemax="100" style="width:{{percent}}%"> - <b style="color: white;">{{percent}}%</b> + aria-valuemin="0" aria-valuemax="100" style="width:{{percent|floatformat}}%"> + <b style="color: white;">{{percent|floatformat}}%</b> </div> {% else %} <b style="color: black;">0%</b> 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/templatetags/custom_filters.py b/yaksh/templatetags/custom_filters.py index 91681c2..7eba939 100644 --- a/yaksh/templatetags/custom_filters.py +++ b/yaksh/templatetags/custom_filters.py @@ -209,5 +209,5 @@ def get_tc_percent(tc_id, data): def get_lesson_views(course_id, lesson_id): course = Course.objects.get(id=course_id) return TrackLesson.objects.filter( - course_id=course_id, lesson_id=lesson_id + course_id=course_id, lesson_id=lesson_id, watched=True ).count(), course.students.count() 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) |