diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig')
-rw-r--r-- | src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig | 99 |
1 files changed, 14 insertions, 85 deletions
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 5a800332..8c06cf11 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 | |||
@@ -5,7 +5,7 @@ | |||
5 | {% block content %} | 5 | {% block content %} |
6 | <div id="article"> | 6 | <div id="article"> |
7 | <header class="mbm"> | 7 | <header class="mbm"> |
8 | <h1>{{ entry.title|raw }} <a href="{{ path('edit', { 'id': entry.id }) }}" title="{{ 'entry.view.edit_title'|trans }}">✎</a></h1> | 8 | <h1>{{ entry.title|raw }} <a href="{{ path('edit', { 'id': entry.id }) }}" class="nostyle" title="{{ 'entry.view.edit_title'|trans }}">✎</a></h1> |
9 | </header> | 9 | </header> |
10 | 10 | ||
11 | <div id="article_toolbar"> | 11 | <div id="article_toolbar"> |
@@ -30,10 +30,10 @@ | |||
30 | </ul> | 30 | </ul> |
31 | </div> | 31 | </div> |
32 | {% set nbAnnotations = entry.annotations | length %} | 32 | {% set nbAnnotations = entry.annotations | length %} |
33 | <span class="tool link mdi-communication-comment"> {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}</span> | 33 | <span class="tool link"><i class="material-icons link">comment</i> {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}</span> |
34 | <aside class="tags"> | 34 | <aside class="tags"> |
35 | {% for tag in entry.tags %} | 35 | {% for tag in entry.tags %} |
36 | <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="label-outline"><i class="material-icons">label_outline</i> {{ tag.label }}</span> <a href="{{ path('remove_tag', { 'entry': entry.id, 'tag': tag.id }) }}"class="nostyle"><i>✘</i></a> |
37 | {% endfor %} | 37 | {% endfor %} |
38 | <div class="input-field nav-panel-add-tag" style="display: none"> | 38 | <div class="input-field nav-panel-add-tag" style="display: none"> |
39 | {{ render(controller( "WallabagCoreBundle:Tag:addTagForm", { 'id': entry.id } )) }} | 39 | {{ render(controller( "WallabagCoreBundle:Tag:addTagForm", { 'id': entry.id } )) }} |
@@ -46,87 +46,16 @@ | |||
46 | {{ entry.content | raw }} | 46 | {{ entry.content | raw }} |
47 | </article> | 47 | </article> |
48 | </div> | 48 | </div> |
49 | <script src="{{ asset('bundles/wallabagcore/themes/_global/js/restoreScroll.js')}}"></script> | 49 | <script id="annotationroutes" type="application/json"> |
50 | <script type="text/javascript"> | 50 | { |
51 | $(document).ready(function() { | 51 | "prefix": "", |
52 | 52 | "urls": { | |
53 | // toggle read property of current article | 53 | "create": "{{ path('annotations_post_annotation', { 'entry': entry.id }) }}", |
54 | /* $('#markAsRead').click(function(){ | 54 | "update": "{{ path('annotations_put_annotation', { 'annotation': 'idAnnotation' }) }}", |
55 | $("body").css("cursor", "wait"); | 55 | "destroy": "{{ path('annotations_delete_annotation', { 'annotation': 'idAnnotation' }) }}", |
56 | $.ajax( { url: '{{ path('archive_entry', { 'id': entry.id }) }}' }).done( | 56 | "search": "{{ path('annotations_get_annotations', { 'entry': entry.id }) }}" |
57 | function( data ) { | 57 | }, |
58 | if ( data == '1' ) { | 58 | "entryId": "{{ entry.id }}" |
59 | if ( $('#markAsRead').hasClass("archive-off") ) { | 59 | } |
60 | $('#markAsRead').removeClass("archive-off"); | ||
61 | $('#markAsRead').addClass("archive"); | ||
62 | } | ||
63 | else { | ||
64 | $('#markAsRead').removeClass("archive"); | ||
65 | $('#markAsRead').addClass("archive-off"); | ||
66 | } | ||
67 | } | ||
68 | else { | ||
69 | alert('Error! Pls check if you are logged in.'); | ||
70 | } | ||
71 | }); | ||
72 | $("body").css("cursor", "auto"); | ||
73 | });*/ | ||
74 | |||
75 | // toggle favorite property of current article | ||
76 | /* $('#setFav').click(function(){ | ||
77 | $("body").css("cursor", "wait"); | ||
78 | $.ajax( { url: '{{ path('star_entry', { 'id': entry.id }) }}' }).done( | ||
79 | function( data ) { | ||
80 | if ( data == '1' ) { | ||
81 | if ( $('#setFav').hasClass("fav-off") ) { | ||
82 | $('#setFav').removeClass("fav-off"); | ||
83 | $('#setFav').addClass("fav"); | ||
84 | } | ||
85 | else { | ||
86 | $('#setFav').removeClass("fav"); | ||
87 | $('#setFav').addClass("fav-off"); | ||
88 | } | ||
89 | } | ||
90 | else { | ||
91 | alert('Error! Pls check if you are logged in.'); | ||
92 | } | ||
93 | }); | ||
94 | $("body").css("cursor", "auto"); | ||
95 | });*/ | ||
96 | |||
97 | $(window).scroll(function(e){ | ||
98 | var scrollTop = $(window).scrollTop(); | ||
99 | var docHeight = $(document).height(); | ||
100 | var scrollPercent = (scrollTop) / (docHeight); | ||
101 | var scrollPercentRounded = Math.round(scrollPercent*100)/100; | ||
102 | savePercent({{ entry.id }}, scrollPercentRounded); | ||
103 | }); | ||
104 | |||
105 | retrievePercent({{ entry.id }}); | ||
106 | |||
107 | $(window).resize(function(){ | ||
108 | retrievePercent({{ entry.id }}); | ||
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 | }); | ||
130 | </script> | 60 | </script> |
131 | |||
132 | {% endblock %} | 61 | {% endblock %} |