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