diff options
author | Nicolas Lœuillet <nicolas@loeuillet.org> | 2016-02-26 18:17:37 +0100 |
---|---|---|
committer | Nicolas Lœuillet <nicolas@loeuillet.org> | 2016-02-26 18:17:37 +0100 |
commit | 162954763e6f68e0cf4002822007683bde62fc25 (patch) | |
tree | a85f850eddb30b3435d1bb5f45d16d9ab465bbf9 /src/Wallabag/CoreBundle/Resources/views | |
parent | d3f1a9dc1ac181033ec54f9149d2807199fa8f17 (diff) | |
parent | b07c7dfe787313b75e0996265e13cccc78da41be (diff) | |
download | wallabag-162954763e6f68e0cf4002822007683bde62fc25.tar.gz wallabag-162954763e6f68e0cf4002822007683bde62fc25.tar.zst wallabag-162954763e6f68e0cf4002822007683bde62fc25.zip |
Merge pull request #1653 from wallabag/v2-annotator-comments
V2 annotator comments
Diffstat (limited to 'src/Wallabag/CoreBundle/Resources/views')
3 files changed, 51 insertions, 2 deletions
diff --git a/src/Wallabag/CoreBundle/Resources/views/base.html.twig b/src/Wallabag/CoreBundle/Resources/views/base.html.twig index 3cadabfb..2748c7e3 100644 --- a/src/Wallabag/CoreBundle/Resources/views/base.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/base.html.twig | |||
@@ -38,11 +38,13 @@ | |||
38 | 38 | ||
39 | <link rel="shortcut icon" type="image/x-icon" href="{{ asset('bundles/wallabagcore/themes/_global/img/appicon/favicon.ico') }}"> | 39 | <link rel="shortcut icon" type="image/x-icon" href="{{ asset('bundles/wallabagcore/themes/_global/img/appicon/favicon.ico') }}"> |
40 | 40 | ||
41 | {% block css %}{% endblock %} | 41 | {% block css %} |
42 | {% endblock %} | ||
42 | {% block scripts %} | 43 | {% block scripts %} |
43 | <script src="{{ asset('bundles/wallabagcore/themes/_global/js/jquery-2.0.3.min.js') }}"></script> | 44 | <script src="{{ asset('bundles/wallabagcore/themes/_global/js/jquery-2.0.3.min.js') }}"></script> |
44 | <script src="{{ asset('bundles/wallabagcore/themes/_global/js/jquery.cookie.js') }}"></script> | 45 | <script src="{{ asset('bundles/wallabagcore/themes/_global/js/jquery.cookie.js') }}"></script> |
45 | <script src="{{ asset('bundles/wallabagcore/themes/_global/js/bookmarklet.js') }}"></script> | 46 | <script src="{{ asset('bundles/wallabagcore/themes/_global/js/bookmarklet.js') }}"></script> |
47 | <script src="{{ asset('bundles/wallabagcore/themes/_global/js/annotator.min.js') }}"></script> | ||
46 | {% endblock %} | 48 | {% endblock %} |
47 | 49 | ||
48 | <title>{% block title %}{% endblock %}</title> | 50 | <title>{% block title %}{% endblock %}</title> |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig index 94f4ba7d..9323e787 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig | |||
@@ -29,7 +29,8 @@ | |||
29 | <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&body={{ entry.url|url_encode }}" title="{% trans %}Does this article appear wrong?{% endtrans %}" class="tool bad-display icon icon-delete"><span>{% trans %}Does this article appear wrong?{% endtrans %}</span></a></li> | 29 | <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&body={{ entry.url|url_encode }}" title="{% trans %}Does this article appear wrong?{% endtrans %}" class="tool bad-display icon icon-delete"><span>{% trans %}Does this article appear wrong?{% endtrans %}</span></a></li> |
30 | </ul> | 30 | </ul> |
31 | </div> | 31 | </div> |
32 | 32 | {% set nbAnnotations = entry.annotations | length %} | |
33 | <span class="tool link mdi-communication-comment"> {% transchoice nbAnnotations %}{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations{% endtranschoice %}</span> | ||
33 | <aside class="tags"> | 34 | <aside class="tags"> |
34 | {% for tag in entry.tags %} | 35 | {% for tag in entry.tags %} |
35 | <span class="mdi-action-label-outline">{{ tag.label }}</span> <a href="{{ path('remove_tag', { 'entry': entry.id, 'tag': tag.id }) }}"><i>✘</i></a> | 36 | <span class="mdi-action-label-outline">{{ tag.label }}</span> <a href="{{ path('remove_tag', { 'entry': entry.id, 'tag': tag.id }) }}"><i>✘</i></a> |
@@ -107,5 +108,25 @@ | |||
107 | retrievePercent({{ entry.id }}); | 108 | retrievePercent({{ entry.id }}); |
108 | }); | 109 | }); |
109 | }); | 110 | }); |
111 | |||
112 | var app = new annotator.App(); | ||
113 | app.include(annotator.ui.main, { | ||
114 | element: document.querySelector('article') | ||
115 | }); | ||
116 | app.include(annotator.storage.http, { | ||
117 | prefix: '', | ||
118 | urls: { | ||
119 | create: '{{ path('annotations_post_annotation', { 'entry': entry.id }) }}', | ||
120 | update: '{{ path('annotations_put_annotation', { 'annotation': 'idAnnotation' }) }}', | ||
121 | destroy: '{{ path('annotations_delete_annotation', { 'annotation': 'idAnnotation' }) }}', | ||
122 | search: '{{ path('annotations_get_annotations', { 'entry': entry.id }) }}' | ||
123 | } | ||
124 | }); | ||
125 | app | ||
126 | .start() | ||
127 | .then(function () { | ||
128 | app.annotations.load({entry: {{ entry.id }}}); | ||
129 | }); | ||
110 | </script> | 130 | </script> |
131 | |||
111 | {% endblock %} | 132 | {% endblock %} |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig index f6ba83ae..6f33da23 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig | |||
@@ -177,6 +177,7 @@ main { | |||
177 | padding: 0; | 177 | padding: 0; |
178 | } | 178 | } |
179 | </style> | 179 | </style> |
180 | |||
180 | {% endblock %} | 181 | {% endblock %} |
181 | 182 | ||
182 | {% block content %} | 183 | {% block content %} |
@@ -186,6 +187,8 @@ main { | |||
186 | </header> | 187 | </header> |
187 | <aside> | 188 | <aside> |
188 | <a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %} : {{ entry.title|e }}" class="tool link mdi-content-link"> <span>{{ entry.domainName|removeWww }}</span></a> | 189 | <a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %} : {{ entry.title|e }}" class="tool link mdi-content-link"> <span>{{ entry.domainName|removeWww }}</span></a> |
190 | {% set nbAnnotations = entry.annotations | length %} | ||
191 | <span class="tool link mdi-communication-comment"> {% transchoice nbAnnotations %}{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations{% endtranschoice %}</span> | ||
189 | <div id="list"> | 192 | <div id="list"> |
190 | {% for tag in entry.tags %} | 193 | {% for tag in entry.tags %} |
191 | <div class="chip"> | 194 | <div class="chip"> |
@@ -207,6 +210,29 @@ main { | |||
207 | {{ entry.content | raw }} | 210 | {{ entry.content | raw }} |
208 | </article> | 211 | </article> |
209 | </div> | 212 | </div> |
213 | |||
214 | <script type="text/javascript"> | ||
215 | |||
216 | var app = new annotator.App(); | ||
217 | app.include(annotator.ui.main, { | ||
218 | element: document.querySelector('article') | ||
219 | }); | ||
220 | app.include(annotator.storage.http, { | ||
221 | prefix: '', | ||
222 | urls: { | ||
223 | create: '{{ path('annotations_post_annotation', { 'entry': entry.id }) }}', | ||
224 | update: '{{ path('annotations_put_annotation', { 'annotation': 'idAnnotation' }) }}', | ||
225 | destroy: '{{ path('annotations_delete_annotation', { 'annotation': 'idAnnotation' }) }}', | ||
226 | search: '{{ path('annotations_get_annotations', { 'entry': entry.id }) }}' | ||
227 | } | ||
228 | }); | ||
229 | app | ||
230 | .start() | ||
231 | .then(function () { | ||
232 | app.annotations.load({entry: {{ entry.id }}}); | ||
233 | }); | ||
234 | </script> | ||
235 | |||
210 | {% endblock %} | 236 | {% endblock %} |
211 | 237 | ||
212 | {% block footer %} | 238 | {% block footer %} |