]> git.immae.eu Git - github/wallabag/wallabag.git/blob - themes/baggy/view.twig
41766bf2e9114e06e9ebb3e2c141c20ebba97f25
[github/wallabag/wallabag.git] / themes / baggy / view.twig
1 {% extends "layout.twig" %}
2 {% block menu %}
3 {% include '_menu.twig' %}
4 {% endblock %}
5 {% block title %}{{ entry.title|raw }} ({{ entry.url | e | getDomain }}){% endblock %}
6 {% block content %}
7 {% include '_highlight.twig' %}
8 <div id="article_toolbar">
9 <ul class="links">
10 <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>
11 <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>
12 <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>
13 <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>
14 <li><a title="{% trans "Delete" %}" class="tool delete icon icon-trash" href="./?action=delete&amp;id={{ entry.id|e }}"><span>{% trans "Delete" %}</span></a></li>
15 {% 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 %}
16 {% if constant('SHARE_MAIL') == 1 %}<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="{% trans "Email" %}"><span>{% trans "Email" %}</span></a></li>{% endif %}
17 {% 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 %}
18 {% 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 icon-image icon-image--diaspora" title="{% trans "diaspora" %}"><span>{% trans "diaspora" %}</span></a></li>{% endif %}
19 {% 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 %}
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-image icon-image--carrot" target="_blank" title="{% trans "carrot" %}"><span>Carrot</span></a></li>{% endif %}
21 {% 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 %}
22 <li><a href="./?epub&amp;method=id&amp;value={{ entry.id|e }}" title="Generate epub file">EPUB</a></li>
23 {% if constant('RELOAD_ARTICLE') == 1 %}<li><a class="tool reload icon icon-reload" href="./?action=reload_article&amp;id={{ entry.id|e }}" title="{% trans "Reload article" %}"><span>{% trans "Reload article" %}</span></a></li>{% endif %}
24 <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 icon icon-delete"><span>{% trans "Does this article appear wrong?" %}</span></a></li>
25 </ul>
26 </div>
27 <div id="article">
28 <header class="mbm">
29 <h1>{{ entry.title|raw }}</h1>
30 </header>
31 <aside class="tags">
32 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>
33 </aside>
34 <article>
35 {{ content | raw }}
36 </article>
37 </div>
38 <script src="{{ poche_url }}themes/_global/js/restoreScroll.js"></script>
39 <script type="text/javascript">
40 $(document).ready(function() {
41
42 // toggle read property of current article
43 $('#markAsRead').click(function(){
44 $("body").css("cursor", "wait");
45 $.ajax( { url: './?action=toggle_archive&id={{ entry.id|e }}' }).done(
46 function( data ) {
47 if ( data == '1' ) {
48 if ( $('#markAsRead').hasClass("archive-off") ) {
49 $('#markAsRead').removeClass("archive-off");
50 $('#markAsRead').addClass("archive");
51 }
52 else {
53 $('#markAsRead').removeClass("archive");
54 $('#markAsRead').addClass("archive-off");
55 }
56 }
57 else {
58 alert('Error! Pls check if you are logged in.');
59 }
60 });
61 $("body").css("cursor", "auto");
62 });
63
64 // toggle favorite property of current article
65 $('#setFav').click(function(){
66 $("body").css("cursor", "wait");
67 $.ajax( { url: './?action=toggle_fav&id={{ entry.id|e }}' }).done(
68 function( data ) {
69 if ( data == '1' ) {
70 if ( $('#setFav').hasClass("fav-off") ) {
71 $('#setFav').removeClass("fav-off");
72 $('#setFav').addClass("fav");
73 }
74 else {
75 $('#setFav').removeClass("fav");
76 $('#setFav').addClass("fav-off");
77 }
78 }
79 else {
80 alert('Error! Pls check if you are logged in.');
81 }
82 });
83 $("body").css("cursor", "auto");
84 });
85
86 $(window).scroll(function(e){
87 var scrollTop = $(window).scrollTop();
88 var docHeight = $(document).height();
89 var scrollPercent = (scrollTop) / (docHeight);
90 var scrollPercentRounded = Math.round(scrollPercent*100)/100;
91 savePercent({{ entry.id|e }}, scrollPercentRounded);
92 });
93
94 retrievePercent({{ entry.id|e }});
95
96 $(window).resize(function(){
97 retrievePercent({{ entry.id|e }});
98 });
99 });
100 </script>
101 {% endblock %}