Commit 0d97fbb7 by E. Kolpakov Committed by Zia Fazal

Switched to using cached_has_permission in templates, rather than having those…

Switched to using cached_has_permission in templates, rather than having those permissions in template context
parent 47c8bf41
<%! from django.utils.translation import ugettext as _ %>
<%! from django_comment_client.permissions import has_permission %>
<%! from django_comment_client.permissions import cached_has_permission %>
<%inherit file="../courseware/course_navigation.html" />
<%block name="extratabs">
% if has_permission(user, 'create_thread', course.id):
% if cached_has_permission(user, 'create_thread', course.id):
<li class="right"><a href="#" class="new-post-btn" role="button"><span class="icon fa fa-edit new-post-icon"></span>${_("New Post")}</a></li>
% endif
</%block>
<%! from django.utils.translation import ugettext as _ %>
<%! from django_comment_client.permissions import has_permission %>
<%! from django_comment_client.permissions import cached_has_permission %>
<%include file="_underscore_templates.html" />
<%namespace name='static' file='../static_content.html'/>
......@@ -14,7 +14,7 @@
<div class="discussion-module" data-discussion-id="${discussion_id | h}">
<a class="discussion-show control-button" href="javascript:void(0)" data-discussion-id="${discussion_id | h}" role="button"><span class="show-hide-discussion-icon"></span><span class="button-text">${_("Show Discussion")}</span></a>
% if has_permission(user, 'create_thread', course.id):
% if cached_has_permission(user, 'create_thread', course.id):
<a href="#" class="new-post-btn" role="button"><span class="icon fa fa-edit new-post-icon"></span>${_("New Post")}</a>
% endif
</div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment