From 7720cca5325eae71595e6355d6599448c30377fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 23 Feb 2016 11:32:48 +0100 Subject: Add annotator in baggy theme + Documentation about annotations --- .../views/themes/baggy/Entry/entry.html.twig | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig') 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..988cbd29 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 @@ -107,5 +107,25 @@ retrievePercent({{ entry.id }}); }); }); + + var app = new annotator.App(); + app.include(annotator.ui.main, { + element: document.querySelector('article') + }); + app.include(annotator.storage.http, { + prefix: '', + urls: { + create: '{{ path('annotations_post_annotation', { 'entry': entry.id }) }}', + update: '{{ path('annotations_put_annotation', { 'comment': 'idComment' }) }}', + destroy: '{{ path('annotations_delete_annotation', { 'comment': 'idComment' }) }}', + search: '{{ path('annotations_get_annotations', { 'entry': entry.id }) }}' + } + }); + app + .start() + .then(function () { + app.annotations.load({entry: {{ entry.id }}}); + }); + {% endblock %} -- cgit v1.2.3 From a772d16b12ee84e8d0810c65b26664e8364b4047 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 24 Feb 2016 13:36:08 +0100 Subject: display how much comments there are for an entry --- .../CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig') 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 988cbd29..817e39b8 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 @@
  • {% trans %}Does this article appear wrong?{% endtrans %}
  • - + {% set nbComments = entry.comments | length %} + {% transchoice nbComments %}{0} No annotations|{1} One annotation|]1,Inf[ %nbComments% annotations{% endtranschoice %}