--- /dev/null
+<?php\r
+//--------------------------------------------------------------------------------------------------\r
+// Session-Based Flash Messages v1.0\r
+// Copyright 2012 Mike Everhart (http://mikeeverhart.net)\r
+//\r
+// Licensed under the Apache License, Version 2.0 (the "License");\r
+// you may not use this file except in compliance with the License.\r
+// You may obtain a copy of the License at\r
+//\r
+// http://www.apache.org/licenses/LICENSE-2.0\r
+//\r
+// Unless required by applicable law or agreed to in writing, software\r
+// distributed under the License is distributed on an "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+// See the License for the specific language governing permissions and\r
+// limitations under the License.\r
+// \r
+//------------------------------------------------------------------------------\r
+// Description:\r
+//------------------------------------------------------------------------------\r
+//\r
+// Stores messages in Session data to be easily retrieved later on.\r
+// This class includes four different types of messages:\r
+// - Success\r
+// - Error\r
+// - Warning\r
+// - Information\r
+// \r
+// See README for basic usage instructions, or see samples/index.php for more advanced samples\r
+//\r
+//--------------------------------------------------------------------------------------------------\r
+// Changelog\r
+//--------------------------------------------------------------------------------------------------\r
+// \r
+// 2011-05-15 - v1.0 - Initial Version\r
+//\r
+//--------------------------------------------------------------------------------------------------\r
+\r
+class Messages {\r
+ \r
+ //-----------------------------------------------------------------------------------------------\r
+ // Class Variables\r
+ //----------------------------------------------------------------------------------------------- \r
+ var $msgId;\r
+ var $msgTypes = array( 'help', 'info', 'warning', 'success', 'error' );\r
+ var $msgClass = 'messages';\r
+ var $msgWrapper = "<div class='%s %s'><a href='#' class='closeMessage'>X</a>\n%s</div>\n";\r
+ var $msgBefore = '<p>';\r
+ var $msgAfter = "</p>\n";\r
+\r
+ \r
+ /**\r
+ * Constructor\r
+ * @author Mike Everhart\r
+ */\r
+ public function __construct() {\r
+ \r
+ // Generate a unique ID for this user and session\r
+ $this->msgId = md5(uniqid());\r
+ \r
+ // Create the session array if it doesnt already exist\r
+ if( !array_key_exists('flash_messages', $_SESSION) ) $_SESSION['flash_messages'] = array();\r
+ \r
+ }\r
+ \r
+ /**\r
+ * Add a message to the queue\r
+ * \r
+ * @author Mike Everhart\r
+ * \r
+ * @param string $type The type of message to add\r
+ * @param string $message The message\r
+ * @param string $redirect_to (optional) If set, the user will be redirected to this URL\r
+ * @return bool \r
+ * \r
+ */\r
+ public function add($type, $message, $redirect_to=null) {\r
+ \r
+ if( !isset($_SESSION['flash_messages']) ) return false;\r
+ \r
+ if( !isset($type) || !isset($message[0]) ) return false;\r
+\r
+ // Replace any shorthand codes with their full version\r
+ if( strlen(trim($type)) == 1 ) {\r
+ $type = str_replace( array('h', 'i', 'w', 'e', 's'), array('help', 'info', 'warning', 'error', 'success'), $type );\r
+ \r
+ // Backwards compatibility...\r
+ } elseif( $type == 'information' ) {\r
+ $type = 'info'; \r
+ }\r
+ \r
+ // Make sure it's a valid message type\r
+ if( !in_array($type, $this->msgTypes) ) die('"' . strip_tags($type) . '" is not a valid message type!' );\r
+ \r
+ // If the session array doesn't exist, create it\r
+ if( !array_key_exists( $type, $_SESSION['flash_messages'] ) ) $_SESSION['flash_messages'][$type] = array();\r
+ \r
+ $_SESSION['flash_messages'][$type][] = $message;\r
+\r
+ if( !is_null($redirect_to) ) {\r
+ header("Location: $redirect_to");\r
+ exit();\r
+ }\r
+ \r
+ return true;\r
+ \r
+ }\r
+ \r
+ //-----------------------------------------------------------------------------------------------\r
+ // display()\r
+ // print queued messages to the screen\r
+ //-----------------------------------------------------------------------------------------------\r
+ /**\r
+ * Display the queued messages\r
+ * \r
+ * @author Mike Everhart\r
+ * \r
+ * @param string $type Which messages to display\r
+ * @param bool $print True = print the messages on the screen\r
+ * @return mixed \r
+ * \r
+ */\r
+ public function display($type='all', $print=true) {\r
+ $messages = '';\r
+ $data = '';\r
+ \r
+ if( !isset($_SESSION['flash_messages']) ) return false;\r
+ \r
+ if( $type == 'g' || $type == 'growl' ) {\r
+ $this->displayGrowlMessages();\r
+ return true;\r
+ }\r
+ \r
+ // Print a certain type of message?\r
+ if( in_array($type, $this->msgTypes) ) {\r
+ foreach( $_SESSION['flash_messages'][$type] as $msg ) {\r
+ $messages .= $this->msgBefore . $msg . $this->msgAfter;\r
+ }\r
+\r
+ $data .= sprintf($this->msgWrapper, $this->msgClass, $type, $messages);\r
+ \r
+ // Clear the viewed messages\r
+ $this->clear($type);\r
+ \r
+ // Print ALL queued messages\r
+ } elseif( $type == 'all' ) {\r
+ foreach( $_SESSION['flash_messages'] as $type => $msgArray ) {\r
+ $messages = '';\r
+ foreach( $msgArray as $msg ) {\r
+ $messages .= $this->msgBefore . $msg . $this->msgAfter; \r
+ }\r
+ $data .= sprintf($this->msgWrapper, $this->msgClass, $type, $messages);\r
+ }\r
+ \r
+ // Clear ALL of the messages\r
+ $this->clear();\r
+ \r
+ // Invalid Message Type?\r
+ } else { \r
+ return false;\r
+ }\r
+ \r
+ // Print everything to the screen or return the data\r
+ if( $print ) { \r
+ echo $data; \r
+ } else { \r
+ return $data; \r
+ }\r
+ }\r
+ \r
+ \r
+ /**\r
+ * Check to see if there are any queued error messages\r
+ * \r
+ * @author Mike Everhart\r
+ * \r
+ * @return bool true = There ARE error messages\r
+ * false = There are NOT any error messages\r
+ * \r
+ */\r
+ public function hasErrors() { \r
+ return empty($_SESSION['flash_messages']['error']) ? false : true; \r
+ }\r
+ \r
+ /**\r
+ * Check to see if there are any ($type) messages queued\r
+ * \r
+ * @author Mike Everhart\r
+ * \r
+ * @param string $type The type of messages to check for\r
+ * @return bool \r
+ * \r
+ */\r
+ public function hasMessages($type=null) {\r
+ if( !is_null($type) ) {\r
+ if( !empty($_SESSION['flash_messages'][$type]) ) return $_SESSION['flash_messages'][$type]; \r
+ } else {\r
+ foreach( $this->msgTypes as $type ) {\r
+ if( !empty($_SESSION['flash_messages']) ) return true; \r
+ }\r
+ }\r
+ return false;\r
+ }\r
+ \r
+ /**\r
+ * Clear messages from the session data\r
+ * \r
+ * @author Mike Everhart\r
+ * \r
+ * @param string $type The type of messages to clear\r
+ * @return bool \r
+ * \r
+ */\r
+ public function clear($type='all') { \r
+ if( $type == 'all' ) {\r
+ unset($_SESSION['flash_messages']); \r
+ } else {\r
+ unset($_SESSION['flash_messages'][$type]);\r
+ }\r
+ return true;\r
+ }\r
+ \r
+ public function __toString() { return $this->hasMessages(); }\r
+\r
+ public function __destruct() {\r
+ //$this->clear();\r
+ }\r
+\r
+\r
+} // end class\r
+?>
\ No newline at end of file
{
public $store;
public $tpl;
+ public $messages;
function __construct($storage_type)
{
'cache' => CACHE,
));
$this->tpl->addExtension(new Twig_Extensions_Extension_I18n());
+ # filter to display domain name of an url
+ $filter = new Twig_SimpleFilter('getDomain', 'Tools::getDomain');
+ $this->tpl->addFilter($filter);
Tools::initPhp();
Session::init();
case 'toggle_fav' :
$this->store->favoriteById($id);
Tools::logm('mark as favorite link #' . $id);
+ Tools::redirect();
break;
case 'toggle_archive' :
$this->store->archiveById($id);
Tools::logm('archive link #' . $id);
+ Tools::redirect();
break;
default:
break;
public function updatePassword()
{
- if (isset($_POST['password']) && isset($_POST['password_repeat'])) {
- if ($_POST['password'] == $_POST['password_repeat'] && $_POST['password'] != "") {
- if (!MODE_DEMO) {
+ if (MODE_DEMO) {
+ $this->messages->add('i', 'in demo mode, you can\'t update your password');
+ Tools::logm('in demo mode, you can\'t do this');
+ }
+ else {
+ if (isset($_POST['password']) && isset($_POST['password_repeat'])) {
+ if ($_POST['password'] == $_POST['password_repeat'] && $_POST['password'] != "") {
Tools::logm('password updated');
+ $this->messages->add('s', 'your password has been updated');
$this->store->updatePassword(Tools::encodeString($_POST['password'] . $_SESSION['login']));
Session::logout();
Tools::redirect();
}
else {
- Tools::logm('in demo mode, you can\'t do this');
+ $this->messages->add('e', 'the two fields have to be filled & the password must be the same in the two fields');
}
}
}
if (!empty($_POST['login']) && !empty($_POST['password'])) {
if (Session::login($_SESSION['login'], $_SESSION['pass'], $_POST['login'], Tools::encodeString($_POST['password'] . $_POST['login']))) {
Tools::logm('login successful');
-
+ $this->messages->add('s', 'login successful, welcome to your poche');
if (!empty($_POST['longlastingsession'])) {
$_SESSION['longlastingsession'] = 31536000;
$_SESSION['expires_on'] = time() + $_SESSION['longlastingsession'];
session_regenerate_id(true);
Tools::redirect($referer);
}
+ $this->messages->add('e', 'login failed, bad login or password');
Tools::logm('login failed');
Tools::redirect();
} else {
+ $this->messages->add('e', 'login failed, you have to fill all fields');
Tools::logm('login failed');
Tools::redirect();
}
public function logout()
{
+ $this->messages->add('s', 'logout successful, see you soon!');
Tools::logm('logout');
Session::logout();
Tools::redirect();
# the second <ol> is for read links
$read = 1;
}
+ $this->messages->add('s', 'import from instapaper completed');
Tools::logm('import from instapaper completed');
Tools::redirect();
}
# the second <ul> is for read links
$read = 1;
}
+ $this->messages->add('s', 'import from pocket completed');
Tools::logm('import from pocket completed');
Tools::redirect();
}
if ($url->isCorrect())
$this->action('add', $url);
}
+ $this->messages->add('s', 'import from Readability completed');
Tools::logm('import from Readability completed');
Tools::redirect();
}
{
return ((isset ($_REQUEST["$var"])) ? htmlentities($_REQUEST["$var"]) : $default);
}
+
+ public static function getDomain($url)
+ {
+ $pieces = parse_url($url);
+ $domain = isset($pieces['host']) ? $pieces['host'] : '';
+ if (preg_match('/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $domain, $regs)) {
+ return $regs['domain'];
+ }
+
+ return FALSE;
+ }
}
\ No newline at end of file
define ('REVERT_FORCED_PARAGRAPH_ELEMENTS', FALSE);
define ('DOWNLOAD_PICTURES', FALSE);
define ('SHARE_TWITTER', TRUE);
+define ('SHARE_MAIL', TRUE);
define ('SALT', '464v54gLLw928uz4zUBqkRJeiPY68zCX');
define ('ABS_PATH', 'assets/');
define ('TPL', './tpl');
require_once './inc/store/' . $storage_type . '.class.php';
require_once './vendor/autoload.php';
require_once './inc/3rdparty/simple_html_dom.php';
+require_once './inc/3rdparty/class.messages.php';
if (DOWNLOAD_PICTURES) {
require_once './inc/poche/pochePictures.php';
}
-$poche = new Poche($storage_type);
\ No newline at end of file
+$poche = new Poche($storage_type);
+$poche->messages = new Messages();
\ No newline at end of file
$tpl_file = 'login.twig';
}
+# because messages can be added in $poche->action(), we have to add this entry now (we can add it before)
+$tpl_vars = array_merge($tpl_vars, array('messages' => $poche->messages->display()));
+
# Aaaaaaand action !
echo $poche->tpl->render($tpl_file, $tpl_vars);
\ No newline at end of file
+'<html>'
+'<head>'
+'<title>poche it !</title>'
- +'<link rel="icon" href="{$poche_url}img/favicon.ico" />'
+ +'<link rel="icon" href="{{poche_url}}tpl/img/favicon.ico" />'
+'</head>'
+'<body>'
+'<script>'
<link rel="apple-touch-icon-precomposed" href="./tpl/img/apple-touch-icon-precomposed.png">
<link rel="stylesheet" href="./tpl/css/knacss.css" media="all">
<link rel="stylesheet" href="./tpl/css/style.css" media="all">
- <!-- Light Theme -->
<link rel="stylesheet" href="./tpl/css/style-light.css" media="all" title="light-style">
- <!-- Dark Theme -->
- <link rel="alternate stylesheet" href="./tpl/css/style-dark.css" media="all" title="dark-style">
\ No newline at end of file
+ <link rel="stylesheet" href="./tpl/css/messages.css" media="all">
\ No newline at end of file
--- /dev/null
+ <ul id="links">
+ <li><a href="./" {% if view == 'home' %}class="current"{% endif %}>{% trans "home" %}</a></li>
+ <li><a href="./?view=fav" {% if view == 'fav' %}class="current"{% endif %}>{% trans "favorites" %}</a></li>
+ <li><a href="./?view=archive" {% if view == 'archive' %}class="current"{% endif %}>{% trans "archive" %}</a></li>
+ <li><a href="./?view=config" {% if view == 'config' %}class="current"{% endif %}>{% trans "config" %}</a></li>
+ <li><a href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li>
+ </ul>
\ No newline at end of file
--- /dev/null
+ <ul id="messages">
+ {% for message in messages %}
+ <li>{{ message|e }}</li>
+ {% endfor %}
+ </ul>
\ No newline at end of file
--- /dev/null
+.messages { width: 100%; -moz-border-radius: 4px; border-radius: 4px; display: block; padding: 10px 0; margin: 10px auto 10px; clear: both; }\r
+.messages a.closeMessage { margin: -14px -8px 0 0; display:none; width: 16px; height: 16px; float: right; background: url(../img/messages/close.png) no-repeat; }\r
+/*.messages:hover a.closeMessage { visibility:visible; }*/\r
+.messages p { margin: 3px 0 3px 10px !important; padding: 0 10px 0 23px !important; font-size: 14px; line-height: 16px; }\r
+.messages.error { border: 1px solid #C42608; color: #c00 !important; background: #FFF0EF; }\r
+.messages.error p { background: url(../img/messages/cross.png ) no-repeat 0px 50%; color:#c00 !important; }\r
+.messages.success {background: #E0FBCC; border: 1px solid #6DC70C; } \r
+.messages.success p { background: url(../img/messages/tick.png) no-repeat 0px 50%; color: #2B6301 !important; }\r
+.messages.warning { background: #FFFCD3; border: 1px solid #EBCD41; color: #000; }\r
+.messages.warning p { background: url(../img/messages/warning.png ) no-repeat 0px 50%; color: #5F4E01; }\r
+.messages.information, .messages.info { background: #DFEBFB; border: 1px solid #82AEE7; }\r
+.messages.information p, .messages.info p { background: url(../img/messages/help.png ) no-repeat 0px 50%; color: #064393; }\r
+.messages.information a { text-decoration: underline; }
\ No newline at end of file
background: url('../img/dark/checkmark-on.png') no-repeat;
}
+a.twitter span {
+ background: url('../img/dark/twitter.png') no-repeat;
+}
+
/*** ***/
/*** ARTICLE PAGE ***/
background: url('../img/light/checkmark-on.png') no-repeat;
}
+a.twitter span {
+ background: url('../img/light/twitter.png') no-repeat;
+}
+
+a.email span {
+ background: url('../img/light/envelop.png') no-repeat;
+}
+
/*** ***/
/*** ARTICLE PAGE ***/
cursor: pointer;
}
+ul#messages {
+
+}
+
#main, #article {
margin: 0 auto;
}
}
.tools {
+ float: right;
text-align: right;
}
top: 0px;
right: 0px;
width: 100%;
- text-align: left;
}
#article .tools ul li{
{% extends "layout.twig" %}
{% block title %}{% trans "home" %}{% endblock %}
{% block menu %}
- <ul id="links">
- <li><a href="./" {% if view == 'home' %}class="current"{% endif %}>{% trans "home" %}</a></li>
- <li><a href="./?view=fav" {% if view == 'fav' %}class="current"{% endif %}>{% trans "favorites" %}</a></li>
- <li><a href="./?view=archive" {% if view == 'archive' %}class="current"{% endif %}>{% trans "archive" %}</a></li>
- <li><a href="./?view=config" {% if view == 'config' %}class="current"{% endif %}>{% trans "config" %}</a></li>
- <li><a href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li>
- </ul>
+{% include '_menu.twig' %}
{% endblock %}
{% block precontent %}
<ul id="sort">
- <li><img src="./tpl/img/up.png" onclick="sort_links('{{ view }}', 'ia');" title="{% trans "by date asc" %}" /> {% trans "by date" %} <img src="./tpl/img/down.png" onclick="sort_links('{{ view }}', 'id');" title="{% trans "by date desc" %}" /></li>
- <li><img src="./tpl/img/up.png" onclick="sort_links('{{ view }}', 'ta');" title="{% trans "by title asc" %}" /> {% trans "by title" %} <img src="./tpl/img/down.png" onclick="sort_links('{{ view }}', 'td');" title="{% trans "by title desc" %}" /></li>
+ <li><a href="./?sort=ia"><img src="./tpl/img/up.png" title="{% trans "by date asc" %}" /></a> {% trans "by date" %} <a href="./?sort=id"><img src="./tpl/img/down.png" title="{% trans "by date desc" %}" /></a></li>
+ <li><a href="./?sort=ta"><img src="./tpl/img/up.png" title="{% trans "by title asc" %}" /></a> {% trans "by title" %} <a href="./?sort=td"><img src="./tpl/img/down.png" title="{% trans "by title desc" %}" /></a></li>
</ul>
{% endblock %}
+{% block messages %}
+{% include '_messages.twig' %}
+{% endblock %}
{% block content %}
<div id="content">
{% for entry in entries %}
<div id="entry-{{ entry.id|e }}" class="entrie mb2">
<span class="content">
<h2 class="h6-like">
- <a href="index.php?&view=view&id={{ entry.id|e }}">{{ entry.title|e }}</a>
+ <a href="index.php?view=view&id={{ entry.id|e }}">{{ entry.title|e }}</a>
</h2>
<div class="tools">
<ul>
<li>
- <a title="{% trans "toggle mark as read" %}" class="tool archive {% if entry.is_read == 0 %}archive-off{% endif %}" onclick="toggle_archive(this, {{ entry.id|e }})"><span></span></a></li>
- <li><a title="{% trans "toggle favorite" %}" class="tool fav {% if entry.is_fav == 0 %}fav-off{% endif %}" onclick="toggle_favorite(this, {{ entry.id|e }})"><span></span></a></li>
+ <a title="{% trans "toggle mark as read" %}" class="tool archive {% if entry.is_read == 0 %}archive-off{% endif %}" href="./?action=toggle_archive&id={{ entry.id|e }}"><span></span></a></li>
+ <li><a title="{% trans "toggle favorite" %}" class="tool fav {% if entry.is_fav == 0 %}fav-off{% endif %}" href="./?action=toggle_fav&id={{ entry.id|e }}"><span></span></a></li>
<li><form method="post" style="display: inline;"><input type="hidden" name="token" id="token" value="{{ token }}" /><input type="hidden" id="action" name="action" value="delete" /><input type="hidden" id="view" name="view" value="{{ view }}" /><input type="hidden" id="id" name="id" value="{{ entry.id|e }}" /><input type="submit" class="delete" title="{% trans "toggle delete" %}" /></form>
</li>
</ul>
</div>
- <div class="url">{{ entry.url|e }}</div>
+ <div class="url">{{ entry.url | e | getDomain }}</div>
</span>
</div>
{% endfor %}
{% block js %}
<script type="text/javascript" src="./tpl/js/jquery-1.9.1.min.js"></script>
- <script type="text/javascript" src="./tpl/js/poche.js"></script>
<script type="text/javascript" src="./tpl/js/jquery.masonry.min.js"></script>
- <script type="text/javascript">
- $( window ).load( function()
- {
- var columns = 3,
- setColumns = function() { columns = $( window ).width() > 640 ? 3 : $( window ).width() > 320 ? 2 : 1; };
-
- setColumns();
- $( window ).resize( setColumns );
-
- $( '#content' ).masonry(
- {
- itemSelector: '.entrie',
- columnWidth: function( containerWidth ) { return containerWidth / columns; }
- });
- });
- </script>
+ <script type="text/javascript">$(window).load(function(){var e=3,t=function(){e=$(window).width()>640?3:$(window).width()>320?2:1};t();$(window).resize(t);$("#content").masonry({itemSelector:".entrie",columnWidth:function(t){return t/e}})})</script>
{% endblock %}
\ No newline at end of file
+++ /dev/null
-function toggle_favorite(element, id) {
- $(element).toggleClass('fav-off');
- $.ajax ({
- url: "index.php?action=toggle_fav",
- data:{id:id}
- });
-}
-
-function toggle_archive(element, id, view_article) {
- $(element).toggleClass('archive-off');
- $.ajax ({
- url: "index.php?action=toggle_archive",
- data:{id:id}
- });
- var obj = $('#entry-'+id);
-
- // on vient de la vue de l'article, donc pas de gestion de grille
- if (view_article != 1) {
- $('#content').masonry('remove',obj);
- $('#content').masonry('reloadItems');
- $('#content').masonry('reload');
- }
-}
-
-function sort_links(view, sort) {
- $.get('index.php', { view: view, sort: sort }, function(data) {
- $('#content').html(data);
- });
-}
-
-
-// ---------- Swith light or dark view
-function setActiveStyleSheet(title) {
- var i, a, main;
- for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
- if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
- a.disabled = true;
- if(a.getAttribute("title") == title) a.disabled = false;
- }
- }
-}
-$('#themeswitch').click(function() {
- // we want the dark
- if ($('body').hasClass('light-style')) {
- setActiveStyleSheet('dark-style');
- $('body').addClass('dark-style');
- $('body').removeClass('light-style');
- $('#themeswitch').text('light');
- // we want the light
- } else if ($('body').hasClass('dark-style')) {
- setActiveStyleSheet('light-style');
- $('body').addClass('light-style');
- $('body').removeClass('dark-style');
- $('#themeswitch').text('dark');
- }
- return false;
-});
<div id="main">
{% block menu %}{% endblock %}
{% block precontent %}{% endblock %}
+ {% block messages %}{% endblock %}
{% block content %}{% endblock %}
{% block js %}{% endblock %}
</div>
{% extends "layout.twig" %}
{% block title %}{% trans "home" %}{% endblock %}
-
+{% block messages %}
+{% include '_messages.twig' %}
+{% endblock %}
{% block content %}
<div id="article" class="w600p">
- <div class="backhome">
- <a href="./" title="{% trans "back to home" %}">←</a>
- </div>
<div class="tools">
<ul>
- {% if constant('SHARE_TWITTER') == 1 %}<li><a href="https://twitter.com/home?status={{entry.title}}%20{{ entry.url|e }}%20via%20@getpoche" target="_blank" class="tool twitter"><span></span></a></li>{% endif %}
- <li><a title="{% trans "toggle mark as read" %}" class="tool archive {% if entry.is_read == 0 %}archive-off{% endif %}" onclick="toggle_archive(this, {{ entry.id|e }})"><span></span></a></li>
- <li><a href="#" id="themeswitch">{% trans "dark" %}</a></li>
- <li><a title="{% trans "toggle favorite" %}" class="tool fav {% if entry.is_fav == 0 %}fav-off{% endif %}" onclick="toggle_favorite(this, {{ entry.id|e }})"><span></span></a></li>
+ <li><a href="./" title="{% trans "back to home" %}" class="tool">←</a></li>
+ <li><a title="{% trans "toggle mark as read" %}" class="tool archive {% if entry.is_read == 0 %}archive-off{% endif %}" href="./?action=toggle_archive&id={{ entry.id|e }}"><span></span></a></li>
+ <li><a title="{% trans "toggle favorite" %}" class="tool fav {% if entry.is_fav == 0 %}fav-off{% endif %}" href="./?action=toggle_fav&id={{ entry.id|e }}"><span></span></a></li>
<li><form method="post" style="display: inline;" action="index.php"><input type="hidden" name="token" id="token" value="{{ token }}" /><input type="hidden" id="view" name="view" value="index" /><input type="hidden" id="action" name="action" value="delete" /><input type="hidden" id="id" name="id" value="{{ entry.id|e }}" /><input type="submit" class="delete" title="{% trans "toggle delete" %}" /></form></li>
- <li><a href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li>
+ {% if constant('SHARE_TWITTER') == 1 %}<li><a href="https://twitter.com/home?status={{entry.title}}%20{{ entry.url|e }}%20via%20@getpoche" target="_blank" class="tool twitter"><span></span></a></li>{% endif %}
+ {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|e }}&body={{ entry.url|e }} via @getpoche" class="tool email"><span></span></a></li>{% endif %}
</ul>
</div>
<header class="mbm">
- <h1><a href="{{ entry.url|e }}">{{ entry.title|e }}</a></h1>
- <div class="vieworiginal txtright small"><a href="{{ entry.url|e }}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}">{% trans "view original" %}</a></div>
+ <h1>{{ entry.title|e }}</h1>
+ <div class="vieworiginal txtright small"><a href="{{ entry.url|e }}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}">{{ entry.url | e | getDomain }}</a></div>
</header>
<article>
<div id="readityourselfcontent">
{{ content | raw }}
</div>
</article>
- <div class="vieworiginal txtright small"><a href="{$url}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}">{% trans "view original" %}</a></div>
+ <div class="vieworiginal txtright small"><a href="{{ entry.url|e }}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}">{{ entry.url | e | getDomain }}</a></div>
<div class="backhome">
<a href="./" title="{% trans "back to home" %}">←</a>
<a href="#" title="{% trans "back to top" %}">↑</a>
</div>
<div class="support">
- {% trans "this article appears wrong?" %} <a href="https://github.com/inthepoche/poche/issues/new">{% trans "create an issue" %}</a> {% trans "or" %} <a href="mailto:support@inthepoche.com">{% trans "contact us by mail" %}</a>
+ {% trans "this article appears wrong?" %} <a href="https://github.com/inthepoche/poche/issues/new">{% trans "create an issue" %}</a> {% trans "or" %} <a href="mailto:support@inthepoche.com?subject=Wrong display in poche&body={{ entry.url|e }}">{% trans "contact us by mail" %}</a>
</div>
</div>
{% endblock %}
{% block js %}
<script type="text/javascript" src="./tpl/js/jquery-1.9.1.min.js"></script>
- <script type="text/javascript" src="./tpl/js/poche.js"></script>
{% endblock %}
\ No newline at end of file