summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
authorPalaparthy Adityachandra2020-10-29 10:34:25 +0530
committerGitHub2020-10-29 10:34:25 +0530
commit9442104635daa5bee6952bbe2c7905b319373946 (patch)
treee1687e21384714f5271bc714ef3cc31e84d57e6a /yaksh
parent430c8d1480d897e9fc0dc328bad173642d0a2946 (diff)
parente6df6090835c3368b2623189fa6919ebe2270e9e (diff)
downloadonline_test-9442104635daa5bee6952bbe2c7905b319373946.tar.gz
online_test-9442104635daa5bee6952bbe2c7905b319373946.tar.bz2
online_test-9442104635daa5bee6952bbe2c7905b319373946.zip
Merge pull request #781 from ankitjavalkar/fix-perm-forum
Fix permissions to delete posts/comments in forum
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/templates/yaksh/course_forum.html2
-rw-r--r--yaksh/templates/yaksh/lessons_forum.html2
-rw-r--r--yaksh/templates/yaksh/post_comments.html4
3 files changed, 4 insertions, 4 deletions
diff --git a/yaksh/templates/yaksh/course_forum.html b/yaksh/templates/yaksh/course_forum.html
index acd6861..b98688b 100644
--- a/yaksh/templates/yaksh/course_forum.html
+++ b/yaksh/templates/yaksh/course_forum.html
@@ -129,7 +129,7 @@
{% endwith %}
</td>
<td>
- {% if user == course.creator %}
+ {% if user == course.creator or user in course.get_teachers %}
<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 250536d..58fb360 100644
--- a/yaksh/templates/yaksh/lessons_forum.html
+++ b/yaksh/templates/yaksh/lessons_forum.html
@@ -61,7 +61,7 @@
{% endwith %}
</td>
<td>
- {% if user == course.creator %}
+ {% if user == course.creator or user in course.get_teachers %}
<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 bc452e0..70aac47 100644
--- a/yaksh/templates/yaksh/post_comments.html
+++ b/yaksh/templates/yaksh/post_comments.html
@@ -38,7 +38,7 @@
{% 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 %}
+ {% if user == course.creator or user in course.get_teachers %}<a href="{% url 'yaksh:hide_post' post.target.id post.uid %}" class="pull-right fa fa-trash"></a>{% endif %}
</small>
</div>
@@ -77,7 +77,7 @@
</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>
+ <small class="text-muted">{{comment.created_at}} {% if user == course.creator or user in course.get_teachers %} <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|safe}}</p>