##// END OF EJS Templates
Do not pass over perms variable manually to the post template. Fixed thread...
neko259 -
r1390:1252678f default
parent child Browse files
Show More
@@ -44,7 +44,6 b" PARAMETER_DIFF_TYPE = 'type'"
44 PARAMETER_CSS_CLASS = 'css_class'
44 PARAMETER_CSS_CLASS = 'css_class'
45 PARAMETER_THREAD = 'thread'
45 PARAMETER_THREAD = 'thread'
46 PARAMETER_IS_OPENING = 'is_opening'
46 PARAMETER_IS_OPENING = 'is_opening'
47 PARAMETER_MODERATOR = 'moderator'
48 PARAMETER_POST = 'post'
47 PARAMETER_POST = 'post'
49 PARAMETER_OP_ID = 'opening_post_id'
48 PARAMETER_OP_ID = 'opening_post_id'
50 PARAMETER_NEED_OPEN_LINK = 'need_open_link'
49 PARAMETER_NEED_OPEN_LINK = 'need_open_link'
@@ -1,3 +1,5 b''
1 from django.contrib.auth.context_processors import PermWrapper
2
1 from boards import utils
3 from boards import utils
2
4
3
5
@@ -24,7 +26,7 b' class HtmlExporter(Exporter):'
24 reply_link = True
26 reply_link = True
25
27
26 return post.get_view(truncated=truncated, reply_link=reply_link,
28 return post.get_view(truncated=truncated, reply_link=reply_link,
27 moderator=utils.is_moderator(request))
29 perms=PermWrapper(request.user))
28
30
29
31
30 class JsonExporter(Exporter):
32 class JsonExporter(Exporter):
@@ -99,7 +99,7 b''
99
99
100 {% for thread in threads %}
100 {% for thread in threads %}
101 <div class="thread">
101 <div class="thread">
102 {% post_view thread.get_opening_post perms=perms thread=thread truncated=True need_open_link=True %}
102 {% post_view thread.get_opening_post thread=thread truncated=True need_open_link=True %}
103 {% if not thread.archived %}
103 {% if not thread.archived %}
104 {% with last_replies=thread.get_last_replies %}
104 {% with last_replies=thread.get_last_replies %}
105 {% if last_replies %}
105 {% if last_replies %}
@@ -114,7 +114,7 b''
114 {% endwith %}
114 {% endwith %}
115 <div class="last-replies">
115 <div class="last-replies">
116 {% for post in last_replies %}
116 {% for post in last_replies %}
117 {% post_view post perms=perms truncated=True %}
117 {% post_view post truncated=True %}
118 {% endfor %}
118 {% endfor %}
119 </div>
119 </div>
120 {% endif %}
120 {% endif %}
@@ -34,7 +34,7 b''
34
34
35 <div class="thread">
35 <div class="thread">
36 {% for post in thread.get_replies %}
36 {% for post in thread.get_replies %}
37 {% post_view post perms=perms reply_link=True %}
37 {% post_view post reply_link=True %}
38 {% endfor %}
38 {% endfor %}
39 </div>
39 </div>
40
40
@@ -39,8 +39,9 b' def image_actions(*args, **kwargs):'
39 action['link'] % image_link, action['name']) for action in actions])
39 action['link'] % image_link, action['name']) for action in actions])
40
40
41
41
42 @register.simple_tag(name='post_view')
42 @register.simple_tag(name='post_view', takes_context=True)
43 def post_view(post, *args, **kwargs):
43 def post_view(context, post, *args, **kwargs):
44 kwargs['perms'] = context['perms']
44 return post.get_view(*args, **kwargs)
45 return post.get_view(*args, **kwargs)
45
46
46 @register.simple_tag(name='page_url')
47 @register.simple_tag(name='page_url')
General Comments 0
You need to be logged in to leave comments. Login now