summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
authorCruiseDevice2020-09-23 17:27:53 +0530
committerankitjavalkar2020-10-08 10:42:51 +0530
commit74366df12bdf352b227540244ee6df35e596007a (patch)
tree233c50149d18cbdf921d347c26eddf80bbcb766f /yaksh/templates
parent31e258a9d2e253691fd548d47aaab3cfee756322 (diff)
downloadonline_test-74366df12bdf352b227540244ee6df35e596007a.tar.gz
online_test-74366df12bdf352b227540244ee6df35e596007a.tar.bz2
online_test-74366df12bdf352b227540244ee6df35e596007a.zip
Show trash icon in forum only to course creator and teacher
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/yaksh/course_forum.html16
-rw-r--r--yaksh/templates/yaksh/lessons_forum.html2
-rw-r--r--yaksh/templates/yaksh/post_comments.html18
-rw-r--r--yaksh/templates/yaksh/show_video.html33
4 files changed, 50 insertions, 19 deletions
diff --git a/yaksh/templates/yaksh/course_forum.html b/yaksh/templates/yaksh/course_forum.html
index 0346121..3190245 100644
--- a/yaksh/templates/yaksh/course_forum.html
+++ b/yaksh/templates/yaksh/course_forum.html
@@ -29,6 +29,20 @@
</button>
</div>
</div>
+ {% if messages %}
+ <div>
+ <center>
+ {% for message in messages %}
+ <div class="alert alert-dismissible alert-{{ message.tags }}">
+ <button type="button" class="close" data-dismiss="alert">
+ <i class="fa fa-close"></i>
+ </button>
+ <strong>{{ message }}</strong>
+ </div>
+ {% endfor %}
+ </center>
+ </div>
+ {% endif %}
<!-- Modal -->
<div id="newPostModal" class="modal fade" role="dialog">
<div class="modal-dialog">
@@ -109,7 +123,7 @@
{% endwith %}
</td>
<td>
- {% if user.profile.is_moderator %}
+ {% if user == course.creator %}
<small><a href="{% url 'yaksh:hide_post' course.id post.uid %}" class="pull-right fa fa-trash"></i></a></small>
{% endif %}
</td>
diff --git a/yaksh/templates/yaksh/lessons_forum.html b/yaksh/templates/yaksh/lessons_forum.html
index ee65074..f8d1912 100644
--- a/yaksh/templates/yaksh/lessons_forum.html
+++ b/yaksh/templates/yaksh/lessons_forum.html
@@ -55,7 +55,7 @@
{% endwith %}
</td>
<td>
- {% if user.profile.is_moderator %}
+ {% if user == course.creator %}
<small><a href="{% url 'yaksh:hide_post' course.id post.uid %}" class="pull-right fa fa-trash"></i></a></small>
{% endif %}
</td>
diff --git a/yaksh/templates/yaksh/post_comments.html b/yaksh/templates/yaksh/post_comments.html
index 6051b6e..4038afb 100644
--- a/yaksh/templates/yaksh/post_comments.html
+++ b/yaksh/templates/yaksh/post_comments.html
@@ -11,6 +11,20 @@
</a>
<br>
<br>
+ {% if messages %}
+ <div>
+ <center>
+ {% for message in messages %}
+ <div class="alert alert-dismissible alert-{{ message.tags }}">
+ <button type="button" class="close" data-dismiss="alert">
+ <i class="fa fa-close"></i>
+ </button>
+ <strong>{{ message }}</strong>
+ </div>
+ {% endfor %}
+ </center>
+ </div>
+ {% endif %}
<div class="card mb-2 border-dark">
<div class="card-header text-white bg-dark py-2 px-3">
{{post.title}}
@@ -18,7 +32,7 @@
<small>
<strong>{{post.creator.username}}</strong>
{{post.created_at}}
- {% if user.profile.is_moderator %}<a href="{% url 'yaksh:hide_post' post.target.id post.uid %}" class="pull-right fa fa-trash"></a>{% endif %}
+ {% if user == course.creator %}<a href="{% url 'yaksh:hide_post' post.target.id post.uid %}" class="pull-right fa fa-trash"></a>{% endif %}
</small>
</div>
@@ -41,7 +55,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.target.id comment.uid %}" class="fa fa-trash"></a>{% endif %}</small>
+ <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>
</div>
</div>
<p class="card-text description">{{comment.description}}</p>
diff --git a/yaksh/templates/yaksh/show_video.html b/yaksh/templates/yaksh/show_video.html
index ef6f459..022ba9c 100644
--- a/yaksh/templates/yaksh/show_video.html
+++ b/yaksh/templates/yaksh/show_video.html
@@ -227,6 +227,19 @@
</div>
</div>
{% endif %}
+ {% if state == 'lesson' %}
+ <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>
+ {% endif %}
+ <br>
{% if comments %}
{% for comment in comments %}
<div class="card mb-2">
@@ -235,9 +248,11 @@
<div class="col-6">
<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' 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>
@@ -251,18 +266,6 @@
</div>
{% endfor %}
{% endif %}
- {% if state == 'lesson' %}
- <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>
- {% endif %}
</div>
</div>
<div id="dialog"></div>