diff options
author | CruiseDevice | 2020-04-25 19:21:04 +0530 |
---|---|---|
committer | CruiseDevice | 2020-04-25 19:21:04 +0530 |
commit | 66939d00dab998c7c0e649938527271551f22980 (patch) | |
tree | 0fa82441bcd547f8c7ce51384bcbddf269453105 /yaksh/templates | |
parent | 8f66c175447bc335c9121d5bf5ae1cb5b181cef9 (diff) | |
download | online_test-66939d00dab998c7c0e649938527271551f22980.tar.gz online_test-66939d00dab998c7c0e649938527271551f22980.tar.bz2 online_test-66939d00dab998c7c0e649938527271551f22980.zip |
Resolve comments, fix tests, add pagination
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/yaksh/course_forum.html | 15 | ||||
-rw-r--r-- | yaksh/templates/yaksh/post_comments.html | 13 |
2 files changed, 16 insertions, 12 deletions
diff --git a/yaksh/templates/yaksh/course_forum.html b/yaksh/templates/yaksh/course_forum.html index 17dc287..bf098d3 100644 --- a/yaksh/templates/yaksh/course_forum.html +++ b/yaksh/templates/yaksh/course_forum.html @@ -1,5 +1,4 @@ -{% extends "user.html" %} -{% load humanize %} +{% extends base_template %} {% load static %} {% block title %} {{course.name}}: Discussion Forum @@ -10,7 +9,12 @@ <h2><center>{{course.name}}</center></h2> <center>Discussion Forum</center> </div> - <div class="pull-right"> + {% if moderator %} + <a href="{% url 'yaksh:course_detail' course.id %}" class="btn btn-primary">Back to Course</a> + {% else %} + <a href="{% url 'yaksh:course_modules' course.id %}" class="btn btn-primary">Back to Course</a> + {% endif %} + <div class="pull-right"> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#newPostModal">New Post</button> </div> <!-- Modal --> @@ -56,7 +60,7 @@ {% for post in posts %} <tr> <td> - <a href="{% url "yaksh:post_comments" course.id post.uid %}">{{post.title}}</a> + <a href="{% url 'yaksh:post_comments' course.id post.uid %}">{{post.title}}</a> <small class="text-muted d-block">{{ post.description|truncatewords:30 }}</small> <small class="text-muted"><strong>Last updated: {{post.modified_at}}</strong></small> </td> @@ -73,7 +77,7 @@ </td> <td> {% if user.profile.is_moderator %} - <small><a href="{% url "yaksh:hide_post" course.id post.uid %}" class="pull-right btn btn-danger">Delete</i></a></small> + <small><a href="{% url 'yaksh:hide_post' course.id post.uid %}" class="pull-right btn btn-danger">Delete</i></a></small> {% endif %} </td> </tr> @@ -83,6 +87,7 @@ {% else %} No discussion posts are there yet. Create one to start discussing. {% endif %} + {% include "yaksh/paginator.html" %} </div> {% endblock content %} {% block script %} diff --git a/yaksh/templates/yaksh/post_comments.html b/yaksh/templates/yaksh/post_comments.html index 227530e..463103e 100644 --- a/yaksh/templates/yaksh/post_comments.html +++ b/yaksh/templates/yaksh/post_comments.html @@ -1,13 +1,12 @@ -{% extends "user.html" %} +{% extends base_template %} {% load static %} -{% load humanize %} {% block title %} {{post.title}} {% endblock title %} {% block content %} <div class="container"> - <a class="btn btn-primary" href="{% url "yaksh:course_forum" post.course.id %}">Back to Posts</a> + <a class="btn btn-primary" href="{% url 'yaksh:course_forum' post.course.id %}">Back to Posts</a> <br> <br> <div class="card mb-2 border-dark"> @@ -16,8 +15,8 @@ <br> <small> <strong>{{post.creator.username}}</strong> - {{post.created_at|naturaltime}} - {% if user.profile.is_moderator %}<a href="{% url "yaksh:hide_post" post.course.id post.uid %}" class="pull-right btn btn-danger">Delete</a>{% endif %} + {{post.created_at}} + {% if user.profile.is_moderator %}<a href="{% url 'yaksh:hide_post' post.course.id post.uid %}" class="pull-right btn btn-danger">Delete</a>{% endif %} </small> </div> @@ -40,7 +39,7 @@ <strong class="text-muted">{{comment.creator.username}}</strong> </div> <div class="col-6 text-right"> - <small class="text-muted">{{comment.created_at}} {% if user.profile.is_moderator %} <a href="{% url "yaksh:hide_comment" post.course.id comment.uid %}" class="btn btn-danger">Delete</a>{% endif %}</small> + <small class="text-muted">{{comment.created_at}} {% if user.profile.is_moderator %} <a href="{% url 'yaksh:hide_comment' post.course.id comment.uid %}" class="btn btn-danger">Delete</a>{% endif %}</small> </div> </div> <p class="card-text description">{{comment.description}}</p> @@ -57,7 +56,7 @@ {% endif %} <br> <div> - <form action="{% url "yaksh:post_comments" post.course.id post.uid %}" method="POST" enctype='multipart/form-data'> + <form action="{% url 'yaksh:post_comments' post.course.id post.uid %}" method="POST" enctype='multipart/form-data'> <div class="form-group"> {% csrf_token %} {{form}} |