summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
authorCruiseDevice2020-04-13 16:45:42 +0530
committerCruiseDevice2020-04-13 16:45:42 +0530
commit0e6c7d589114450d5cd1bc581ee1692c235f1a73 (patch)
tree3e1749b9695a708ac65deb5953d4913250335522 /yaksh/templates
parent2a9f81cb32acfd7a2efc18f58c4529b39ce4061b (diff)
downloadonline_test-0e6c7d589114450d5cd1bc581ee1692c235f1a73.tar.gz
online_test-0e6c7d589114450d5cd1bc581ee1692c235f1a73.tar.bz2
online_test-0e6c7d589114450d5cd1bc581ee1692c235f1a73.zip
Add feature for uploading images
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/yaksh/course_forum.html14
-rw-r--r--yaksh/templates/yaksh/thread_comments.html11
2 files changed, 16 insertions, 9 deletions
diff --git a/yaksh/templates/yaksh/course_forum.html b/yaksh/templates/yaksh/course_forum.html
index b0c7024..4741ae0 100644
--- a/yaksh/templates/yaksh/course_forum.html
+++ b/yaksh/templates/yaksh/course_forum.html
@@ -23,13 +23,10 @@
<button type="button" class="close" data-dismiss="modal">&times;</button>
</div>
<div class="modal-body">
- <form action="." method="POST">
+ <form action="." method="POST" enctype='multipart/form-data'>
<div class="form-group">
{% csrf_token %}
- <label>Title: </label>
- <input name='title' type="text" class="form-control" required>
- <label>Description: </label>
- <textarea class="form-control" name="description" id="" cols="45" rows="3" required></textarea>
+ {{form}}
</div>
<input type="submit" class="btn btn-primary" value="Create Thread">
</form>
@@ -50,12 +47,17 @@
<div class="card">
<div class="card-body">
<a href="{% url "yaksh:thread_comments" course.id thread.uid %}">{{thread.title}}</a>
+ <br>
+ {% if thread.image %}
+ <img src="{{thread.image.url}}" class="thread_image">
+ {% endif %}
<p class="pull-right"><small>{{thread.get_comments_count}}{% if thread.get_comments_count > 1 %} replies{% else %} reply{% endif %}</small></p>
</div>
<div class="card-footer">
{% with thread.get_last_comment as last_comment %}
- <small> {% if thread.creator.profile.is_moderator %} INSTRUCTOR CREATED {% endif %} Last Post by: <strong>{{last_comment.user}}</strong> . {{last_comment.modified_at|naturaltime}}</small>
+ <small> {% if thread.creator.profile.is_moderator %} INSTRUCTOR CREATED {% endif %} Last Post by: <strong>{{last_comment.creator}}</strong> . {{last_comment.modified_at|naturaltime}}</small>
{% endwith %}
+ <small><a href="{% url "yaksh:delete_thread" course.id thread.uid %}" class="pull-right">Delete</i></a></small>
</div>
</div>
<br>
diff --git a/yaksh/templates/yaksh/thread_comments.html b/yaksh/templates/yaksh/thread_comments.html
index 245c363..ab0ade9 100644
--- a/yaksh/templates/yaksh/thread_comments.html
+++ b/yaksh/templates/yaksh/thread_comments.html
@@ -23,7 +23,12 @@
<div class="card-header">Comments:</div>
{% for comment in comments %}
<div class="card-body">
- <p>{{comment.body}}</p>
+ {% if comment.image %}
+ <a href="{{comment.image.url}}" target="_blank">
+ <img src="{{comment.image.url}}" class='comment_image'>
+ </a>
+ {% endif %}
+ <p>{{comment.description}}</p>
<small class="pull-right">by: <strong>{{comment.user.username}} </strong>. {{comment.created_at}}</small>
</div>
<hr>
@@ -34,10 +39,10 @@
</div>
<br>
<div>
- <form action="{% url "yaksh:thread_comments" thread.course.id thread.uid %}" method="POST">
+ <form action="{% url "yaksh:thread_comments" thread.course.id thread.uid %}" method="POST" enctype='multipart/form-data'>
<div class="form-group">
{% csrf_token %}
- <textarea class="form-control" name="comment" id="" cols="55" rows="5" required></textarea>
+ {{form}}
</div>
<input type="submit" value="Submit" class="btn btn-primary">
</form>