2013-10-03 12:10:44 +00:00
{% extends "layout.twig" %}
{% block title %} {{ entry .title | raw }} ( {{ entry .url | e | getDomain }} ) {% endblock %}
{% block content %}
2014-07-22 17:17:15 +00:00
{% include '_highlight.twig' %}
2014-03-27 16:21:30 +00:00
{% include '_pocheit-form.twig' %}
2013-10-03 12:10:44 +00:00
<div id="article_toolbar">
<ul>
2015-03-07 21:52:03 +00:00
{% if navigate .next %} <li><a href="./?view=view&id= {{ navigate .nextid | e }} " class="tool previous"><span> {% trans "Next Article" %} </span></a></li> {% endif %}
2013-12-15 05:18:26 +00:00
<li><a href="./" title=" {% trans "Return home" %} " class="tool back"><span> {% trans "Return home" %} </span></a></li>
<li><a href="#top" title=" {% trans "Back to top" %} " class="tool top"><span> {% trans "Back to top" %} </span></a></li>
2013-10-03 12:10:44 +00:00
<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>
2014-04-22 07:45:09 +00:00
<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>
2015-03-01 23:15:49 +00:00
{% if navigate .next %} <li><a title=" {% trans "Mark as read and go to next article" %} " class="tool archiveandnext" href="./?action=archive_and_next&id= {{ entry .id | e }} " id="markAsReadAndNext"><span> {% trans "Toggle mark as read and go to next article" %} </span></a></li> {% endif %}
2014-04-22 07:45:09 +00:00
<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>
2013-12-15 05:18:26 +00:00
<li><a title=" {% trans "Delete" %} " class="tool delete" href="./?action=delete&id= {{ entry .id | e }} "><span> {% trans "Delete" %} </span></a></li>
2014-01-28 09:37:37 +00:00
{% 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 %}
2015-02-14 14:22:20 +00:00
{% if constant ( 'SHARE_MAIL' ) == 1 %} <li><a href="mailto:?subject= {{ entry .title }} &body= {{ content | striptags | slice ( 0 , 7 0 0 ) }} %2E%2E%2E%0A%0A {% trans "Read the rest at" %} {{ entry .url | url_encode }} %20via%20@wallabagapp" class="tool email" title=" {% trans "Email" %} "><span> {% trans "Email" %} </span></a></li> {% endif %}
2013-10-03 12:10:44 +00:00
{% 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 %}
2015-02-04 22:50:33 +00:00
{% if constant ( 'SHARE_EVERNOTE' ) == 1 %} <li><a href="https://www.evernote.com/clip.action?url= {{ entry .url | url_encode }} &title= {{ entry .title | url_encode }} " target="_blank" class="tool evernote" title=" {% trans "evernote" %} "><span> {% trans "evernote" %} </span></a></li> {% endif %}
2014-12-07 21:24:25 +00:00
{% 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 %}
2014-11-19 15:35:44 +00:00
{% 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 %}
2014-11-19 15:27:56 +00:00
{% 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 %}
2014-04-22 07:45:09 +00:00
{% if constant ( 'SHOW_PRINTLINK' ) == 1 %} <li><a title=" {% trans "Print" %} " class="tool print" href="javascript: window.print();"><span> {% trans "Print" %} </span></a></li> {% endif %}
2015-03-18 21:42:26 +00:00
{% if constant ( 'RELOAD_ARTICLE' ) == 1 %} <li><a class="tool reload" href="./?action=reload_article&id= {{ entry .id | e }} " title=" {% trans "Reload article" %} "><span> {% trans "Reload article" %} </span></a></li> {% endif %}
2014-12-14 14:17:39 +00:00
{% if constant ( 'EPUB' ) == 1 %} <li><a href="./?epub&method=id&value= {{ entry .id | e }} " title="Generate ePub file">EPUB</a></li> {% endif %}
{% if constant ( 'MOBI' ) == 1 %} <li><a href="./?mobi&method=id&value= {{ entry .id | e }} " title="Generate Mobi file">MOBI</a></li> {% endif %}
{% if constant ( 'PDF' ) == 1 %} <li><a href="./?pdf&method=id&value= {{ entry .id | e }} " title="Generate PDF file">PDF</a></li> {% endif %}
2014-01-28 09:49:57 +00:00
<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>
2014-04-22 07:45:09 +00:00
{% if constant ( 'SHOW_READPERCENT' ) == 1 %} <li><div id="readLeftPercent">0%</div></li> {% endif %}
2015-03-07 21:52:03 +00:00
{% if navigate .previous %} <li><a href="./?view=view&id= {{ navigate .previousid | e }} " class="tool next"><span> {% trans "Previous Article" %} </span></a></li> {% endif %}
2013-10-03 12:10:44 +00:00
</ul>
</div>
<div id="article">
<header class="mbm">
<h1> {{ entry .title | raw }} </h1>
</header>
2014-02-20 17:28:39 +00:00
{% block tags %}
<aside class="tags">
{% 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>
</aside>
{% endblock %}
2013-10-03 12:10:44 +00:00
<article>
{{ content | raw }}
</article>
2014-02-20 17:28:39 +00:00
{{ block ( 'tags' ) }}
2013-10-03 12:10:44 +00:00
</div>
2014-11-18 15:01:37 +00:00
<script src=" {{ poche_url }} themes/_global/js/restoreScroll.js"></script>
2013-10-03 12:10:44 +00:00
<script type="text/javascript">
$(document).ready(function() {
2014-04-22 07:45:09 +00:00
// toggle read property of current article
$('#markAsRead').click(function() {
$("body").css("cursor", "wait");
$.ajax( { url: './?action=toggle_archive&id= {{ entry .id | e }} ' }).done(
function( data ) {
if ( data == '1' ) {
if ( $('#markAsRead').hasClass("archive-off") ) {
$('#markAsRead').removeClass("archive-off");
$('#markAsRead').addClass("archive");
}
else {
$('#markAsRead').removeClass("archive");
$('#markAsRead').addClass("archive-off");
}
}
else {
alert('Error! Pls check if you are logged in.');
}
});
$("body").css("cursor", "auto");
});
// toggle favorite property of current article
$('#setFav').click(function() {
$("body").css("cursor", "wait");
$.ajax( { url: './?action=toggle_fav&id= {{ entry .id | e }} ' }).done(
function( data ) {
if ( data == '1' ) {
if ( $('#setFav').hasClass("fav-off") ) {
$('#setFav').removeClass("fav-off");
$('#setFav').addClass("fav");
}
else {
$('#setFav').removeClass("fav");
$('#setFav').addClass("fav-off");
}
}
else {
alert('Error! Pls check if you are logged in.');
}
});
$("body").css("cursor", "auto");
});
// set percent of read on startup
if ( $(document).height() <= $(window).innerHeight() ) {
pp = 100;
}
else {
pp = 0;
}
$('#readLeftPercent').text( pp + '%' );
2013-10-03 12:10:44 +00:00
$(window).scroll(function(e) {
var scrollTop = $(window).scrollTop();
var docHeight = $(document).height();
var scrollPercent = (scrollTop) / (docHeight);
var scrollPercentRounded = Math.round(scrollPercent*100)/100;
savePercent( {{ entry .id | e }} , scrollPercentRounded);
2014-04-22 07:45:09 +00:00
// change percent of read on scroll
pp = Math.round(scrollTop * 100 / ( docHeight - $(window).innerHeight() ));
$('#readLeftPercent').text( pp + '%' );
2013-10-03 12:10:44 +00:00
});
retrievePercent( {{ entry .id | e }} );
$(window).resize(function() {
retrievePercent( {{ entry .id | e }} );
});
// Hide useless "back to top" link when there is no scrollbar
if ($("body").height() <= $(window).height()) {
$('#article_toolbar .tool.top').parent().hide();
}
});
2015-03-07 22:59:27 +00:00
// Use left and right arrow to navigate on with keyboard
2015-03-07 21:52:03 +00:00
navigateKeyboard('?view=view&id= {{ navigate .nextid | e }} ','?view=view&id= {{ navigate .previousid | e }} ');
2015-03-07 22:59:27 +00:00
// swipe to right or left on mobile to navigate
$('article').on("swiperight", function() {
goLeft('?view=view&id= {{ navigate .nextid | e }} ');
});
$('article').on("swipeleft", function() {
goRight('?view=view&id= {{ navigate .previousid | e }} ');
});
2014-02-20 17:28:39 +00:00
</script>
2014-12-07 21:24:25 +00:00
{% endblock %}