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