]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig
Add annotator in baggy theme
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Resources / views / themes / material / Entry / entry.html.twig
index 7dea1b7f3681d1ca3762ef619214eb31c519aee3..2a06484e02dcc4b509c364c38663b45f184b83e6 100644 (file)
@@ -52,9 +52,9 @@
         </li>
 
         <li class="bold hide-on-med-and-down">
-            <a class="waves-effect collapsible-header" title="{% trans %}Reload content{% endtrans %}" href="{{ path('reload_entry', { 'id': entry.id }) }}" id="reload">
+            <a class="waves-effect collapsible-header" title="{% trans %}Re-fetch content{% endtrans %}" href="{{ path('reload_entry', { 'id': entry.id }) }}" id="reload">
                 <i class="mdi-action-autorenew small"></i>
-                <span>{% trans %}Reload content{% endtrans %}</span>
+                <span>{% trans %}Re-fetch content{% endtrans %}</span>
             </a>
             <div class="collapsible-body"></div>
         </li>
@@ -177,6 +177,29 @@ main {
     padding: 0;
 }
 </style>
+
+<script type="text/javascript">
+
+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 }}});
+});
+</script>
+
 {% endblock %}
 
 {% block content %}
@@ -189,7 +212,7 @@ main {
             <div id="list">
                 {% for tag in entry.tags %}
                     <div class="chip">
-                    {{ tag.label }} <a href="{{ path('remove_tag', { 'entry': entry.id, 'tag': tag.id }) }}"><i class="mdi-navigation-close"></i></a>
+                    {{ tag.label }} <a href="{{ path('remove_tag', { 'entry': entry.id, 'tag': tag.id }) }}"><i class="mdi-action-delete"></i></a>
                     </div>
                 {% endfor %}
             </div>