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