- {% post_view_truncated thread.op True %}
+ {% post_view_truncated thread.op True moderator %}
{% if thread.last_replies.exists %}
{% if thread.skipped_replies %}
@@ -79,7 +79,7 @@
{% endif %}
{% for post in thread.last_replies %}
- {% post_view_truncated post %}
+ {% post_view_truncated post moderator=moderator%}
{% endfor %}
{% endif %}
diff --git a/boards/templates/boards/thread.html b/boards/templates/boards/thread.html
--- a/boards/templates/boards/thread.html
+++ b/boards/templates/boards/thread.html
@@ -31,7 +31,7 @@
{% endif %}
{% for post in posts %}
- {% post_view post %}
+ {% post_view post moderator=moderator %}
{% endfor %}
{% endcache %}
diff --git a/boards/templatetags/board.py b/boards/templatetags/board.py
--- a/boards/templatetags/board.py
+++ b/boards/templatetags/board.py
@@ -50,31 +50,27 @@ def image_actions(*args, **kwargs):
@register.inclusion_tag('boards/post.html', name='post_view')
-def post_view(*args, **kwargs):
+def post_view(post, moderator=False):
"""
Get post
"""
- post = args[0]
-
- return { 'post': post }
+ return {
+ 'post': post,
+ 'moderator': moderator,
+ }
@register.inclusion_tag('boards/post.html', name='post_view_truncated')
-def post_view_truncated(*args, **kwargs):
+def post_view_truncated(post, need_open_link=False, moderator=False):
"""
Get post with truncated text. If the 'open' or 'reply' link is needed, pass
the second parameter as True.
"""
- post = args[0]
- if len(args) > 1:
- need_open_link = args[1]
- else:
- need_open_link = False
-
return {
'post': post,
'truncated': True,
- 'need_open_link': need_open_link
+ 'need_open_link': need_open_link,
+ 'moderator': moderator,
}
\ No newline at end of file