]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig
Fixed possible JS injection via the title edition
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Resources / views / themes / material / Entry / entry.html.twig
1 {% extends "WallabagCoreBundle::layout.html.twig" %}
2
3 {% block title %}{{ entry.title|e|raw }} ({{ entry.domainName|removeWww }}){% endblock %}
4
5 {% block body_class %}entry{% endblock %}
6
7 {% block menu %}
8 <div class="progress">
9 <div class="determinate"></div>
10 </div>
11 <nav class="hide-on-large-only">
12 <div class="nav-wrapper cyan darken-1">
13 <ul>
14 <li>
15 <a class="waves-effect" href="{{ path('homepage') }}">
16 <i class="material-icons">exit_to_app</i>
17 </a>
18 </li>
19 </ul>
20 <ul class="right">
21 <li>
22 <a class="waves-effect" title="{{ 'entry.view.left_menu.set_as_read'|trans }}" href="{{ path('archive_entry', { 'id': entry.id }) }}" id="markAsRead">
23 <i class="material-icons small">{% if entry.isArchived == 0 %}done{% else %}redo{% endif %}</i>
24 </a>
25 </li>
26 <li>
27 <a class="waves-effect" title="{{ 'entry.view.left_menu.set_as_starred'|trans }}" href="{{ path('star_entry', { 'id': entry.id }) }}" id="setFav">
28 <i class="material-icons small">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i>
29 </a>
30 </li>
31 <li>
32 <a href="#" data-activates="slide-out" class="button-collapse right">
33 <i class="material-icons">menu</i>
34 </a>
35 </li>
36 </ul>
37 </div>
38 </nav>
39 <ul id="slide-out" class="collapsible side-nav fixed reader-mode" data-collapsible="accordion">
40 <li class="bold border-bottom hide-on-med-and-down">
41 <a class="waves-effect collapsible-header" href="{{ path('homepage') }}">
42 <i class="material-icons small">exit_to_app</i>
43 <span>{{ 'entry.view.left_menu.back_to_homepage'|trans }}</span>
44 </a>
45 <div class="collapsible-body"></div>
46 </li>
47
48 <li class="bold border-bottom hide-on-med-and-down">
49 <a class="waves-effect collapsible-header" href="{{ entry.url|e }}">
50 <i class="material-icons small">link</i>
51 <span>{{ 'entry.view.left_menu.view_original_article'|trans }}</span>
52 </a>
53 <div class="collapsible-body"></div>
54 </li>
55
56 <li class="bold hide-on-med-and-down">
57 <a class="waves-effect collapsible-header" title="{{ 'entry.view.left_menu.re_fetch_content'|trans }}" href="{{ path('reload_entry', { 'id': entry.id }) }}" id="reload">
58 <i class="material-icons small">autorenew</i>
59 <span>{{ 'entry.view.left_menu.re_fetch_content'|trans }}</span>
60 </a>
61 <div class="collapsible-body"></div>
62 </li>
63
64 {% set markAsReadLabel = 'entry.view.left_menu.set_as_unread' %}
65 {% if entry.isArchived == 0 %}
66 {% set markAsReadLabel = 'entry.view.left_menu.set_as_read' %}
67 {% endif %}
68
69 <li class="bold hide-on-med-and-down">
70 <a class="waves-effect collapsible-header" title="{{ markAsReadLabel|trans }}" href="{{ path('archive_entry', { 'id': entry.id }) }}" id="markAsRead">
71 <i class="material-icons small">{% if entry.isArchived == 0 %}done{% else %}redo{% endif %}</i>
72 <span>{{ markAsReadLabel|trans }}</span>
73 </a>
74 <div class="collapsible-body"></div>
75 </li>
76
77 <li class="bold hide-on-med-and-down">
78 <a class="waves-effect collapsible-header" title="{{ 'entry.view.left_menu.set_as_starred'|trans }}" href="{{ path('star_entry', { 'id': entry.id }) }}" id="setFav">
79 <i class="material-icons spall">{% if entry.isStarred == 0 %}star_outline{% else %}star{% endif %}</i>
80 <span>{{ 'entry.view.left_menu.set_as_starred'|trans }}</span>
81 </a>
82 <div class="collapsible-body"></div>
83 </li>
84 <li class="bold border-bottom hide-on-med-and-down">
85 <a class="waves-effect collapsible-header" title="{{ 'entry.view.left_menu.delete'|trans }}" href="{{ path('delete_entry', { 'id': entry.id }) }}">
86 <i class="material-icons small">delete</i>
87 <span>{{ 'entry.view.left_menu.delete'|trans }}</span>
88 </a>
89 <div class="collapsible-body"></div>
90 </li>
91
92 <li class="bold border-bottom hide-on-med-and-down">
93 <a class="waves-effect collapsible-header" id="nav-btn-add-tag">
94 <i class="material-icons small">label_outline</i>
95 <span>{{ 'entry.view.left_menu.add_a_tag'|trans }}</span>
96 </a>
97 <div class="collapsible-body"></div>
98 </li>
99
100 <li class="bold">
101 <a class="waves-effect collapsible-header">
102 <i class="material-icons small">share</i>
103 <span>{{ 'entry.view.left_menu.share_content'|trans }}</span>
104 </a>
105 <div class="collapsible-body">
106 <ul>
107 {% if craue_setting('share_public') %}
108 <li>
109 <a href="{{ path('share', {'id': entry.id }) }}" target="_blank" title="{{ 'entry.view.left_menu.public_link'|trans }}" class="tool icon-eye">
110 <span>{{ 'entry.view.left_menu.public_link'|trans }}</span>
111 </a>
112 </li>
113 <li>
114 <a href="{{ path('delete_share', {'id': entry.id }) }}" title="{{ 'entry.view.left_menu.delete_public_link'|trans }}" class="tool icon-no-eye">
115 <span>{{ 'entry.view.left_menu.delete_public_link'|trans }}</span>
116 </a>
117 </li>
118 {% endif %}
119 {% if craue_setting('share_twitter') %}
120 <li>
121 <a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool icon-twitter" title="twitter">
122 <span>twitter</span>
123 </a>
124 </li>
125 {% endif %}
126 {% if craue_setting('share_shaarli') %}
127 <li>
128 <a href="{{ craue_setting('shaarli_url') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank">
129 <i class="tool icon-image icon-image--shaarli" title="shaarli"></i>
130 <span>shaarli</span>
131 </a>
132 </li>
133 {% endif %}
134 {% if craue_setting('share_diaspora') %}
135 <li>
136 <a href="{{ craue_setting('diaspora_url') }}/bookmarklet?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}&notes=&v=1&noui=1&jump=doclose" target="_blank">
137 <i class="tool icon-image icon-image--diaspora" title="diaspora"></i>
138 <span>diaspora*</span>
139 </a>
140 </li>
141 {% endif %}
142 {% if craue_setting('carrot') %}
143 <li>
144 <a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" target="_blank" title="carrot">
145 <i class="tool icon-image icon-image--carrot"></i>
146 <span>Carrot</span>
147 </a>
148 </li>
149 {% endif %}
150 {% if craue_setting('share_mail') %}
151 <li>
152 <a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" title="{{ 'entry.view.left_menu.share_email_label'|trans }}" class="tool email icon icon-mail">
153 <span>{{ 'entry.view.left_menu.share_email_label'|trans }}</span>
154 </a>
155 </li>
156 {% endif %}
157 </ul>
158 </div>
159 </li>
160
161 {% if craue_setting('show_printlink') %}
162 <li class="bold border-bottom hide-on-med-and-down">
163 <a class="waves-effect collapsible-header" title="{{ 'entry.view.left_menu.print'|trans }}" href="javascript: window.print();">
164 <i class="material-icons small">print</i>
165 <span>{{ 'entry.view.left_menu.print'|trans }}</span>
166 </a>
167 <div class="collapsible-body"></div>
168 </li>
169 {% endif %}
170
171 <li class="bold">
172 <a class="waves-effect collapsible-header">
173 <i class="material-icons small">file_download</i>
174 <span>{{ 'entry.view.left_menu.download'|trans }}</span>
175 </a>
176 <div class="collapsible-body">
177 <ul>
178 {% if craue_setting('export_epub') %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'epub' }) }}" title="Generate ePub file">EPUB</a></li>{% endif %}
179 {% if craue_setting('export_mobi') %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'mobi' }) }}" title="Generate Mobi file">MOBI</a></li>{% endif %}
180 {% if craue_setting('export_pdf') %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'pdf' }) }}" title="Generate PDF file">PDF</a></li>{% endif %}
181 {% if craue_setting('export_csv') %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'csv' }) }}" title="Generate CSV file">CSV</a></li>{% endif %}
182 {% if craue_setting('export_json') %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'json' }) }}" title="Generate JSON file">JSON</a></li>{% endif %}
183 {% if craue_setting('export_txt') %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'txt' }) }}" title="Generate TXT file">TXT</a></li>{% endif %}
184 {% if craue_setting('export_xml') %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'xml' }) }}" title="Generate XML file">XML</a></li>{% endif %}
185 </ul>
186 </div>
187 </li>
188
189 <li class="bold hide-on-large-only">
190 <a class="waves-effect collapsible-header" title="{{ 'entry.view.left_menu.delete'|trans }}" href="{{ path('delete_entry', { 'id': entry.id }) }}">
191 <i class="material-icons small">delete</i>
192 <span>{{ 'entry.view.left_menu.delete'|trans }}</span>
193 </a>
194 <div class="collapsible-body"></div>
195 </li>
196
197 <li class="bold">
198 <a class="waves-effect collapsible-header" href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&amp;body={{ entry.url|url_encode }}" title="{{ 'entry.view.left_menu.problem.description'|trans }}">
199 <i class="material-icons small">error</i>
200 <span>{{ 'entry.view.left_menu.problem.label'|trans }}</span>
201 </a>
202 <div class="collapsible-body"></div>
203 </li>
204
205 </ul>
206
207 {% endblock %}
208
209 {% block content %}
210 <div id="article">
211 <header class="mbm">
212 <h1>{{ entry.title|e|raw }} <a href="{{ path('edit', { 'id': entry.id }) }}" title="{{ 'entry.view.edit_title'|trans }}">✎</a></h1>
213 </header>
214 <aside>
215 <ul class="tools">
216 <li>
217 {% set readingTime = entry.readingTime / app.user.config.readingSpeed %}
218 <i class="material-icons">timer</i>
219 {% if readingTime > 0 %}
220 {{ 'entry.list.reading_time_minutes_short'|trans({'%readingTime%': readingTime|round}) }}
221 {% else %}
222 {{ 'entry.list.reading_time_less_one_minute_short'|trans|raw }}
223 {% endif %}
224 </li>
225 <li>
226 <i class="material-icons" title="{{ 'entry.view.created_at'|trans }}">today</i>
227 {{ entry.createdAt|date('Y-m-d') }}
228 </li>
229 <li>
230 <i class="material-icons link">link</i>
231 <a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|e }}" class="tool">
232 {{ entry.domainName|removeWww }}
233 </a>
234 </li>
235 <li>
236 <i class="material-icons link">comment</i>
237 {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}
238 </li>
239 <li id="list">
240 {% for tag in entry.tags %}
241 <div class="chip">
242 <a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a> <a href="{{ path('remove_tag', { 'entry': entry.id, 'tag': tag.id }) }}"><i class="material-icons">delete</i></a>
243 </div>
244 {% endfor %}
245 </li>
246 </ul>
247
248 <div class="input-field nav-panel-add-tag" style="display: none">
249 {{ render(controller( "WallabagCoreBundle:Tag:addTagForm", { 'id': entry.id } )) }}
250 </div>
251
252 {% if entry.previewPicture is not null %}
253 <div><img class="preview" src="{{ entry.previewPicture }}" alt="{{ entry.title|raw }}" /></div>
254 {% endif %}
255
256 </aside>
257 <article>
258 {{ entry.content | raw }}
259 </article>
260 </div>
261
262 <script id="annotationroutes" type="application/json">
263 {
264 "prefix": "",
265 "urls": {
266 "create": "{{ path('annotations_post_annotation', { 'entry': entry.id }) }}",
267 "update": "{{ path('annotations_put_annotation', { 'annotation': 'idAnnotation' }) }}",
268 "destroy": "{{ path('annotations_delete_annotation', { 'annotation': 'idAnnotation' }) }}",
269 "search": "{{ path('annotations_get_annotations', { 'entry': entry.id }) }}"
270 },
271 "entryId": "{{ entry.id }}"
272 }</script>
273
274 {% endblock %}
275
276 {% block footer %}
277 {% endblock %}