]> git.immae.eu Git - github/wallabag/wallabag.git/blame - themes/default/view.twig
remove buggy swipe actions
[github/wallabag/wallabag.git] / themes / default / view.twig
CommitLineData
4cc3c2ac
NL
1{% extends "layout.twig" %}
2{% block title %}{{ entry.title|raw }} ({{ entry.url | e | getDomain }}){% endblock %}
3{% block content %}
9f8541ef 4 {% include '_highlight.twig' %}
e68348f6 5 {% include '_pocheit-form.twig' %}
4cc3c2ac
NL
6 <div id="article_toolbar">
7 <ul>
00dc7622 8 {% if navigate.next %}<li><a href="./?view=view&amp;id={{ navigate.nextid|e }}" class="tool previous"><span>{% trans "Next Article" %}</span></a></li>{% endif %}
43c1115e
WT
9 <li><a href="./" title="{% trans "Return home" %}" class="tool back"><span>{% trans "Return home" %}</span></a></li>
10 <li><a href="#top" title="{% trans "Back to top" %}" class="tool top"><span>{% trans "Back to top" %}</span></a></li>
4cc3c2ac 11 <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}" class="tool link"><span>{{ entry.url | e | getDomain }}</span></a></li>
c2cf7075 12 <li><a title="{% trans "Mark as read" %}" class="tool {% if entry.is_read == 0 %}archive-off{% else %}archive{% endif %}" href="javascript: void(null);" id="markAsRead"><span>{% trans "Toggle mark as read" %}</span></a></li>
059a3380 13 {% if navigate.next %}<li><a title="{% trans "Mark as read and go to next article" %}" class="tool archiveandnext" href="./?action=archive_and_next&amp;id={{ entry.id|e }}" id="markAsReadAndNext"><span>{% trans "Toggle mark as read and go to next article" %}</span></a></li>{% endif %}
c2cf7075 14 <li><a title="{% trans "Favorite" %}" class="tool {% if entry.is_fav == 0 %}fav-off{% else %}fav{% endif %}" href="javascript: void(null);" id="setFav"><span>{% trans "Toggle favorite" %}</span></a></li>
43c1115e 15 <li><a title="{% trans "Delete" %}" class="tool delete" href="./?action=delete&amp;id={{ entry.id|e }}"><span>{% trans "Delete" %}</span></a></li>
b8fdd2d8 16 {% if constant('SHARE_TWITTER') == 1 %}<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" title="{% trans "Tweet" %}"><span>{% trans "Tweet" %}</span></a></li>{% endif %}
65092883 17 {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title }}&amp;body={{ content|striptags|slice(0, 700) }}%2E%2E%2E%0A%0A{% trans "Read the rest at" %} {{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email" title="{% trans "Email" %}"><span>{% trans "Email" %}</span></a></li>{% endif %}
4cc3c2ac 18 {% if constant('SHARE_SHAARLI') == 1 %}<li><a href="{{ constant('SHAARLI_URL') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans "shaarli" %}"><span>{% trans "shaarli" %}</span></a></li>{% endif %}
571b99e8 19 {% if constant('SHARE_EVERNOTE') == 1 %}<li><a href="https://www.evernote.com/clip.action?url={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool evernote" title="{% trans "evernote" %}"><span>{% trans "evernote" %}</span></a></li>{% endif %}
9c55ed09 20 {% if constant('SHARE_DIASPORA') == 1 %}<li><a href="{{ constant('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" title="{% trans "diaspora" %}"><span>{% trans "diaspora" %}</span></a></li>{% endif %}
b13376e9 21 {% if constant('FLATTR') == 1 %}{% if flattr.status == constant('FLATTRABLE') %}<li><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr" target="_blank" title="{% trans "flattr" %}"><span>{% trans "flattr" %}</span></a></li>{% elseif flattr.status == constant('FLATTRED') %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr" target="_blank" title="{% trans "flattr" %}"><span>{% trans "flattr" %}</span>{{ flattr.numFlattrs }}</a></li>{% endif %}{% endif %}
c8b4ef7f 22 {% if constant('CARROT') == 1 %}<li><a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" class="tool carrot icon" target="_blank" title="{% trans "carrot" %}"><span>{% trans "carrot" %}</span></a></li>{% endif %}
c2cf7075 23 {% if constant('SHOW_PRINTLINK') == 1 %}<li><a title="{% trans "Print" %}" class="tool print" href="javascript: window.print();"><span>{% trans "Print" %}</span></a></li>{% endif %}
47424de6 24 {% if constant('RELOAD_ARTICLE') == 1 %}<li><a class="tool reload" href="./?action=reload_article&amp;id={{ entry.id|e }}" title="{% trans "Reload article" %}"><span>{% trans "Reload article" %}</span></a></li>{% endif %}
5ea5310a
TC
25 {% if constant('EPUB') == 1 %}<li><a href="./?epub&amp;method=id&amp;value={{ entry.id|e }}" title="Generate ePub file">EPUB</a></li>{% endif %}
26 {% if constant('MOBI') == 1 %}<li><a href="./?mobi&amp;method=id&amp;value={{ entry.id|e }}" title="Generate Mobi file">MOBI</a></li>{% endif %}
27 {% if constant('PDF') == 1 %}<li><a href="./?pdf&amp;method=id&amp;value={{ entry.id|e }}" title="Generate PDF file">PDF</a></li>{% endif %}
3e0e7e12 28 <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&amp;body={{ entry.url|url_encode }}" title="{% trans "Does this article appear wrong?" %}" class="tool bad-display"><span>{% trans "Does this article appear wrong?" %}</span></a></li>
c2cf7075 29 {% if constant('SHOW_READPERCENT') == 1 %}<li><div id="readLeftPercent">0%</div></li>{% endif %}
00dc7622 30 {% if navigate.previous %}<li><a href="./?view=view&amp;id={{ navigate.previousid|e }}" class="tool next"><span>{% trans "Previous Article" %}</span></a></li>{% endif %}
4cc3c2ac
NL
31 </ul>
32 </div>
33 <div id="article">
34 <header class="mbm">
35 <h1>{{ entry.title|raw }}</h1>
36 </header>
032e0ca1
MR
37 {% block tags %}
38 <aside class="tags">
39 {% trans "tags:" %} {% for tag in tags %}<a href="./?view=tag&amp;id={{ tag.id }}">{{ tag.value }}</a> {% endfor %}<a href="./?view=edit-tags&amp;id={{ entry.id|e }}" title="{% trans "Edit tags" %}">✎</a>
40 </aside>
41 {% endblock %}
4cc3c2ac
NL
42 <article>
43 {{ content | raw }}
44 </article>
032e0ca1 45 {{ block('tags') }}
4cc3c2ac 46 </div>
eb365a01 47 <script src="{{ poche_url }}themes/_global/js/restoreScroll.js"></script>
4cc3c2ac
NL
48 <script type="text/javascript">
49 $(document).ready(function() {
c2cf7075
MR
50
51 // toggle read property of current article
52 $('#markAsRead').click(function(){
53 $("body").css("cursor", "wait");
54 $.ajax( { url: './?action=toggle_archive&id={{ entry.id|e }}' }).done(
55 function( data ) {
56 if ( data == '1' ) {
57 if ( $('#markAsRead').hasClass("archive-off") ) {
58 $('#markAsRead').removeClass("archive-off");
59 $('#markAsRead').addClass("archive");
60 }
61 else {
62 $('#markAsRead').removeClass("archive");
63 $('#markAsRead').addClass("archive-off");
64 }
65 }
66 else {
67 alert('Error! Pls check if you are logged in.');
68 }
69 });
70 $("body").css("cursor", "auto");
71 });
72
73 // toggle favorite property of current article
74 $('#setFav').click(function(){
75 $("body").css("cursor", "wait");
76 $.ajax( { url: './?action=toggle_fav&id={{ entry.id|e }}' }).done(
77 function( data ) {
78 if ( data == '1' ) {
79 if ( $('#setFav').hasClass("fav-off") ) {
80 $('#setFav').removeClass("fav-off");
81 $('#setFav').addClass("fav");
82 }
83 else {
84 $('#setFav').removeClass("fav");
85 $('#setFav').addClass("fav-off");
86 }
87 }
88 else {
89 alert('Error! Pls check if you are logged in.');
90 }
91 });
92 $("body").css("cursor", "auto");
93 });
94
95 // set percent of read on startup
96 if ( $(document).height() <= $(window).innerHeight() ) {
97 pp = 100;
98 }
99 else {
100 pp = 0;
101 }
102 $('#readLeftPercent').text( pp + '%' );
103
4cc3c2ac
NL
104
105 $(window).scroll(function(e){
106 var scrollTop = $(window).scrollTop();
107 var docHeight = $(document).height();
108 var scrollPercent = (scrollTop) / (docHeight);
109 var scrollPercentRounded = Math.round(scrollPercent*100)/100;
110 savePercent({{ entry.id|e }}, scrollPercentRounded);
c2cf7075
MR
111
112 // change percent of read on scroll
113 pp = Math.round(scrollTop * 100 / ( docHeight - $(window).innerHeight() ));
114 $('#readLeftPercent').text( pp + '%' );
4cc3c2ac
NL
115 });
116
117 retrievePercent({{ entry.id|e }});
118
119 $(window).resize(function(){
120 retrievePercent({{ entry.id|e }});
121 });
122
123 // Hide useless "back to top" link when there is no scrollbar
124 if ($("body").height() <= $(window).height()) {
125 $('#article_toolbar .tool.top').parent().hide();
126 }
127 });
c34a8956
TC
128
129 // Use left and right arrow to navigate on with keyboard
00dc7622 130 navigateKeyboard('?view=view&id={{ navigate.nextid|e }}','?view=view&id={{ navigate.previousid|e }}');
c34a8956 131
032e0ca1 132 </script>
9c55ed09 133{% endblock %}