diff options
author | CruiseDevice | 2020-04-21 22:13:28 +0530 |
---|---|---|
committer | CruiseDevice | 2020-04-21 22:13:28 +0530 |
commit | 04b59bef46557f5e7a1230ab8e5a4929b48c5d59 (patch) | |
tree | 3fb839cc0bc69466504f05d1a8ae45fd99f6d3fa /yaksh/templates | |
parent | 9b0c622ee111f36510480e5d3109be87ed347cef (diff) | |
download | online_test-04b59bef46557f5e7a1230ab8e5a4929b48c5d59.tar.gz online_test-04b59bef46557f5e7a1230ab8e5a4929b48c5d59.tar.bz2 online_test-04b59bef46557f5e7a1230ab8e5a4929b48c5d59.zip |
Improve Post list UI
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/yaksh/course_forum.html | 66 |
1 files changed, 42 insertions, 24 deletions
diff --git a/yaksh/templates/yaksh/course_forum.html b/yaksh/templates/yaksh/course_forum.html index 12f5241..ff83c1a 100644 --- a/yaksh/templates/yaksh/course_forum.html +++ b/yaksh/templates/yaksh/course_forum.html @@ -41,30 +41,48 @@ </div> <br> <br> - <div> - {% if posts %} - {% for post in posts %} - <div class="card"> - <div class="card-body"> - <a href="{% url "yaksh:post_comments" course.id post.uid %}">{{post.title}}</a> - <p>{{post.description|truncatewords:30}}</p> - <p class="pull-right"><small>{{post.get_comments_count}}{% if post.get_comments_count > 1 %} replies{% else %} reply{% endif %}</small></p> - </div> - <div class="card-footer"> - {% with post.get_last_comment as last_comment %} - <small> {% if post.creator.profile.is_moderator %} <span class="brown-light">INSTRUCTOR</span> {% endif %} {% if last_comment %} Last Post by: <strong>{{last_comment.creator}}</strong> . {{last_comment.modified_at|naturaltime}} {% else %} Created By <strong>{{post.creator.username}}</strong> {% endif %}</small> - {% endwith %} - {% if user.profile.is_moderator %} - <small><a href="{% url "yaksh:hide_post" course.id post.uid %}" class="pull-right">Delete</i></a></small> - {% endif %} - </div> - </div> - <br> - {% endfor %} - {% else %} - No discussion posts are there yet. Create one to start discussing. - {% endif %} - </div> + {% if posts %} + <table class="table"> + <thead class="thread-inverse"> + <tr> + <th width="700">Questions</th> + <th>Created by</th> + <th>Replies</th> + <th>Last reply</th> + <th></th> + </tr> + </thead> + <tbody> + {% for post in posts %} + <tr> + <td> + <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> + <td>{{post.creator.username}}</td> + <td>{{post.get_comments_count}}</td> + <td> + {% with post.get_last_comment as last_comment %} + {% if last_comment %} + {{last_comment.creator}} + {% else %} + None + {% endif %} + {% endwith %} + </td> + <td> + {% if user.profile.is_moderator %} + <small><a href="{% url "yaksh:hide_post" course.id post.uid %}" class="pull-right">Delete</i></a></small> + {% endif %} + </td> + </tr> + {% endfor %} + </tbody> + </table> + {% else %} + No discussion posts are there yet. Create one to start discussing. + {% endif %} </div> {% endblock content %} {% block script %} |