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