]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig
Disable translation in test
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Resources / views / themes / material / Entry / entry.html.twig
index a40789d8f8b86eefb5828545f80912de8b0fecbf..6f33da23c1cf0ca9778793aff0e5c8c5f7bc5050 100644 (file)
@@ -177,6 +177,7 @@ main {
     padding: 0;
 }
 </style>
+
 {% endblock %}
 
 {% block content %}
@@ -186,10 +187,12 @@ main {
         </header>
         <aside>
             <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>
+            {% set nbAnnotations = entry.annotations | length %}
+            <span class="tool link mdi-communication-comment"> {% transchoice nbAnnotations %}{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations{% endtranschoice %}</span>
             <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>
@@ -207,6 +210,29 @@ main {
             {{ entry.content | raw }}
         </article>
     </div>
+
+<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', { '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 }}});
+});
+</script>
+
 {% endblock %}
 
 {% block footer %}