##// END OF EJS Templates
Rendered post should be considered safe
neko259 -
r1952:4c766e32 default
parent child Browse files
Show More
@@ -1,210 +1,210 b''
1 {% extends "boards/paginated.html" %}
1 {% extends "boards/paginated.html" %}
2
2
3 {% load i18n %}
3 {% load i18n %}
4 {% load board %}
4 {% load board %}
5 {% load static %}
5 {% load static %}
6 {% load tz %}
6 {% load tz %}
7
7
8 {% block head %}
8 {% block head %}
9 <meta name="robots" content="noindex">
9 <meta name="robots" content="noindex">
10
10
11 {% if tag %}
11 {% if tag %}
12 <title>{{ tag.get_name }} - {{ site_name }}</title>
12 <title>{{ tag.get_name }} - {{ site_name }}</title>
13 {% else %}
13 {% else %}
14 <title>{{ site_name }}</title>
14 <title>{{ site_name }}</title>
15 {% endif %}
15 {% endif %}
16
16
17 {% if prev_page_link %}
17 {% if prev_page_link %}
18 <link rel="prev" href="{{ prev_page_link }}" />
18 <link rel="prev" href="{{ prev_page_link|safe }}" />
19 {% endif %}
19 {% endif %}
20 {% if next_page_link %}
20 {% if next_page_link %}
21 <link rel="next" href="{{ next_page_link }}" />
21 <link rel="next" href="{{ next_page_link|safe }}" />
22 {% endif %}
22 {% endif %}
23
23
24 {% endblock %}
24 {% endblock %}
25
25
26 {% block content %}
26 {% block content %}
27
27
28 {% get_current_language as LANGUAGE_CODE %}
28 {% get_current_language as LANGUAGE_CODE %}
29 {% get_current_timezone as TIME_ZONE %}
29 {% get_current_timezone as TIME_ZONE %}
30
30
31 {% for banner in banners %}
31 {% for banner in banners %}
32 <div class="post">
32 <div class="post">
33 <div class="title">{{ banner.title }}</div>
33 <div class="title">{{ banner.title }}</div>
34 <div>{{ banner.get_text|safe }}</div>
34 <div>{{ banner.get_text|safe }}</div>
35 <div>{% trans 'Details' %}: <a href="{{ banner.post.get_absolute_url }}">>>{{ banner.post.id }}</a></div>
35 <div>{% trans 'Details' %}: <a href="{{ banner.post.get_absolute_url|safe }}">>>{{ banner.post.id }}</a></div>
36 </div>
36 </div>
37 {% endfor %}
37 {% endfor %}
38
38
39 {% if tag %}
39 {% if tag %}
40 <div class="tag_info" style="border-bottom: solid .5ex #{{ tag.get_color }}">
40 <div class="tag_info" style="border-bottom: solid .5ex #{{ tag.get_color }}">
41 {% if random_image_post %}
41 {% if random_image_post %}
42 <div class="tag-image">
42 <div class="tag-image">
43 {% with image=random_image_post.get_first_image %}
43 {% with image=random_image_post.get_first_image %}
44 <a href="{{ random_image_post.get_absolute_url }}"><img
44 <a href="{{ random_image_post.get_absolute_url|safe }}"><img
45 src="{{ image.get_thumb_url }}"
45 src="{{ image.get_thumb_url|safe }}"
46 width="{{ image.get_preview_size.0 }}"
46 width="{{ image.get_preview_size.0 }}"
47 height="{{ image.get_preview_size.1 }}"
47 height="{{ image.get_preview_size.1 }}"
48 alt="{{ random_image_post.id }}"/></a>
48 alt="{{ random_image_post.id }}"/></a>
49 {% endwith %}
49 {% endwith %}
50 </div>
50 </div>
51 {% endif %}
51 {% endif %}
52 <div class="tag-text-data">
52 <div class="tag-text-data">
53 <h2>
53 <h2>
54 /{{ tag.get_view|safe }}/
54 /{{ tag.get_view|safe }}/
55 </h2>
55 </h2>
56 {% if perms.change_tag %}
56 {% if perms.change_tag %}
57 <div class="moderator_info"><a href="{% url 'admin:boards_tag_change' tag.id %}">{% trans 'Edit tag' %}</a></div>
57 <div class="moderator_info"><a href="{% url 'admin:boards_tag_change' tag.id %}">{% trans 'Edit tag' %}</a></div>
58 {% endif %}
58 {% endif %}
59 <p>
59 <p>
60 <form action="{% url 'tag' tag.get_name %}" method="post" class="post-button-form">
60 <form action="{% url 'tag' tag.get_name %}" method="post" class="post-button-form">
61 {% if is_favorite %}
61 {% if is_favorite %}
62 <button name="method" value="unsubscribe" class="fav">★ {% trans "Remove from favorites" %}</button>
62 <button name="method" value="unsubscribe" class="fav">★ {% trans "Remove from favorites" %}</button>
63 {% else %}
63 {% else %}
64 <button name="method" value="subscribe" class="not_fav">★ {% trans "Add to favorites" %}</button>
64 <button name="method" value="subscribe" class="not_fav">★ {% trans "Add to favorites" %}</button>
65 {% endif %}
65 {% endif %}
66 </form>
66 </form>
67 &bull;
67 &bull;
68 <form action="{% url 'tag' tag.get_name %}" method="post" class="post-button-form">
68 <form action="{% url 'tag' tag.get_name %}" method="post" class="post-button-form">
69 {% if is_hidden %}
69 {% if is_hidden %}
70 <button name="method" value="unhide" class="fav">{% trans "Show" %}</button>
70 <button name="method" value="unhide" class="fav">{% trans "Show" %}</button>
71 {% else %}
71 {% else %}
72 <button name="method" value="hide" class="not_fav">{% trans "Hide" %}</button>
72 <button name="method" value="hide" class="not_fav">{% trans "Hide" %}</button>
73 {% endif %}
73 {% endif %}
74 </form>
74 </form>
75 &bull;
75 &bull;
76 <a href="{% url 'tag_gallery' tag.get_name %}">{% trans 'Gallery' %}</a>
76 <a href="{% url 'tag_gallery' tag.get_name %}">{% trans 'Gallery' %}</a>
77 </p>
77 </p>
78 {% if tag.get_description %}
78 {% if tag.get_description %}
79 <p>{{ tag.get_description|safe }}</p>
79 <p>{{ tag.get_description|safe }}</p>
80 {% endif %}
80 {% endif %}
81 <p>
81 <p>
82 {% with active_count=tag.get_active_thread_count bumplimit_count=tag.get_bumplimit_thread_count archived_count=tag.get_archived_thread_count %}
82 {% with active_count=tag.get_active_thread_count bumplimit_count=tag.get_bumplimit_thread_count archived_count=tag.get_archived_thread_count %}
83 {% if active_count %}
83 {% if active_count %}
84 ● {{ active_count }}&ensp;
84 ● {{ active_count }}&ensp;
85 {% endif %}
85 {% endif %}
86 {% if bumplimit_count %}
86 {% if bumplimit_count %}
87 ◍ {{ bumplimit_count }}&ensp;
87 ◍ {{ bumplimit_count }}&ensp;
88 {% endif %}
88 {% endif %}
89 {% if archived_count %}
89 {% if archived_count %}
90 ○ {{ archived_count }}&ensp;
90 ○ {{ archived_count }}&ensp;
91 {% endif %}
91 {% endif %}
92 {% endwith %}
92 {% endwith %}
93 ♥ {{ tag.get_post_count }}
93 ♥ {{ tag.get_post_count }}
94 </p>
94 </p>
95 {% if tag.get_all_parents %}
95 {% if tag.get_all_parents %}
96 <p>
96 <p>
97 {% for parent in tag.get_all_parents %}
97 {% for parent in tag.get_all_parents %}
98 {{ parent.get_view|safe }} &gt;
98 {{ parent.get_view|safe }} &gt;
99 {% endfor %}
99 {% endfor %}
100 {{ tag.get_view|safe }}
100 {{ tag.get_view|safe }}
101 </p>
101 </p>
102 {% endif %}
102 {% endif %}
103 {% if tag.get_children.all %}
103 {% if tag.get_children.all %}
104 <p>
104 <p>
105 {% trans "Subsections: " %}
105 {% trans "Subsections: " %}
106 {% for child in tag.get_children.all %}
106 {% for child in tag.get_children.all %}
107 {{ child.get_view|safe }}{% if not forloop.last%}, {% endif %}
107 {{ child.get_view|safe }}{% if not forloop.last%}, {% endif %}
108 {% endfor %}
108 {% endfor %}
109 </p>
109 </p>
110 {% endif %}
110 {% endif %}
111 </div>
111 </div>
112 </div>
112 </div>
113 {% endif %}
113 {% endif %}
114
114
115 {% if threads %}
115 {% if threads %}
116 {% if prev_page_link %}
116 {% if prev_page_link %}
117 <div class="page_link">
117 <div class="page_link">
118 <a href="{{ prev_page_link }}">&lt;&lt; {% trans "Previous page" %} &lt;&lt;</a>
118 <a href="{{ prev_page_link }}">&lt;&lt; {% trans "Previous page" %} &lt;&lt;</a>
119 </div>
119 </div>
120 {% endif %}
120 {% endif %}
121
121
122 {% for thread in threads %}
122 {% for thread in threads %}
123 <div class="thread">
123 <div class="thread">
124 {% post_view thread.get_opening_post thread=thread truncated=True need_open_link=True %}
124 {% post_view thread.get_opening_post thread=thread truncated=True need_open_link=True %}
125 {% if not thread.archived %}
125 {% if not thread.archived %}
126 {% with last_replies=thread.get_last_replies %}
126 {% with last_replies=thread.get_last_replies %}
127 {% if last_replies %}
127 {% if last_replies %}
128 {% with skipped_replies_count=thread.get_skipped_replies_count %}
128 {% with skipped_replies_count=thread.get_skipped_replies_count %}
129 {% if skipped_replies_count %}
129 {% if skipped_replies_count %}
130 <div class="skipped_replies">
130 <div class="skipped_replies">
131 <a href="{% url 'thread' thread.get_opening_post_id %}">
131 <a href="{% url 'thread' thread.get_opening_post_id %}">
132 {% blocktrans count count=skipped_replies_count %}Skipped {{ count }} reply. Open thread to see all replies.{% plural %}Skipped {{ count }} replies. Open thread to see all replies.{% endblocktrans %}
132 {% blocktrans count count=skipped_replies_count %}Skipped {{ count }} reply. Open thread to see all replies.{% plural %}Skipped {{ count }} replies. Open thread to see all replies.{% endblocktrans %}
133 </a>
133 </a>
134 </div>
134 </div>
135 {% endif %}
135 {% endif %}
136 {% endwith %}
136 {% endwith %}
137 <div class="last-replies">
137 <div class="last-replies">
138 {% for post in last_replies %}
138 {% for post in last_replies %}
139 {% post_view post truncated=True %}
139 {% post_view post truncated=True %}
140 {% endfor %}
140 {% endfor %}
141 </div>
141 </div>
142 {% endif %}
142 {% endif %}
143 {% endwith %}
143 {% endwith %}
144 {% endif %}
144 {% endif %}
145 </div>
145 </div>
146 {% endfor %}
146 {% endfor %}
147
147
148 {% if next_page_link %}
148 {% if next_page_link %}
149 <div class="page_link">
149 <div class="page_link">
150 <a href="{{ next_page_link }}">&gt;&gt; {% trans "Next page" %} &gt;&gt;</a>
150 <a href="{{ next_page_link }}">&gt;&gt; {% trans "Next page" %} &gt;&gt;</a>
151 </div>
151 </div>
152 {% endif %}
152 {% endif %}
153 {% else %}
153 {% else %}
154 <div class="post">
154 <div class="post">
155 {% trans 'No threads exist. Create the first one!' %}</div>
155 {% trans 'No threads exist. Create the first one!' %}</div>
156 {% endif %}
156 {% endif %}
157
157
158 <div class="post-form-w">
158 <div class="post-form-w">
159 <script src="{% static 'js/panel.js' %}"></script>
159 <script src="{% static 'js/panel.js' %}"></script>
160 <div class="post-form" data-hasher="{% static 'js/3party/sha256.js' %}"
160 <div class="post-form" data-hasher="{% static 'js/3party/sha256.js' %}"
161 data-pow-script="{% static 'js/proof_of_work.js' %}">
161 data-pow-script="{% static 'js/proof_of_work.js' %}">
162 <div class="form-title">{% trans "Create new thread" %}</div>
162 <div class="form-title">{% trans "Create new thread" %}</div>
163 <div class="swappable-form-full">
163 <div class="swappable-form-full">
164 <form enctype="multipart/form-data" method="post" id="form">{% csrf_token %}
164 <form enctype="multipart/form-data" method="post" id="form">{% csrf_token %}
165 {{ form.as_div }}
165 {{ form.as_div }}
166 <div class="form-submit">
166 <div class="form-submit">
167 <input type="submit" value="{% trans "Post" %}"/>
167 <input type="submit" value="{% trans "Post" %}"/>
168 <button id="preview-button" type="button" onclick="return false;">{% trans 'Preview' %}</button>
168 <button id="preview-button" type="button" onclick="return false;">{% trans 'Preview' %}</button>
169 </div>
169 </div>
170 </form>
170 </form>
171 </div>
171 </div>
172 <div>
172 <div>
173 {% trans 'Tags must be delimited by spaces. Text or image is required.' %}
173 {% trans 'Tags must be delimited by spaces. Text or image is required.' %}
174 {% with size=max_file_size|filesizeformat %}
174 {% with size=max_file_size|filesizeformat %}
175 {% blocktrans %}Max file size is {{ size }}.{% endblocktrans %}
175 {% blocktrans %}Max file size is {{ size }}.{% endblocktrans %}
176 {% endwith %}
176 {% endwith %}
177 {% blocktrans %}Max file number is {{ max_files }}.{% endblocktrans %}
177 {% blocktrans %}Max file number is {{ max_files }}.{% endblocktrans %}
178 </div>
178 </div>
179 <div id="preview-text"></div>
179 <div id="preview-text"></div>
180 <div><a href="{% url "staticpage" name="help" %}">{% trans 'Help' %}</a></div>
180 <div><a href="{% url "staticpage" name="help" %}">{% trans 'Help' %}</a></div>
181 </div>
181 </div>
182 </div>
182 </div>
183
183
184 <script src="{% static 'js/form.js' %}"></script>
184 <script src="{% static 'js/form.js' %}"></script>
185 <script src="{% static 'js/3party/jquery.blockUI.js' %}"></script>
185 <script src="{% static 'js/3party/jquery.blockUI.js' %}"></script>
186 <script src="{% static 'js/thread_create.js' %}"></script>
186 <script src="{% static 'js/thread_create.js' %}"></script>
187
187
188 {% endblock %}
188 {% endblock %}
189
189
190 {% block metapanel %}
190 {% block metapanel %}
191
191
192 <span class="metapanel">
192 <span class="metapanel">
193 {% trans "Pages:" %}
193 {% trans "Pages:" %}
194 [
194 [
195 {% with dividers=paginator.get_dividers %}
195 {% with dividers=paginator.get_dividers %}
196 {% for page in paginator.get_divided_range %}
196 {% for page in paginator.get_divided_range %}
197 {% if page in dividers %}
197 {% if page in dividers %}
198 …,
198 …,
199 {% endif %}
199 {% endif %}
200 <a
200 <a
201 {% ifequal page current_page.number %}
201 {% ifequal page current_page.number %}
202 class="current_page"
202 class="current_page"
203 {% endifequal %}
203 {% endifequal %}
204 href="{% page_url paginator page %}">{{ page }}</a>{% if not forloop.last %},{% endif %}
204 href="{% page_url paginator page %}">{{ page }}</a>{% if not forloop.last %},{% endif %}
205 {% endfor %}
205 {% endfor %}
206 {% endwith %}
206 {% endwith %}
207 ]
207 ]
208 </span>
208 </span>
209
209
210 {% endblock %}
210 {% endblock %}
@@ -1,164 +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 <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 %}>
7 <div class="post-info">
8 <div class="post-info">
8 <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>
9 {% if is_opening and thread.is_stickerpack %}
10 {% if is_opening and thread.is_stickerpack %}
10 &#128247;
11 &#128247;
11 {% endif %}
12 {% endif %}
12 <span class="title">{{ post.title }}</span>
13 <span class="title">{{ post.title }}</span>
13 {% if perms.boards.change_post and post.has_ip %}
14 {% if perms.boards.change_post and post.has_ip %}
14 <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 }}">
15 {% else %}
16 {% else %}
16 <span class="pub_time">
17 <span class="pub_time">
17 {% endif %}
18 {% endif %}
18 <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>
19 {% if post.tripcode %}
20 {% if post.tripcode %}
20 /
21 /
21 {% with tripcode=post.get_tripcode %}
22 {% with tripcode=post.get_tripcode %}
22 <a href="{% url 'feed' %}?tripcode={{ tripcode.get_full_text }}"
23 <a href="{% url 'feed' %}?tripcode={{ tripcode.get_full_text }}"
23 class="tripcode" title="{{ tripcode.get_full_text }}"
24 class="tripcode" title="{{ tripcode.get_full_text }}"
24 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>
25 {% endwith %}
26 {% endwith %}
26 {% endif %}
27 {% endif %}
27 {% comment %}
28 {% comment %}
28 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
29 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
30 (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).
31 {% endcomment %}
32 {% endcomment %}
32 {% if is_opening and thread.is_archived %}
33 {% if is_opening and thread.is_archived %}
33 <time datetime="{{ thread.bump_time|date:'c' }}">{{ thread.bump_time }}</time>
34 <time datetime="{{ thread.bump_time|date:'c' }}">{{ thread.bump_time }}</time>
34 {% endif %}
35 {% endif %}
35 {% if is_opening %}
36 {% if is_opening %}
36 {% if need_open_link %}
37 {% if need_open_link %}
37 {% if thread.is_archived %}
38 {% if thread.is_archived %}
38 <a class="link" href="{% url 'thread' post.id %}">{% trans "Open" %}</a>
39 <a class="link" href="{% url 'thread' post.id %}">{% trans "Open" %}</a>
39 {% else %}
40 {% else %}
40 <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>
41 {% endif %}
42 {% endif %}
42 {% endif %}
43 {% endif %}
43 {% else %}
44 {% else %}
44 {% if need_op_data %}
45 {% if need_op_data %}
45 {% with thread.get_opening_post as op %}
46 {% with thread.get_opening_post as op %}
46 {% 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>
47 {% endwith %}
48 {% endwith %}
48 {% endif %}
49 {% endif %}
49 {% endif %}
50 {% endif %}
50 {% if reply_link and not thread.is_archived %}
51 {% if reply_link and not thread.is_archived %}
51 <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>
52 {% endif %}
53 {% endif %}
53
54
54 {% 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 %}
55 <a class="moderation-menu" href="#">🔒</a>
56 <a class="moderation-menu" href="#">🔒</a>
56 <script>
57 <script>
57 $.contextMenu({
58 $.contextMenu({
58 selector: '#{{ post.id }} .moderation-menu',
59 selector: '#{{ post.id }} .moderation-menu',
59 trigger: 'left',
60 trigger: 'left',
60 build: function($trigger, e) {
61 build: function($trigger, e) {
61 return {
62 return {
62 items: {
63 items: {
63 edit: {
64 edit: {
64 name: '{% trans "Edit" %}',
65 name: '{% trans "Edit" %}',
65 callback: function(key, opt) {
66 callback: function(key, opt) {
66 window.location = '{% url 'admin:boards_post_change' post.id %}';
67 window.location = '{% url 'admin:boards_post_change' post.id %}';
67 },
68 },
68 visible: {% if perms.boards.change_post %}true{% else %}false{% endif %}
69 visible: {% if perms.boards.change_post %}true{% else %}false{% endif %}
69 },
70 },
70 deletePost: {
71 deletePost: {
71 name: '{% trans "Delete post" %}',
72 name: '{% trans "Delete post" %}',
72 callback: function(key, opt) {
73 callback: function(key, opt) {
73 window.location = '{% url 'admin:boards_post_delete' post.id %}';
74 window.location = '{% url 'admin:boards_post_delete' post.id %}';
74 },
75 },
75 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 %}
76 },
77 },
77 editThread: {
78 editThread: {
78 name: '{% trans "Edit thread" %}',
79 name: '{% trans "Edit thread" %}',
79 callback: function(key, opt) {
80 callback: function(key, opt) {
80 window.location = '{% url 'admin:boards_thread_change' thread.id %}';
81 window.location = '{% url 'admin:boards_thread_change' thread.id %}';
81 },
82 },
82 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 %}
83 },
84 },
84 deleteThread: {
85 deleteThread: {
85 name: '{% trans "Delete thread" %}',
86 name: '{% trans "Delete thread" %}',
86 callback: function(key, opt) {
87 callback: function(key, opt) {
87 window.location = '{% url 'admin:boards_thread_delete' thread.id %}';
88 window.location = '{% url 'admin:boards_thread_delete' thread.id %}';
88 },
89 },
89 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 %}
90 },
91 },
91 findByIp: {
92 findByIp: {
92 name: 'IP = {{ post.poster_ip }}',
93 name: 'IP = {{ post.poster_ip }}',
93 callback: function(key, opt) {
94 callback: function(key, opt) {
94 window.location = '{% url "feed" %}?ip={{ post.poster_ip }}';
95 window.location = '{% url "feed" %}?ip={{ post.poster_ip }}';
95 },
96 },
96 visible: {% if post.has_ip %}true{% else %}false{% endif %}
97 visible: {% if post.has_ip %}true{% else %}false{% endif %}
97 },
98 },
98 raw: {
99 raw: {
99 name: 'RAW',
100 name: 'RAW',
100 callback: function(key, opt) {
101 callback: function(key, opt) {
101 window.location = '{% url 'post_sync_data' post.id %}';
102 window.location = '{% url 'post_sync_data' post.id %}';
102 },
103 },
103 visible: {% if post.global_id_id %}true{% else %}false{% endif %}
104 visible: {% if post.global_id_id %}true{% else %}false{% endif %}
104 },
105 },
105 ban: {
106 ban: {
106 name: '{% trans "Ban" %}',
107 name: '{% trans "Ban" %}',
107 callback: function(key, opt) {
108 callback: function(key, opt) {
108 if (confirm('{% trans "Are you sure?" %}')) {
109 if (confirm('{% trans "Are you sure?" %}')) {
109 window.location = '{% url 'utils' %}?method=ban&post_id={{ post.id }}';
110 window.location = '{% url 'utils' %}?method=ban&post_id={{ post.id }}';
110 }
111 }
111 },
112 },
112 visible: {% if post.has_ip %}true{% else %}false{% endif %}
113 visible: {% if post.has_ip %}true{% else %}false{% endif %}
113 },
114 },
114 banAndDelete: {
115 banAndDelete: {
115 name: '{% trans "Ban and delete" %}',
116 name: '{% trans "Ban and delete" %}',
116 callback: function(key, opt) {
117 callback: function(key, opt) {
117 if (confirm('{% trans "Are you sure?" %}')) {
118 if (confirm('{% trans "Are you sure?" %}')) {
118 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 }}';
119 }
120 }
120 },
121 },
121 visible: {% if post.has_ip %}true{% else %}false{% endif %}
122 visible: {% if post.has_ip %}true{% else %}false{% endif %}
122 }
123 }
123 }
124 }
124 };
125 };
125 }
126 }
126 });
127 });
127 </script>
128 </script>
128 {% endif %}
129 {% endif %}
129 </div>
130 </div>
130 {% for file in post.attachments.all %}
131 {% for file in post.attachments.all %}
131 {{ file.get_view|safe }}
132 {{ file.get_view|safe }}
132 {% endfor %}
133 {% endfor %}
133 {% comment %}
134 {% comment %}
134 Post message (text)
135 Post message (text)
135 {% endcomment %}
136 {% endcomment %}
136 <div class="message">
137 <div class="message">
137 {% if truncated %}
138 {% if truncated %}
138 {{ post.get_text|truncatewords_html:50|truncatenewlines_html:3|safe }}
139 {{ post.get_text|truncatewords_html:50|truncatenewlines_html:3|safe }}
139 {% else %}
140 {% else %}
140 {{ post.get_text|safe }}
141 {{ post.get_text|safe }}
141 {% endif %}
142 {% endif %}
142 </div>
143 </div>
143 {% if post.is_referenced and not mode_tree %}
144 {% if post.is_referenced and not mode_tree %}
144 <div class="refmap">
145 <div class="refmap">
145 {% trans "Replies" %}: {{ post.refmap|safe }}
146 {% trans "Replies" %}: {{ post.refmap|safe }}
146 </div>
147 </div>
147 {% endif %}
148 {% endif %}
148 {% comment %}
149 {% comment %}
149 Thread metadata: counters, tags etc
150 Thread metadata: counters, tags etc
150 {% endcomment %}
151 {% endcomment %}
151 {% if is_opening %}
152 {% if is_opening %}
152 <div class="metadata">
153 <div class="metadata">
153 {% if need_open_link %}
154 {% if need_open_link %}
154 ♥ {{ thread.get_reply_count }}
155 ♥ {{ thread.get_reply_count }}
155 ❄ {{ thread.get_images_count }}
156 ❄ {{ thread.get_images_count }}
156 <a href="{% url 'thread_gallery' post.id %}">G</a>
157 <a href="{% url 'thread_gallery' post.id %}">G</a>
157 <a href="{% url 'thread_tree' post.id %}">T</a>
158 <a href="{% url 'thread_tree' post.id %}">T</a>
158 {% endif %}
159 {% endif %}
159 <span class="tags">
160 <span class="tags">
160 {{ thread.get_tag_url_list|safe }}
161 {{ thread.get_tag_url_list|safe }}
161 </span>
162 </span>
162 </div>
163 </div>
163 {% endif %}
164 {% endif %}
164 </div>
165 </div>
166 {% endautoescape %} No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now