diff options
author | Nicolas Lœuillet <nicolas@loeuillet.org> | 2015-01-21 16:04:05 +0100 |
---|---|---|
committer | Nicolas Lœuillet <nicolas@loeuillet.org> | 2015-01-21 16:04:05 +0100 |
commit | 0440249631164a378981d014bf71b617c082bf5a (patch) | |
tree | 740d4e798c954374f115927ebc434d393368ab46 /themes/default/view.twig | |
parent | 3eb951572d3f22ad37395afceb4a739ad8cd0fd6 (diff) | |
download | wallabag-0440249631164a378981d014bf71b617c082bf5a.tar.gz wallabag-0440249631164a378981d014bf71b617c082bf5a.tar.zst wallabag-0440249631164a378981d014bf71b617c082bf5a.zip |
move templates into resources
Diffstat (limited to 'themes/default/view.twig')
-rwxr-xr-x | themes/default/view.twig | 124 |
1 files changed, 0 insertions, 124 deletions
diff --git a/themes/default/view.twig b/themes/default/view.twig deleted file mode 100755 index 8f3a26c3..00000000 --- a/themes/default/view.twig +++ /dev/null | |||
@@ -1,124 +0,0 @@ | |||
1 | {% extends "layout.twig" %} | ||
2 | {% block title %}{{ entry.title|raw }} ({{ entry.url | e | getDomain }}){% endblock %} | ||
3 | {% block content %} | ||
4 | {% include '_highlight.twig' %} | ||
5 | {% include '_pocheit-form.twig' %} | ||
6 | <div id="article_toolbar"> | ||
7 | <ul> | ||
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> | ||
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> | ||
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> | ||
13 | <li><a title="{% trans "Delete" %}" class="tool delete" href="./?action=delete&id={{ entry.id|e }}"><span>{% trans "Delete" %}</span></a></li> | ||
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 %} | ||
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 %} | ||
17 | {% 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 %} | ||
18 | {% 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 %} | ||
19 | {% 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 %} | ||
20 | {% if constant('SHOW_PRINTLINK') == 1 %}<li><a title="{% trans "Print" %}" class="tool print" href="javascript: window.print();"><span>{% trans "Print" %}</span></a></li>{% endif %} | ||
21 | {% if constant('EPUB') == 1 %}<li><a href="./?epub&method=id&value={{ entry.id|e }}" title="Generate ePub file">EPUB</a></li>{% endif %} | ||
22 | {% if constant('MOBI') == 1 %}<li><a href="./?mobi&method=id&value={{ entry.id|e }}" title="Generate Mobi file">MOBI</a></li>{% endif %} | ||
23 | {% if constant('PDF') == 1 %}<li><a href="./?pdf&method=id&value={{ entry.id|e }}" title="Generate PDF file">PDF</a></li>{% endif %} | ||
24 | <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> | ||
25 | {% if constant('SHOW_READPERCENT') == 1 %}<li><div id="readLeftPercent">0%</div></li>{% endif %} | ||
26 | </ul> | ||
27 | </div> | ||
28 | <div id="article"> | ||
29 | <header class="mbm"> | ||
30 | <h1>{{ entry.title|raw }}</h1> | ||
31 | </header> | ||
32 | {% block tags %} | ||
33 | <aside class="tags"> | ||
34 | {% 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> | ||
35 | </aside> | ||
36 | {% endblock %} | ||
37 | <article> | ||
38 | {{ content | raw }} | ||
39 | </article> | ||
40 | {{ block('tags') }} | ||
41 | </div> | ||
42 | <script src="{{ poche_url }}themes/_global/js/restoreScroll.js"></script> | ||
43 | <script type="text/javascript"> | ||
44 | $(document).ready(function() { | ||
45 | |||
46 | // toggle read property of current article | ||
47 | $('#markAsRead').click(function(){ | ||
48 | $("body").css("cursor", "wait"); | ||
49 | $.ajax( { url: './?action=toggle_archive&id={{ entry.id|e }}' }).done( | ||
50 | function( data ) { | ||
51 | if ( data == '1' ) { | ||
52 | if ( $('#markAsRead').hasClass("archive-off") ) { | ||
53 | $('#markAsRead').removeClass("archive-off"); | ||
54 | $('#markAsRead').addClass("archive"); | ||
55 | } | ||
56 | else { | ||
57 | $('#markAsRead').removeClass("archive"); | ||
58 | $('#markAsRead').addClass("archive-off"); | ||
59 | } | ||
60 | } | ||
61 | else { | ||
62 | alert('Error! Pls check if you are logged in.'); | ||
63 | } | ||
64 | }); | ||
65 | $("body").css("cursor", "auto"); | ||
66 | }); | ||
67 | |||
68 | // toggle favorite property of current article | ||
69 | $('#setFav').click(function(){ | ||
70 | $("body").css("cursor", "wait"); | ||
71 | $.ajax( { url: './?action=toggle_fav&id={{ entry.id|e }}' }).done( | ||
72 | function( data ) { | ||
73 | if ( data == '1' ) { | ||
74 | if ( $('#setFav').hasClass("fav-off") ) { | ||
75 | $('#setFav').removeClass("fav-off"); | ||
76 | $('#setFav').addClass("fav"); | ||
77 | } | ||
78 | else { | ||
79 | $('#setFav').removeClass("fav"); | ||
80 | $('#setFav').addClass("fav-off"); | ||
81 | } | ||
82 | } | ||
83 | else { | ||
84 | alert('Error! Pls check if you are logged in.'); | ||
85 | } | ||
86 | }); | ||
87 | $("body").css("cursor", "auto"); | ||
88 | }); | ||
89 | |||
90 | // set percent of read on startup | ||
91 | if ( $(document).height() <= $(window).innerHeight() ) { | ||
92 | pp = 100; | ||
93 | } | ||
94 | else { | ||
95 | pp = 0; | ||
96 | } | ||
97 | $('#readLeftPercent').text( pp + '%' ); | ||
98 | |||
99 | |||
100 | $(window).scroll(function(e){ | ||
101 | var scrollTop = $(window).scrollTop(); | ||
102 | var docHeight = $(document).height(); | ||
103 | var scrollPercent = (scrollTop) / (docHeight); | ||
104 | var scrollPercentRounded = Math.round(scrollPercent*100)/100; | ||
105 | savePercent({{ entry.id|e }}, scrollPercentRounded); | ||
106 | |||
107 | // change percent of read on scroll | ||
108 | pp = Math.round(scrollTop * 100 / ( docHeight - $(window).innerHeight() )); | ||
109 | $('#readLeftPercent').text( pp + '%' ); | ||
110 | }); | ||
111 | |||
112 | retrievePercent({{ entry.id|e }}); | ||
113 | |||
114 | $(window).resize(function(){ | ||
115 | retrievePercent({{ entry.id|e }}); | ||
116 | }); | ||
117 | |||
118 | // Hide useless "back to top" link when there is no scrollbar | ||
119 | if ($("body").height() <= $(window).height()) { | ||
120 | $('#article_toolbar .tool.top').parent().hide(); | ||
121 | } | ||
122 | }); | ||
123 | </script> | ||
124 | {% endblock %} | ||