diff options
author | CruiseDevice | 2020-10-01 14:17:56 +0530 |
---|---|---|
committer | ankitjavalkar | 2020-10-08 10:42:51 +0530 |
commit | edf3b4c5d9afdaeb7c6d8e45484401bdce26e23c (patch) | |
tree | d8454d5a418da7309a9714f6389efe7bef2930f8 /yaksh/templates | |
parent | 86a8e2d43294eadf164710589c70bf497f65d801 (diff) | |
download | online_test-edf3b4c5d9afdaeb7c6d8e45484401bdce26e23c.tar.gz online_test-edf3b4c5d9afdaeb7c6d8e45484401bdce26e23c.tar.bz2 online_test-edf3b4c5d9afdaeb7c6d8e45484401bdce26e23c.zip |
User can create anonymous post and comment
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/yaksh/course_forum.html | 8 | ||||
-rw-r--r-- | yaksh/templates/yaksh/lessons_forum.html | 8 | ||||
-rw-r--r-- | yaksh/templates/yaksh/post_comments.html | 36 | ||||
-rw-r--r-- | yaksh/templates/yaksh/show_video.html | 16 |
4 files changed, 48 insertions, 20 deletions
diff --git a/yaksh/templates/yaksh/course_forum.html b/yaksh/templates/yaksh/course_forum.html index 3190245..fce58fe 100644 --- a/yaksh/templates/yaksh/course_forum.html +++ b/yaksh/templates/yaksh/course_forum.html @@ -111,7 +111,13 @@ <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> + {% if post.anonymous %} + Anonymous + {% else %} + {{post.creator.username}} + {% endif %} + </td> <td>{{post.get_comments_count}}</td> <td> {% with post.get_last_comment as last_comment %} diff --git a/yaksh/templates/yaksh/lessons_forum.html b/yaksh/templates/yaksh/lessons_forum.html index f8d1912..250536d 100644 --- a/yaksh/templates/yaksh/lessons_forum.html +++ b/yaksh/templates/yaksh/lessons_forum.html @@ -43,7 +43,13 @@ <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> + {% if post.anonymouse %} + Anonymous + {% else %} + {{post.creator.username}} + {% endif %} + </td> <td>{{post.get_comments_count}}</td> <td> {% with post.get_last_comment as last_comment %} diff --git a/yaksh/templates/yaksh/post_comments.html b/yaksh/templates/yaksh/post_comments.html index 4038afb..1480264 100644 --- a/yaksh/templates/yaksh/post_comments.html +++ b/yaksh/templates/yaksh/post_comments.html @@ -30,7 +30,13 @@ {{post.title}} <br> <small> - <strong>{{post.creator.username}}</strong> + <strong> + {% if post.anonymous %} + Anonymous + {% else %} + {{post.creator.username}} + {% endif %} + </strong> {{post.created_at}} {% if user == course.creator %}<a href="{% url 'yaksh:hide_post' post.target.id post.uid %}" class="pull-right fa fa-trash"></a>{% endif %} </small> @@ -45,6 +51,16 @@ {% endif %} </div> </div> + <div> + <b><u>Add comment:</u></b> + <form action="" method="POST" enctype='multipart/form-data'> + <div class="form-group"> + {% csrf_token %} + {{form}} + </div> + <input type="submit" value="Submit" class="btn btn-success"> + </form> + </div> <br> {% if comments %} {% for comment in comments %} @@ -52,7 +68,13 @@ <div class="card-body p-3"> <div class="row mb-3"> <div class="col-6"> - <strong class="text-muted">{{comment.creator.username}}</strong> + <strong class="text-muted"> + {% if comment.anonymous %} + Anonymous + {% else %} + {{comment.creator.username}} + {% endif %} + </strong> </div> <div class="col-6 text-right"> <small class="text-muted">{{comment.created_at}} {% if user == course.creator %} <a href="{% url 'yaksh:hide_comment' post.target.id comment.uid %}" class="fa fa-trash"></a>{% endif %}</small> @@ -71,16 +93,6 @@ {% endfor %} {% endif %} <br> - <div> - <b><u>Add comment:</u></b> - <form action="" method="POST" enctype='multipart/form-data'> - <div class="form-group"> - {% csrf_token %} - {{form}} - </div> - <input type="submit" value="Submit" class="btn btn-success"> - </form> - </div> </div> {% endblock content %} {% block script %} diff --git a/yaksh/templates/yaksh/show_video.html b/yaksh/templates/yaksh/show_video.html index 022ba9c..0e16e37 100644 --- a/yaksh/templates/yaksh/show_video.html +++ b/yaksh/templates/yaksh/show_video.html @@ -246,13 +246,17 @@ <div class="card-body p-3"> <div class="row mb-3"> <div class="col-6"> - <strong class="text-muted">{{comment.creator.username}}</strong> + <strong class="text-muted"> + {% if comment.anonymous %} + Anonymous + {% else %} + {{comment.creator.username}} + {% endif %} + </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' course.id comment.uid %}" class="fa fa-trash"></a>{% endif %}</small> </div> - {% if user == course.creator %} - <div class="col-6 text-right"> - <small class="text-muted">{{comment.created_at}} {% if user.profile.is_moderator %} <a href="{% url 'yaksh:hide_comment' course.id comment.uid %}" class="fa fa-trash"></a>{% endif %}</small> - </div> - {% endif %} </div> <p class="card-text description">{{comment.description}}</p> <div> |