]>
Commit | Line | Data |
---|---|---|
943ac3c7 NL |
1 | {% extends "layout.twig" %} |
2 | {% block menu %} | |
3 | {% include '_menu.twig' %} | |
4 | {% endblock %} | |
6400371f | 5 | {% block title %}{{ entry.title|raw }} ({{ entry.url | e | getDomain }}){% endblock %} |
943ac3c7 | 6 | {% block content %} |
9f8541ef | 7 | {% include '_highlight.twig' %} |
e139258b | 8 | {% block toolbar %} |
943ac3c7 NL |
9 | <div id="article_toolbar"> |
10 | <ul class="links"> | |
11 | <li class="topPosF"><a href="#top" title="{% trans "Back to top" %}" class="tool top icon icon-arrow-up-thick"><span>{% trans "Back to top" %}</span></a></li> | |
00dc7622 | 12 | {% if navigate.next %}<li class="leftPosF"><a href="./?view=view&id={{ navigate.nextid|e }}" class="top tool icon icon-previous"><span>{% trans "Next Article" %}</span></a></li>{% endif %} |
6400371f | 13 | <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}" class="tool link icon icon-link"><span>{{ entry.url | e | getDomain }}</span></a></li> |
c2cf7075 | 14 | <li><a title="{% trans "Mark as read" %}" class="tool icon icon-check {% 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> |
8a66458b | 15 | {% if navigate.previous %}<li><a title="{% trans "Mark as read and go to next article" %}" class="tool icon icon-archiveandnext" href="./?action=archive_and_next&id={{ entry.id|e }}" id="markAsReadAndNext"><span>{% trans "Toggle mark as read and go to next article" %}</span></a></li>{% endif %} |
c2cf7075 | 16 | <li><a title="{% trans "Favorite" %}" class="tool icon icon-star {% if entry.is_fav == 0 %}fav-off{% else %}fav{% endif %}" href="javascript: void(null);" id="setFav"><span>{% trans "Toggle favorite" %}</span></a></li> |
943ac3c7 NL |
17 | <li><a title="{% trans "Delete" %}" class="tool delete icon icon-trash" href="./?action=delete&id={{ entry.id|e }}"><span>{% trans "Delete" %}</span></a></li> |
18 | {% 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 icon icon-twitter" title="{% trans "Tweet" %}"><span>{% trans "Tweet" %}</span></a></li>{% endif %} | |
65092883 | 19 | {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title }}&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 icon icon-mail" title="{% trans "Email" %}"><span>{% trans "Email" %}</span></a></li>{% endif %} |
943ac3c7 | 20 | {% if constant('SHARE_SHAARLI') == 1 %}<li><a href="{{ constant('SHAARLI_URL') }}/index.php?post={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans "shaarli" %}"><span>{% trans "shaarli" %}</span></a></li>{% endif %} |
d0ea3544 | 21 | {% if constant('SHARE_EVERNOTE') == 1 %}<li><a href="https://www.evernote.com/clip.action?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" target="_blank" class="tool evernote icon icon-evernote" title="{% trans "evernote" %}"><span>{% trans "evernote" %}</span></a></li>{% endif %} |
9c55ed09 | 22 | {% if constant('SHARE_DIASPORA') == 1 %}<li><a href="{{ constant('DIASPORA_URL') }}/bookmarklet?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}¬es=&v=1&noui=1&jump=doclose" target="_blank" class="tool diaspora icon-image icon-image--diaspora" title="{% trans "diaspora" %}"><span>{% trans "diaspora" %}</span></a></li>{% endif %} |
b13376e9 | 23 | {% if constant('FLATTR') == 1 %}{% if flattr.status == constant('FLATTRABLE') %}<li><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr icon icon-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 icon icon-flattr" target="_blank" title="{% trans "flattr" %}"><span>{% trans "flattr" %}</span> ({{ flattr.numFlattrs }})</a></li>{% endif %}{% endif %} |
fc01f943 | 24 | {% 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-image icon-image--carrot" target="_blank" title="{% trans "carrot" %}"><span>Carrot</span></a></li>{% endif %} |
c2cf7075 | 25 | {% if constant('SHOW_PRINTLINK') == 1 %}<li><a title="{% trans "Print" %}" class="tool icon icon-print" href="javascript: window.print();"><span>{% trans "Print" %}</span></a></li>{% endif %} |
44b95cb8 | 26 | {% if constant('RELOAD_ARTICLE') == 1 %}<li><a class="tool reload icon icon-reload" href="./?action=reload_article&id={{ entry.id|e }}" title="{% trans "Reload article" %}"><span>{% trans "Reload article" %}</span></a></li>{% endif %} |
5ea5310a TC |
27 | {% if constant('EPUB') == 1 %}<li><a href="./?epub&method=id&value={{ entry.id|e }}" title="Generate ePub file">EPUB</a></li>{% endif %} |
28 | {% if constant('MOBI') == 1 %}<li><a href="./?mobi&method=id&value={{ entry.id|e }}" title="Generate Mobi file">MOBI</a></li>{% endif %} | |
29 | {% if constant('PDF') == 1 %}<li><a href="./?pdf&method=id&value={{ entry.id|e }}" title="Generate PDF file">PDF</a></li>{% endif %} | |
943ac3c7 | 30 | <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&body={{ entry.url|url_encode }}" title="{% trans "Does this article appear wrong?" %}" class="tool bad-display icon icon-delete"><span>{% trans "Does this article appear wrong?" %}</span></a></li> |
00dc7622 | 31 | {% if navigate.previous %}<li class="rightPosF"><a href="./?view=view&id={{ navigate.previousid|e }}" class="tool icon icon-next"><span>{% trans "Previous Article" %}</span></a></li>{% endif %} |
943ac3c7 NL |
32 | </ul> |
33 | </div> | |
e139258b TC |
34 | {% endblock %} |
35 | ||
943ac3c7 NL |
36 | <div id="article"> |
37 | <header class="mbm"> | |
38 | <h1>{{ entry.title|raw }}</h1> | |
39 | </header> | |
40 | <aside class="tags"> | |
41 | tags: {% for tag in tags %}<a href="./?view=tag&id={{ tag.id }}">{{ tag.value }}</a> {% endfor %}<a href="./?view=edit-tags&id={{ entry.id|e }}" title="{% trans "Edit tags" %}">✎</a> | |
42 | </aside> | |
43 | <article> | |
44 | {{ content | raw }} | |
45 | </article> | |
46 | </div> | |
e139258b | 47 | {{ block('toolbar') }} |
eb365a01 | 48 | <script src="{{ poche_url }}themes/_global/js/restoreScroll.js"></script> |
25114854 NL |
49 | <script type="text/javascript"> |
50 | $(document).ready(function() { | |
c2cf7075 MR |
51 | |
52 | // toggle read property of current article | |
53 | $('#markAsRead').click(function(){ | |
54 | $("body").css("cursor", "wait"); | |
55 | $.ajax( { url: './?action=toggle_archive&id={{ entry.id|e }}' }).done( | |
56 | function( data ) { | |
57 | if ( data == '1' ) { | |
58 | if ( $('#markAsRead').hasClass("archive-off") ) { | |
59 | $('#markAsRead').removeClass("archive-off"); | |
60 | $('#markAsRead').addClass("archive"); | |
61 | } | |
62 | else { | |
63 | $('#markAsRead').removeClass("archive"); | |
64 | $('#markAsRead').addClass("archive-off"); | |
65 | } | |
66 | } | |
67 | else { | |
68 | alert('Error! Pls check if you are logged in.'); | |
69 | } | |
70 | }); | |
71 | $("body").css("cursor", "auto"); | |
72 | }); | |
73 | ||
74 | // toggle favorite property of current article | |
75 | $('#setFav').click(function(){ | |
76 | $("body").css("cursor", "wait"); | |
77 | $.ajax( { url: './?action=toggle_fav&id={{ entry.id|e }}' }).done( | |
78 | function( data ) { | |
79 | if ( data == '1' ) { | |
80 | if ( $('#setFav').hasClass("fav-off") ) { | |
81 | $('#setFav').removeClass("fav-off"); | |
82 | $('#setFav').addClass("fav"); | |
83 | } | |
84 | else { | |
85 | $('#setFav').removeClass("fav"); | |
86 | $('#setFav').addClass("fav-off"); | |
87 | } | |
88 | } | |
89 | else { | |
90 | alert('Error! Pls check if you are logged in.'); | |
91 | } | |
92 | }); | |
93 | $("body").css("cursor", "auto"); | |
94 | }); | |
25114854 NL |
95 | |
96 | $(window).scroll(function(e){ | |
97 | var scrollTop = $(window).scrollTop(); | |
98 | var docHeight = $(document).height(); | |
99 | var scrollPercent = (scrollTop) / (docHeight); | |
100 | var scrollPercentRounded = Math.round(scrollPercent*100)/100; | |
101 | savePercent({{ entry.id|e }}, scrollPercentRounded); | |
102 | }); | |
103 | ||
104 | retrievePercent({{ entry.id|e }}); | |
105 | ||
106 | $(window).resize(function(){ | |
107 | retrievePercent({{ entry.id|e }}); | |
108 | }); | |
109 | }); | |
c34a8956 TC |
110 | |
111 | // Use left and right arrow to navigate on with keyboard | |
00dc7622 | 112 | navigateKeyboard('?view=view&id={{ navigate.nextid|e }}','?view=view&id={{ navigate.previousid|e }}'); |
c34a8956 TC |
113 | |
114 | // swipe to right or left on mobile to navigate | |
115 | $('article').on("swiperight", function(){ | |
116 | goLeft('?view=view&id={{ navigate.nextid|e }}'); | |
117 | }); | |
118 | $('article').on("swipeleft", function(){ | |
119 | goRight('?view=view&id={{ navigate.previousid|e }}'); | |
120 | }); | |
121 | ||
25114854 | 122 | </script> |
fc01f943 | 123 | {% endblock %} |