]> git.immae.eu Git - github/wallabag/wallabag.git/blob - themes/default/view.twig
9dca588889310bfd87ae702d5184c8b88b9fc130
[github/wallabag/wallabag.git] / themes / default / view.twig
1 {% extends "layout.twig" %}
2 {% block title %}{{ entry.title|raw }} ({{ entry.url | e | getDomain }}){% endblock %}
3 {% block content %}
4 <div id="article_toolbar">
5 <ul>
6 <li><a href="./" title="{% trans "Return home" %}" class="tool back"><span>{% trans "Return home" %}</span></a></li>
7 <li><a href="#top" title="{% trans "Back to top" %}" class="tool top"><span>{% trans "Back to top" %}</span></a></li>
8 <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>
9 <li><a title="{% trans "Mark as read" %}" class="tool {% if entry.is_read == 0 %}archive-off{% else %}archive{% endif %}" href="./?action=toggle_archive&amp;id={{ entry.id|e }}"><span>{% trans "Toggle mark as read" %}</span></a></li>
10 <li><a title="{% trans "Favorite" %}" class="tool {% if entry.is_fav == 0 %}fav-off{% else %}fav{% endif %}" href="./?action=toggle_fav&amp;id={{ entry.id|e }}"><span>{% trans "Toggle favorite" %}</span></a></li>
11 <li><a title="{% trans "Delete" %}" class="tool delete" href="./?action=delete&amp;id={{ entry.id|e }}"><span>{% trans "Delete" %}</span></a></li>
12 {% if constant('SHARE_TWITTER') == 1 %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@getpoche" target="_blank" class="tool twitter" title="{% trans "Tweet" %}"><span>{% trans "Tweet" %}</span></a></li>{% endif %}
13 {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@getpoche" class="tool email" title="{% trans "Email" %}"><span>{% trans "Email" %}</span></a></li>{% endif %}
14 {% 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 %}
15 {% 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 %}
16 <li><a href="mailto:support@inthepoche.com?subject=Wrong%20display%20in%20poche&amp;body={{ entry.url|url_encode }}" title="{% trans "Report article appears wrong?" %}" class="tool bad-display"><span>{% trans "this article appears wrong?" %}</span></a></li>
17 </ul>
18 </div>
19 <div id="article">
20 <header class="mbm">
21 <h1>{{ entry.title|raw }}</h1>
22 </header>
23 <aside class="tags">
24 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>
25 </aside>
26 <article>
27 {{ content | raw }}
28 </article>
29 </div>
30 <script src="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/js/restoreScroll.js"></script>
31 <script type="text/javascript">
32 $(document).ready(function() {
33
34 $(window).scroll(function(e){
35 var scrollTop = $(window).scrollTop();
36 var docHeight = $(document).height();
37 var scrollPercent = (scrollTop) / (docHeight);
38 var scrollPercentRounded = Math.round(scrollPercent*100)/100;
39 savePercent({{ entry.id|e }}, scrollPercentRounded);
40 });
41
42 retrievePercent({{ entry.id|e }});
43
44 $(window).resize(function(){
45 retrievePercent({{ entry.id|e }});
46 });
47
48 // Hide useless "back to top" link when there is no scrollbar
49 if ($("body").height() <= $(window).height()) {
50 $('#article_toolbar .tool.top').parent().hide();
51 }
52 });
53 </script>
54 {% endblock %}