]>
Commit | Line | Data |
---|---|---|
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> | |
43c1115e WT |
8 | <li><a href="./" title="{% trans "Return home" %}" class="tool back"><span>{% trans "Return home" %}</span></a></li> |
9 | <li><a href="#top" title="{% trans "Back to top" %}" class="tool top"><span>{% trans "Back to top" %}</span></a></li> | |
4cc3c2ac | 10 | <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 MR |
11 | <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> |
12 | <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 | 13 | <li><a title="{% trans "Delete" %}" class="tool delete" href="./?action=delete&id={{ entry.id|e }}"><span>{% trans "Delete" %}</span></a></li> |
b8fdd2d8 NL |
14 | {% 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 %} |
15 | {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email" title="{% trans "Email" %}"><span>{% trans "Email" %}</span></a></li>{% endif %} | |
4cc3c2ac | 16 | {% 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 %} |
571b99e8 | 17 | {% 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" title="{% trans "evernote" %}"><span>{% trans "evernote" %}</span></a></li>{% endif %} |
9c55ed09 | 18 | {% 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" title="{% trans "diaspora" %}"><span>{% trans "diaspora" %}</span></a></li>{% endif %} |
b13376e9 | 19 | {% 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 | 20 | {% 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 | 21 | {% if constant('SHOW_PRINTLINK') == 1 %}<li><a title="{% trans "Print" %}" class="tool print" href="javascript: window.print();"><span>{% trans "Print" %}</span></a></li>{% endif %} |
44b95cb8 | 22 | {% if constant('RELOAD_ARTICLE') == 1 %}<li><a class="tool reload" href="./?action=reload_article&id={{ entry.id|e }}" title="{% trans "Reload article" %}"><span>{% trans "Reload article" %}</span></a></li>{% endif %}} |
5ea5310a TC |
23 | {% if constant('EPUB') == 1 %}<li><a href="./?epub&method=id&value={{ entry.id|e }}" title="Generate ePub file">EPUB</a></li>{% endif %} |
24 | {% if constant('MOBI') == 1 %}<li><a href="./?mobi&method=id&value={{ entry.id|e }}" title="Generate Mobi file">MOBI</a></li>{% endif %} | |
25 | {% if constant('PDF') == 1 %}<li><a href="./?pdf&method=id&value={{ entry.id|e }}" title="Generate PDF file">PDF</a></li>{% endif %} | |
3e0e7e12 | 26 | <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"><span>{% trans "Does this article appear wrong?" %}</span></a></li> |
c2cf7075 | 27 | {% if constant('SHOW_READPERCENT') == 1 %}<li><div id="readLeftPercent">0%</div></li>{% endif %} |
4cc3c2ac NL |
28 | </ul> |
29 | </div> | |
30 | <div id="article"> | |
31 | <header class="mbm"> | |
32 | <h1>{{ entry.title|raw }}</h1> | |
33 | </header> | |
032e0ca1 MR |
34 | {% block tags %} |
35 | <aside class="tags"> | |
36 | {% trans "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> | |
37 | </aside> | |
38 | {% endblock %} | |
4cc3c2ac NL |
39 | <article> |
40 | {{ content | raw }} | |
41 | </article> | |
032e0ca1 | 42 | {{ block('tags') }} |
4cc3c2ac | 43 | </div> |
eb365a01 | 44 | <script src="{{ poche_url }}themes/_global/js/restoreScroll.js"></script> |
4cc3c2ac NL |
45 | <script type="text/javascript"> |
46 | $(document).ready(function() { | |
c2cf7075 MR |
47 | |
48 | // toggle read property of current article | |
49 | $('#markAsRead').click(function(){ | |
50 | $("body").css("cursor", "wait"); | |
51 | $.ajax( { url: './?action=toggle_archive&id={{ entry.id|e }}' }).done( | |
52 | function( data ) { | |
53 | if ( data == '1' ) { | |
54 | if ( $('#markAsRead').hasClass("archive-off") ) { | |
55 | $('#markAsRead').removeClass("archive-off"); | |
56 | $('#markAsRead').addClass("archive"); | |
57 | } | |
58 | else { | |
59 | $('#markAsRead').removeClass("archive"); | |
60 | $('#markAsRead').addClass("archive-off"); | |
61 | } | |
62 | } | |
63 | else { | |
64 | alert('Error! Pls check if you are logged in.'); | |
65 | } | |
66 | }); | |
67 | $("body").css("cursor", "auto"); | |
68 | }); | |
69 | ||
70 | // toggle favorite property of current article | |
71 | $('#setFav').click(function(){ | |
72 | $("body").css("cursor", "wait"); | |
73 | $.ajax( { url: './?action=toggle_fav&id={{ entry.id|e }}' }).done( | |
74 | function( data ) { | |
75 | if ( data == '1' ) { | |
76 | if ( $('#setFav').hasClass("fav-off") ) { | |
77 | $('#setFav').removeClass("fav-off"); | |
78 | $('#setFav').addClass("fav"); | |
79 | } | |
80 | else { | |
81 | $('#setFav').removeClass("fav"); | |
82 | $('#setFav').addClass("fav-off"); | |
83 | } | |
84 | } | |
85 | else { | |
86 | alert('Error! Pls check if you are logged in.'); | |
87 | } | |
88 | }); | |
89 | $("body").css("cursor", "auto"); | |
90 | }); | |
91 | ||
92 | // set percent of read on startup | |
93 | if ( $(document).height() <= $(window).innerHeight() ) { | |
94 | pp = 100; | |
95 | } | |
96 | else { | |
97 | pp = 0; | |
98 | } | |
99 | $('#readLeftPercent').text( pp + '%' ); | |
100 | ||
4cc3c2ac NL |
101 | |
102 | $(window).scroll(function(e){ | |
103 | var scrollTop = $(window).scrollTop(); | |
104 | var docHeight = $(document).height(); | |
105 | var scrollPercent = (scrollTop) / (docHeight); | |
106 | var scrollPercentRounded = Math.round(scrollPercent*100)/100; | |
107 | savePercent({{ entry.id|e }}, scrollPercentRounded); | |
c2cf7075 MR |
108 | |
109 | // change percent of read on scroll | |
110 | pp = Math.round(scrollTop * 100 / ( docHeight - $(window).innerHeight() )); | |
111 | $('#readLeftPercent').text( pp + '%' ); | |
4cc3c2ac NL |
112 | }); |
113 | ||
114 | retrievePercent({{ entry.id|e }}); | |
115 | ||
116 | $(window).resize(function(){ | |
117 | retrievePercent({{ entry.id|e }}); | |
118 | }); | |
119 | ||
120 | // Hide useless "back to top" link when there is no scrollbar | |
121 | if ($("body").height() <= $(window).height()) { | |
122 | $('#article_toolbar .tool.top').parent().hide(); | |
123 | } | |
124 | }); | |
032e0ca1 | 125 | </script> |
9c55ed09 | 126 | {% endblock %} |