X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FResources%2Fviews%2Fthemes%2Fbaggy%2FEntry%2Fentry.html.twig;h=7808b4dd56628829ce6f366014fadccdbf7670bc;hb=519ba0b5e71cd9b5abd620f682fd2296e6180af3;hp=c23d0e272540577c07360dcf12ec67a2e9aae8b8;hpb=30d81a47c689e1d7d963fcd3fd42af9958805e31;p=github%2Fwallabag%2Fwallabag.git 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 c23d0e27..7808b4dd 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 @@ -3,34 +3,41 @@ {% block title %}{{ entry.title|raw }} ({{ entry.domainName|removeWww }}){% endblock %} {% block content %} -
- -
-

{{ entry.title|raw }} ✎

+

{{ entry.title|raw }} ✎

+ +
+ +
+ {% set nbAnnotations = entry.annotations | length %} + {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }} {% if entry.previewPicture is not null %}
{{ entry.title|raw }}
@@ -65,7 +72,7 @@ $("body").css("cursor", "auto"); });*/ - // toggle favorite property of current article + // toggle star property of current article /* $('#setFav').click(function(){ $("body").css("cursor", "wait"); $.ajax( { url: '{{ path('star_entry', { 'id': entry.id }) }}' }).done( @@ -101,5 +108,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', { 'annotation': 'idAnnotation' }) }}', + destroy: '{{ path('annotations_delete_annotation', { 'annotation': 'idAnnotation' }) }}', + search: '{{ path('annotations_get_annotations', { 'entry': entry.id }) }}' + } + }); + app + .start() + .then(function () { + app.annotations.load({entry: {{ entry.id }}}); + }); + {% endblock %}