Show More
@@ -1,166 +1,166 b'' | |||||
1 | {% load i18n %} |
|
1 | {% load i18n %} | |
2 | {% load board %} |
|
2 | {% load board %} | |
3 |
|
3 | |||
4 | {% get_current_language as LANGUAGE_CODE %} |
|
4 | {% get_current_language as LANGUAGE_CODE %} | |
5 |
|
5 | |||
6 | {% autoescape off %} |
|
6 | {% autoescape off %} | |
7 | <div class="{{ css_class }}" id="{{ post.id }}" data-uid="{{ post.uid }}" {% if tree_depth %}style="margin-left: {{ tree_depth }}em;"{% endif %}> |
|
7 | <div class="{{ css_class }}" id="{{ post.id }}" data-uid="{{ post.uid }}" {% if tree_depth %}style="margin-left: {{ tree_depth }}em;"{% endif %}> | |
8 | <div class="post-info"> |
|
8 | <div class="post-info"> | |
9 | <a class="post_id" href="{{ post.get_absolute_url }}">#{{ post.id }}</a> |
|
9 | <a class="post_id" href="{{ post.get_absolute_url }}">#{{ post.id }}</a> | |
10 | {% if is_opening and thread.is_stickerpack %} |
|
10 | {% if is_opening and thread.is_stickerpack %} | |
11 | 📷 |
|
11 | 📷 | |
12 | {% endif %} |
|
12 | {% endif %} | |
13 | <span class="title">{{ post.title }}</span> |
|
13 | <span class="title">{{ post.title|escape }}</span> | |
14 | {% if perms.boards.change_post and post.has_ip %} |
|
14 | {% if perms.boards.change_post and post.has_ip %} | |
15 | <span class="pub_time" style="border-bottom: solid 2px #{{ post.get_ip_color }};" title="{{ post.poster_ip }}"> |
|
15 | <span class="pub_time" style="border-bottom: solid 2px #{{ post.get_ip_color }};" title="{{ post.poster_ip }}"> | |
16 | {% else %} |
|
16 | {% else %} | |
17 | <span class="pub_time"> |
|
17 | <span class="pub_time"> | |
18 | {% endif %} |
|
18 | {% endif %} | |
19 | <time datetime="{{ post.pub_time|date:'c' }}">{{ post.pub_time }}</time></span> |
|
19 | <time datetime="{{ post.pub_time|date:'c' }}">{{ post.pub_time }}</time></span> | |
20 | {% if post.tripcode %} |
|
20 | {% if post.tripcode %} | |
21 | / |
|
21 | / | |
22 | {% with tripcode=post.get_tripcode %} |
|
22 | {% with tripcode=post.get_tripcode %} | |
23 | <a href="{% url 'feed' %}?tripcode={{ tripcode.get_full_text }}" |
|
23 | <a href="{% url 'feed' %}?tripcode={{ tripcode.get_full_text }}" | |
24 | class="tripcode" title="{{ tripcode.get_full_text }}" |
|
24 | class="tripcode" title="{{ tripcode.get_full_text }}" | |
25 | style="border: solid 2px #{{ tripcode.get_color }}; border-left: solid 1ex #{{ tripcode.get_color }};">{{ tripcode.get_short_text }}</a> |
|
25 | style="border: solid 2px #{{ tripcode.get_color }}; border-left: solid 1ex #{{ tripcode.get_color }};">{{ tripcode.get_short_text }}</a> | |
26 | {% endwith %} |
|
26 | {% endwith %} | |
27 | {% endif %} |
|
27 | {% endif %} | |
28 | {% comment %} |
|
28 | {% comment %} | |
29 | Thread death time needs to be shown only if the thread is alredy archived |
|
29 | Thread death time needs to be shown only if the thread is alredy archived | |
30 | and this is an opening post (thread death time) or a post for popup |
|
30 | and this is an opening post (thread death time) or a post for popup | |
31 | (we don't see OP here so we show the death time in the post itself). |
|
31 | (we don't see OP here so we show the death time in the post itself). | |
32 | {% endcomment %} |
|
32 | {% endcomment %} | |
33 | {% if is_opening and thread.is_archived %} |
|
33 | {% if is_opening and thread.is_archived %} | |
34 | — <time datetime="{{ thread.bump_time|date:'c' }}">{{ thread.bump_time }}</time> |
|
34 | — <time datetime="{{ thread.bump_time|date:'c' }}">{{ thread.bump_time }}</time> | |
35 | {% endif %} |
|
35 | {% endif %} | |
36 | {% if is_opening %} |
|
36 | {% if is_opening %} | |
37 | {% if need_open_link %} |
|
37 | {% if need_open_link %} | |
38 | {% if thread.is_archived %} |
|
38 | {% if thread.is_archived %} | |
39 | <a class="link" href="{% url 'thread' post.id %}">{% trans "Open" %}</a> |
|
39 | <a class="link" href="{% url 'thread' post.id %}">{% trans "Open" %}</a> | |
40 | {% else %} |
|
40 | {% else %} | |
41 | <a class="link" href="{% url 'thread' post.id %}#form">{% trans "Reply" %}</a> |
|
41 | <a class="link" href="{% url 'thread' post.id %}#form">{% trans "Reply" %}</a> | |
42 | {% endif %} |
|
42 | {% endif %} | |
43 | {% endif %} |
|
43 | {% endif %} | |
44 | {% else %} |
|
44 | {% else %} | |
45 | {% if need_op_data %} |
|
45 | {% if need_op_data %} | |
46 | {% with thread.get_opening_post as op %} |
|
46 | {% with thread.get_opening_post as op %} | |
47 | {% trans " in " %}{{ op.get_link_view|safe }} <span class="title">{{ op.get_title_or_text }}</span> |
|
47 | {% trans " in " %}{{ op.get_link_view|safe }} <span class="title">{{ op.get_title_or_text }}</span> | |
48 | {% endwith %} |
|
48 | {% endwith %} | |
49 | {% endif %} |
|
49 | {% endif %} | |
50 | {% endif %} |
|
50 | {% endif %} | |
51 | {% if reply_link and not thread.is_archived %} |
|
51 | {% if reply_link and not thread.is_archived %} | |
52 | <a href="#form" onclick="addQuickReply('{{ post.id }}'); return false;">{% trans 'Reply' %}</a> |
|
52 | <a href="#form" onclick="addQuickReply('{{ post.id }}'); return false;">{% trans 'Reply' %}</a> | |
53 | {% endif %} |
|
53 | {% endif %} | |
54 |
|
54 | |||
55 | {% if perms.boards.change_post or perms.boards.delete_post or perms.boards.change_thread or perms_boards.delete_thread %} |
|
55 | {% if perms.boards.change_post or perms.boards.delete_post or perms.boards.change_thread or perms_boards.delete_thread %} | |
56 | <a class="moderation-menu" href="#">🔒</a> |
|
56 | <a class="moderation-menu" href="#">🔒</a> | |
57 | <script> |
|
57 | <script> | |
58 | $.contextMenu({ |
|
58 | $.contextMenu({ | |
59 | selector: '#{{ post.id }} .moderation-menu', |
|
59 | selector: '#{{ post.id }} .moderation-menu', | |
60 | trigger: 'left', |
|
60 | trigger: 'left', | |
61 | build: function($trigger, e) { |
|
61 | build: function($trigger, e) { | |
62 | return { |
|
62 | return { | |
63 | items: { |
|
63 | items: { | |
64 | edit: { |
|
64 | edit: { | |
65 | name: '{% trans "Edit" %}', |
|
65 | name: '{% trans "Edit" %}', | |
66 | callback: function(key, opt) { |
|
66 | callback: function(key, opt) { | |
67 | window.location = '{% url 'admin:boards_post_change' post.id %}'; |
|
67 | window.location = '{% url 'admin:boards_post_change' post.id %}'; | |
68 | }, |
|
68 | }, | |
69 | visible: {% if perms.boards.change_post %}true{% else %}false{% endif %} |
|
69 | visible: {% if perms.boards.change_post %}true{% else %}false{% endif %} | |
70 | }, |
|
70 | }, | |
71 | deletePost: { |
|
71 | deletePost: { | |
72 | name: '{% trans "Delete post" %}', |
|
72 | name: '{% trans "Delete post" %}', | |
73 | callback: function(key, opt) { |
|
73 | callback: function(key, opt) { | |
74 | window.location = '{% url 'admin:boards_post_delete' post.id %}'; |
|
74 | window.location = '{% url 'admin:boards_post_delete' post.id %}'; | |
75 | }, |
|
75 | }, | |
76 | visible: {% if not is_opening and perms.boards.delete_post %}true{% else %}false{% endif %} |
|
76 | visible: {% if not is_opening and perms.boards.delete_post %}true{% else %}false{% endif %} | |
77 | }, |
|
77 | }, | |
78 | editThread: { |
|
78 | editThread: { | |
79 | name: '{% trans "Edit thread" %}', |
|
79 | name: '{% trans "Edit thread" %}', | |
80 | callback: function(key, opt) { |
|
80 | callback: function(key, opt) { | |
81 | window.location = '{% url 'admin:boards_thread_change' thread.id %}'; |
|
81 | window.location = '{% url 'admin:boards_thread_change' thread.id %}'; | |
82 | }, |
|
82 | }, | |
83 | visible: {% if is_opening and perms.boards.change_thread %}true{% else %}false{% endif %} |
|
83 | visible: {% if is_opening and perms.boards.change_thread %}true{% else %}false{% endif %} | |
84 | }, |
|
84 | }, | |
85 | deleteThread: { |
|
85 | deleteThread: { | |
86 | name: '{% trans "Delete thread" %}', |
|
86 | name: '{% trans "Delete thread" %}', | |
87 | callback: function(key, opt) { |
|
87 | callback: function(key, opt) { | |
88 | window.location = '{% url 'admin:boards_thread_delete' thread.id %}'; |
|
88 | window.location = '{% url 'admin:boards_thread_delete' thread.id %}'; | |
89 | }, |
|
89 | }, | |
90 | visible: {% if is_opening and perms.boards.delete_thread %}true{% else %}false{% endif %} |
|
90 | visible: {% if is_opening and perms.boards.delete_thread %}true{% else %}false{% endif %} | |
91 | }, |
|
91 | }, | |
92 | findByIp: { |
|
92 | findByIp: { | |
93 | name: 'IP = {{ post.poster_ip }}', |
|
93 | name: 'IP = {{ post.poster_ip }}', | |
94 | callback: function(key, opt) { |
|
94 | callback: function(key, opt) { | |
95 | window.location = '{% url "feed" %}?ip={{ post.poster_ip }}'; |
|
95 | window.location = '{% url "feed" %}?ip={{ post.poster_ip }}'; | |
96 | }, |
|
96 | }, | |
97 | visible: {% if post.has_ip %}true{% else %}false{% endif %} |
|
97 | visible: {% if post.has_ip %}true{% else %}false{% endif %} | |
98 | }, |
|
98 | }, | |
99 | raw: { |
|
99 | raw: { | |
100 | name: 'RAW', |
|
100 | name: 'RAW', | |
101 | callback: function(key, opt) { |
|
101 | callback: function(key, opt) { | |
102 | window.location = '{% url 'post_sync_data' post.id %}'; |
|
102 | window.location = '{% url 'post_sync_data' post.id %}'; | |
103 | }, |
|
103 | }, | |
104 | visible: {% if post.global_id_id %}true{% else %}false{% endif %} |
|
104 | visible: {% if post.global_id_id %}true{% else %}false{% endif %} | |
105 | }, |
|
105 | }, | |
106 | ban: { |
|
106 | ban: { | |
107 | name: '{% trans "Ban" %}', |
|
107 | name: '{% trans "Ban" %}', | |
108 | callback: function(key, opt) { |
|
108 | callback: function(key, opt) { | |
109 | if (confirm('{% trans "Are you sure?" %}')) { |
|
109 | if (confirm('{% trans "Are you sure?" %}')) { | |
110 | window.location = '{% url 'utils' %}?method=ban&post_id={{ post.id }}'; |
|
110 | window.location = '{% url 'utils' %}?method=ban&post_id={{ post.id }}'; | |
111 | } |
|
111 | } | |
112 | }, |
|
112 | }, | |
113 | visible: {% if post.has_ip %}true{% else %}false{% endif %} |
|
113 | visible: {% if post.has_ip %}true{% else %}false{% endif %} | |
114 | }, |
|
114 | }, | |
115 | banAndDelete: { |
|
115 | banAndDelete: { | |
116 | name: '{% trans "Ban and delete" %}', |
|
116 | name: '{% trans "Ban and delete" %}', | |
117 | callback: function(key, opt) { |
|
117 | callback: function(key, opt) { | |
118 | if (confirm('{% trans "Are you sure?" %}')) { |
|
118 | if (confirm('{% trans "Are you sure?" %}')) { | |
119 | window.location = '{% url 'utils' %}?method=ban_and_delete&post_id={{ post.id }}'; |
|
119 | window.location = '{% url 'utils' %}?method=ban_and_delete&post_id={{ post.id }}'; | |
120 | } |
|
120 | } | |
121 | }, |
|
121 | }, | |
122 | visible: {% if post.has_ip %}true{% else %}false{% endif %} |
|
122 | visible: {% if post.has_ip %}true{% else %}false{% endif %} | |
123 | } |
|
123 | } | |
124 | } |
|
124 | } | |
125 | }; |
|
125 | }; | |
126 | } |
|
126 | } | |
127 | }); |
|
127 | }); | |
128 | </script> |
|
128 | </script> | |
129 | {% endif %} |
|
129 | {% endif %} | |
130 | </div> |
|
130 | </div> | |
131 | {% for file in post.attachments.all %} |
|
131 | {% for file in post.attachments.all %} | |
132 | {{ file.get_view|safe }} |
|
132 | {{ file.get_view|safe }} | |
133 | {% endfor %} |
|
133 | {% endfor %} | |
134 | {% comment %} |
|
134 | {% comment %} | |
135 | Post message (text) |
|
135 | Post message (text) | |
136 | {% endcomment %} |
|
136 | {% endcomment %} | |
137 | <div class="message"> |
|
137 | <div class="message"> | |
138 | {% if truncated %} |
|
138 | {% if truncated %} | |
139 | {{ post.get_text|truncatewords_html:50|truncatenewlines_html:3|safe }} |
|
139 | {{ post.get_text|truncatewords_html:50|truncatenewlines_html:3|safe }} | |
140 | {% else %} |
|
140 | {% else %} | |
141 | {{ post.get_text|safe }} |
|
141 | {{ post.get_text|safe }} | |
142 | {% endif %} |
|
142 | {% endif %} | |
143 | </div> |
|
143 | </div> | |
144 | {% if post.is_referenced and not mode_tree %} |
|
144 | {% if post.is_referenced and not mode_tree %} | |
145 | <div class="refmap"> |
|
145 | <div class="refmap"> | |
146 | {% trans "Replies" %}: {{ post.refmap|safe }} |
|
146 | {% trans "Replies" %}: {{ post.refmap|safe }} | |
147 | </div> |
|
147 | </div> | |
148 | {% endif %} |
|
148 | {% endif %} | |
149 | {% comment %} |
|
149 | {% comment %} | |
150 | Thread metadata: counters, tags etc |
|
150 | Thread metadata: counters, tags etc | |
151 | {% endcomment %} |
|
151 | {% endcomment %} | |
152 | {% if is_opening %} |
|
152 | {% if is_opening %} | |
153 | <div class="metadata"> |
|
153 | <div class="metadata"> | |
154 | {% if need_open_link %} |
|
154 | {% if need_open_link %} | |
155 | ♥ {{ thread.get_reply_count }} |
|
155 | ♥ {{ thread.get_reply_count }} | |
156 | ❄ {{ thread.get_images_count }} |
|
156 | ❄ {{ thread.get_images_count }} | |
157 | <a href="{% url 'thread_gallery' post.id %}">G</a> |
|
157 | <a href="{% url 'thread_gallery' post.id %}">G</a> | |
158 | <a href="{% url 'thread_tree' post.id %}">T</a> |
|
158 | <a href="{% url 'thread_tree' post.id %}">T</a> | |
159 | {% endif %} |
|
159 | {% endif %} | |
160 | <span class="tags"> |
|
160 | <span class="tags"> | |
161 | {{ thread.get_tag_url_list|safe }} |
|
161 | {{ thread.get_tag_url_list|safe }} | |
162 | </span> |
|
162 | </span> | |
163 | </div> |
|
163 | </div> | |
164 | {% endif %} |
|
164 | {% endif %} | |
165 | </div> |
|
165 | </div> | |
166 | {% endautoescape %} No newline at end of file |
|
166 | {% endautoescape %} |
General Comments 0
You need to be logged in to leave comments.
Login now