]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig
Changed code indentation
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Resources / views / themes / baggy / Entry / entry.html.twig
CommitLineData
ad4d1caa 1{% extends "WallabagCoreBundle::layout.html.twig" %}
bd9f0815 2
784bb4c3 3{% block title %}{{ entry.title|raw }} ({{ entry.domainName|removeWww }}){% endblock %}
bd9f0815 4
bd9f0815 5{% block content %}
56349e47
TC
6 <div id="article">
7 <header class="mbm">
0d42217e 8 <h1>{{ entry.title|raw }} <a href="{{ path('edit', { 'id': entry.id }) }}" title="{{ 'entry.view.edit_title'|trans }}">✎</a></h1>
56349e47
TC
9 </header>
10
11 <div id="article_toolbar">
bd9f0815 12 <ul class="links">
0d42217e
JB
13 <li class="topPosF"><a href="#top" title="{{ 'entry.view.left_menu.back_to_top'|trans }}" class="tool top icon icon-arrow-up-thick"><span>{{ 'entry.view.left_menu.set_as_read'|trans }}</span></a></li>
14 <li><a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|e }}" class="tool link icon icon-link"><span>{{ entry.domainName|removeWww }}</span></a></li>
15 <li><a title="{{ 'entry.view.left_menu.re_fetch_content'|trans }}" class="tool icon icon-reload" href="{{ path('reload_entry', { 'id': entry.id }) }}"><span>{{ 'entry.view.left_menu.re_fetch_content'|trans }}</span></a></li>
16 <li><a title="{% if entry.isArchived == 0 %}{{ 'entry.view.left_menu.set_as_read'|trans }}{% else %}{{ 'entry.view.left_menu.set_as_unread'|trans }}{% endif %}" class="tool icon icon-check {% if entry.isArchived == 0 %}archive-off{% else %}archive{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"><span>{% if entry.isArchived == 0 %}{{ 'entry.view.left_menu.set_as_read'|trans }}{% else %}{{ 'entry.view.left_menu.set_as_unread'|trans }}{% endif %}</span></a></li>
17 <li><a title="{{ 'entry.view.left_menu.set_as_favorite'|trans }}" class="tool icon icon-star {% if entry.isStarred == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{{ 'entry.view.left_menu.set_as_favorite'|trans }}</span></a></li>
18 <li><a id="nav-btn-add-tag" title="{{ 'entry.view.left_menu.add_a_tag'|trans }}"><span>{{ 'entry.view.left_menu.add_a_tag'|trans }}</span></a></li>
19 <li><a title="{{ 'entry.view.left_menu.delete'|trans }}" class="tool delete icon icon-trash" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{{ 'entry.view.left_menu.delete'|trans }}</span></a></li>
20 {% if craue_setting('share_twitter') %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool twitter icon icon-twitter" title="Tweet"><span>Tweet</span></a></li>{% endif %}
21 {% if craue_setting('share_mail') %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email icon icon-mail" title="Email"><span>Email</span></a></li>{% endif %}
22 {% if craue_setting('share_shaarli') %}<li><a href="{{ craue_setting('shaarli_url') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="shaarli"><span>shaarli</span></a></li>{% endif %}
23 {% if craue_setting('share_diaspora') %}<li><a href="{{ craue_setting('diaspora_url') }}/bookmarklet?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}&notes=&v=1&noui=1&jump=doclose" target="_blank" class="tool diaspora icon-image icon-image--diaspora" title="diaspora"><span>diaspora</span></a></li>{% endif %}
24 {% if craue_setting('carrot') %}<li><a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" class="tool carrot icon-image icon-image--carrot" target="_blank" title="carrot"><span>Carrot</span></a></li>{% endif %}
cb48a569 25 {% if craue_setting('show_printlink') %}<li><a title="{{ 'entry.view.left_menu.print'|trans }}" class="tool icon icon-print" href="javascript: window.print();"><span>{{ 'entry.view.left_menu.print'|trans }}</span></a></li>{% endif %}
63e40f2d
JB
26 {% if craue_setting('export_epub') %}<li><a href="?epub&amp;method=id&amp;value={{ entry.id }}" title="Generate ePub file">EPUB</a></li>{% endif %}
27 {% if craue_setting('export_mobi') %}<li><a href="?mobi&amp;method=id&amp;value={{ entry.id }}" title="Generate Mobi file">MOBI</a></li>{% endif %}
28 {% if craue_setting('export_pdf') %}<li><a href="?pdf&amp;method=id&amp;value={{ entry.id }}" title="Generate PDF file">PDF</a></li>{% endif %}
0d42217e 29 <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&amp;body={{ entry.url|url_encode }}" title="{{ 'entry.view.left_menu.problem.label'|trans }}" class="tool bad-display icon icon-delete"><span>{{ 'entry.view.left_menu.problem.label'|trans }}</span></a></li>
bd9f0815
NL
30 </ul>
31 </div>
4e1be104
NL
32 <div class="link mdi-action-today"> {{ entry.createdAt|date('Y-m-d') }}</div>
33 {% set readingTime = entry.readingTime / app.user.config.readingSpeed %}
e7732deb
NL
34 <div class="link mdi-action-query-builder">
35 {% if readingTime > 0 %}
36 {{ 'entry.list.reading_time_minutes_short'|trans({'%readingTime%': readingTime|round}) }}
37 {% else %}
38 {{ 'entry.list.reading_time_less_one_minute_short'|trans|raw }}
39 {% endif %}
40 </div>
4dc87223 41 {% set nbAnnotations = entry.annotations | length %}
0d42217e 42 <span class="tool link mdi-communication-comment"> {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}</span>
bd9f0815 43 <aside class="tags">
56349e47 44 {% for tag in entry.tags %}
a8d5f897
TC
45 <span class="mdi-action-label-outline">{{ tag.label }}</span> <a href="{{ path('remove_tag', { 'entry': entry.id, 'tag': tag.id }) }}"><i>✘</i></a>
46 {% endfor %}
56349e47
TC
47 <div class="input-field nav-panel-add-tag" style="display: none">
48 {{ render(controller( "WallabagCoreBundle:Tag:addTagForm", { 'id': entry.id } )) }}
49 </div>
bd9f0815 50 </aside>
b026d3b1
NL
51 {% if entry.previewPicture is not null %}
52 <div><img class="preview" src="{{ entry.previewPicture }}" alt="{{ entry.title|raw }}" /></div>
53 {% endif %}
bd9f0815
NL
54 <article>
55 {{ entry.content | raw }}
56 </article>
57 </div>
30d81a47 58 <script src="{{ asset('bundles/wallabagcore/themes/_global/js/restoreScroll.js')}}"></script>
bd9f0815
NL
59 <script type="text/javascript">
60 $(document).ready(function() {
61
62 // toggle read property of current article
163eae0b 63 /* $('#markAsRead').click(function(){
bd9f0815 64 $("body").css("cursor", "wait");
163eae0b 65 $.ajax( { url: '{{ path('archive_entry', { 'id': entry.id }) }}' }).done(
bd9f0815
NL
66 function( data ) {
67 if ( data == '1' ) {
68 if ( $('#markAsRead').hasClass("archive-off") ) {
69 $('#markAsRead').removeClass("archive-off");
70 $('#markAsRead').addClass("archive");
71 }
72 else {
73 $('#markAsRead').removeClass("archive");
74 $('#markAsRead').addClass("archive-off");
75 }
76 }
77 else {
78 alert('Error! Pls check if you are logged in.');
79 }
80 });
81 $("body").css("cursor", "auto");
163eae0b 82 });*/
bd9f0815
NL
83
84 // toggle favorite property of current article
163eae0b 85 /* $('#setFav').click(function(){
bd9f0815 86 $("body").css("cursor", "wait");
163eae0b 87 $.ajax( { url: '{{ path('star_entry', { 'id': entry.id }) }}' }).done(
bd9f0815
NL
88 function( data ) {
89 if ( data == '1' ) {
90 if ( $('#setFav').hasClass("fav-off") ) {
91 $('#setFav').removeClass("fav-off");
92 $('#setFav').addClass("fav");
93 }
94 else {
95 $('#setFav').removeClass("fav");
96 $('#setFav').addClass("fav-off");
97 }
98 }
99 else {
100 alert('Error! Pls check if you are logged in.');
101 }
102 });
103 $("body").css("cursor", "auto");
163eae0b 104 });*/
bd9f0815
NL
105
106 $(window).scroll(function(e){
107 var scrollTop = $(window).scrollTop();
108 var docHeight = $(document).height();
109 var scrollPercent = (scrollTop) / (docHeight);
110 var scrollPercentRounded = Math.round(scrollPercent*100)/100;
82d6d9cb 111 savePercent({{ entry.id }}, scrollPercentRounded);
bd9f0815
NL
112 });
113
82d6d9cb 114 retrievePercent({{ entry.id }});
bd9f0815
NL
115
116 $(window).resize(function(){
82d6d9cb 117 retrievePercent({{ entry.id }});
bd9f0815
NL
118 });
119 });
7720cca5
NL
120
121 var app = new annotator.App();
122 app.include(annotator.ui.main, {
123 element: document.querySelector('article')
124 });
125 app.include(annotator.storage.http, {
126 prefix: '',
127 urls: {
128 create: '{{ path('annotations_post_annotation', { 'entry': entry.id }) }}',
4dc87223
NL
129 update: '{{ path('annotations_put_annotation', { 'annotation': 'idAnnotation' }) }}',
130 destroy: '{{ path('annotations_delete_annotation', { 'annotation': 'idAnnotation' }) }}',
7720cca5
NL
131 search: '{{ path('annotations_get_annotations', { 'entry': entry.id }) }}'
132 }
133 });
134 app
135 .start()
136 .then(function () {
137 app.annotations.load({entry: {{ entry.id }}});
138 });
bd9f0815 139 </script>
7720cca5 140
7df80cb3 141{% endblock %}