summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/templates/yaksh/course_forum.html66
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 %}