Show More
@@ -18,6 +18,7 b' class TagAdmin(admin.ModelAdmin):' | |||
|
18 | 18 | class UserAdmin(admin.ModelAdmin): |
|
19 | 19 | |
|
20 | 20 | list_display = ('user_id', 'rank') |
|
21 | search_fields = ('user_id',) | |
|
21 | 22 | |
|
22 | 23 | admin.site.register(Post, PostAdmin) |
|
23 | 24 | admin.site.register(Tag, TagAdmin) |
@@ -68,7 +68,7 b'' | |||
|
68 | 68 | {% for thread in threads %} |
|
69 | 69 | {% cache 600 thread_short thread.thread.id thread.thread.last_edit_time moderator LANGUAGE_CODE %} |
|
70 | 70 | <div class="thread"> |
|
71 | {% post_view_truncated thread.op True %} | |
|
71 | {% post_view_truncated thread.op True moderator %} | |
|
72 | 72 | {% if thread.last_replies.exists %} |
|
73 | 73 | {% if thread.skipped_replies %} |
|
74 | 74 | <div class="skipped_replies"> |
@@ -79,7 +79,7 b'' | |||
|
79 | 79 | {% endif %} |
|
80 | 80 | <div class="last-replies"> |
|
81 | 81 | {% for post in thread.last_replies %} |
|
82 | {% post_view_truncated post %} | |
|
82 | {% post_view_truncated post moderator=moderator%} | |
|
83 | 83 | {% endfor %} |
|
84 | 84 | </div> |
|
85 | 85 | {% endif %} |
@@ -31,7 +31,7 b'' | |||
|
31 | 31 | {% endif %} |
|
32 | 32 | <div class="thread"> |
|
33 | 33 | {% for post in posts %} |
|
34 | {% post_view post %} | |
|
34 | {% post_view post moderator=moderator %} | |
|
35 | 35 | {% endfor %} |
|
36 | 36 | </div> |
|
37 | 37 | {% endcache %} |
@@ -50,31 +50,27 b' def image_actions(*args, **kwargs):' | |||
|
50 | 50 | |
|
51 | 51 | |
|
52 | 52 | @register.inclusion_tag('boards/post.html', name='post_view') |
|
53 |
def post_view( |
|
|
53 | def post_view(post, moderator=False): | |
|
54 | 54 | """ |
|
55 | 55 | Get post |
|
56 | 56 | """ |
|
57 | 57 | |
|
58 | post = args[0] | |
|
59 | ||
|
60 | return { 'post': post } | |
|
58 | return { | |
|
59 | 'post': post, | |
|
60 | 'moderator': moderator, | |
|
61 | } | |
|
61 | 62 | |
|
62 | 63 | |
|
63 | 64 | @register.inclusion_tag('boards/post.html', name='post_view_truncated') |
|
64 |
def post_view_truncated( |
|
|
65 | def post_view_truncated(post, need_open_link=False, moderator=False): | |
|
65 | 66 | """ |
|
66 | 67 | Get post with truncated text. If the 'open' or 'reply' link is needed, pass |
|
67 | 68 | the second parameter as True. |
|
68 | 69 | """ |
|
69 | 70 | |
|
70 | post = args[0] | |
|
71 | if len(args) > 1: | |
|
72 | need_open_link = args[1] | |
|
73 | else: | |
|
74 | need_open_link = False | |
|
75 | ||
|
76 | 71 | return { |
|
77 | 72 | 'post': post, |
|
78 | 73 | 'truncated': True, |
|
79 | 'need_open_link': need_open_link | |
|
74 | 'need_open_link': need_open_link, | |
|
75 | 'moderator': moderator, | |
|
80 | 76 | } No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now