]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #170 from NumEricR/login-button
authorNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Sun, 25 Aug 2013 05:43:16 +0000 (22:43 -0700)
committerNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Sun, 25 Aug 2013 05:43:16 +0000 (22:43 -0700)
Login button

12 files changed:
.travis.yml [deleted file]
COPYING.md [moved from COPYING with 100% similarity]
CREDITS.md [moved from CREDITS with 100% similarity]
TODO.md
inc/poche/Poche.class.php
inc/poche/Url.class.php
inc/poche/define.inc.php
phpunit.xml.dist [deleted file]
tpl/config.twig
tpl/home.twig
tpl/layout.twig
tpl/view.twig

diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644 (file)
index 9d6ba13..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-language: php
-
-php:
-  - 5.4
-
-branches:
-  only:
-    - dev
-
-before_script:
-  - composer install
-
-notifications:
-  email:
-    - nicolas.loeuillet@gmail.com
\ No newline at end of file
similarity index 100%
rename from COPYING
rename to COPYING.md
similarity index 100%
rename from CREDITS
rename to CREDITS.md
diff --git a/TODO.md b/TODO.md
index ac3c0e9889932d9668d038b0020b2aa15b3ad04a..fdba2a514cec5e6ad2fa59d3fb89cc32d38e13d5 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -1,11 +1,9 @@
 # TODO
 
-pouvoir annuler la suppression
-conventions codage ? phing ? vérifier error_log qui trainent
-phpDocumentor
-minifier css 
-revoir tous les css
-barre fixe d'admin sur la page d'un billet ? 
-revoir export (export vers pocket &cie ? )
-raccourcis clavier 
-date d'ajout d'un lien
\ No newline at end of file
+* pouvoir annuler la suppression
+* conventions codage ? phing ? vérifier error_log qui trainent
+* phpDocumentor
+* minifier css 
+* barre fixe d'admin sur la page d'un billet ? 
+* revoir export (export vers pocket &cie ? )
+* raccourcis clavier 
\ No newline at end of file
index 4832f81683c5b320aa0c2ae0aa4129b9d1e47f04..cb338766fd0d9b6efbe79e58f7f97a5b78f11b15 100644 (file)
@@ -364,13 +364,14 @@ class Poche
     /**
      * import from Instapaper. poche needs a ./instapaper-export.html file
      * @todo add the return value
+     * @param string $targetFile the file used for importing
      * @return boolean
      */
-    private function importFromInstapaper()
+    private function importFromInstapaper($targetFile)
     {
         # TODO gestion des articles favs
         $html = new simple_html_dom();
-        $html->load_file('./instapaper-export.html');
+        $html->load_file($targetFile);
         Tools::logm('starting import from instapaper');
 
         $read = 0;
@@ -403,13 +404,14 @@ class Poche
     /**
      * import from Pocket. poche needs a ./ril_export.html file
      * @todo add the return value
+     * @param string $targetFile the file used for importing
      * @return boolean 
      */
-    private function importFromPocket()
+    private function importFromPocket($targetFile)
     {
         # TODO gestion des articles favs
         $html = new simple_html_dom();
-        $html->load_file('./ril_export.html');
+        $html->load_file($targetFile);
         Tools::logm('starting import from pocket');
 
         $read = 0;
@@ -442,12 +444,13 @@ class Poche
     /**
      * import from Readability. poche needs a ./readability file
      * @todo add the return value
+     * @param string $targetFile the file used for importing
      * @return boolean 
      */
-    private function importFromReadability()
+    private function importFromReadability($targetFile)
     {
         # TODO gestion des articles lus / favs
-        $str_data = file_get_contents("./readability");
+        $str_data = file_get_contents($targetFile);
         $data = json_decode($str_data,true);
         Tools::logm('starting import from Readability');
         $count = 0;
@@ -499,15 +502,31 @@ class Poche
      */
     public function import($from)
     {
-        if ($from == 'pocket') {
-            return $this->importFromPocket();
+        $providers = array(
+            'pocket' => 'importFromPocket',
+            'readability' => 'importFromReadability',
+            'instapaper' => 'importFromInstapaper'
+        );
+        
+        if (! isset($providers[$from])) {
+            $this->messages->add('e', _('Unknown import provider.'));
+            Tools::redirect();
         }
-        else if ($from == 'readability') {
-            return $this->importFromReadability();
+        
+        $targetDefinition = 'IMPORT_' . strtoupper($from) . '_FILE';
+        $targetFile = constant($targetDefinition);
+        
+        if (! defined($targetDefinition)) {
+            $this->messages->add('e', _('Incomplete inc/poche/define.inc.php file, please define "' . $targetDefinition . '".'));
+            Tools::redirect();
         }
-        else if ($from == 'instapaper') {
-            return $this->importFromInstapaper();
+        
+        if (! file_exists($targetFile)) {
+            $this->messages->add('e', _('Could not find required "' . $targetFile . '" import file.'));
+            Tools::redirect();
         }
+        
+        $this->$providers[$from]($targetFile);
     }
 
     /**
index 3c74fb434bb1b7f14cd0f0934874893c44cb578c..d7ee911fcbbf5c8287ff72a68edd2d98bdb74ec9 100644 (file)
@@ -27,9 +27,7 @@ class Url
 
     public function isCorrect()
     {
-        $pattern = '|^(.*:)//([a-z\-.]+)(:[0-9]+)?(.*)$|i';
-
-        return preg_match($pattern, $this->url);
+        return filter_var($this->url, FILTER_VALIDATE_URL) !== FALSE;
     }
 
     public function clean()
@@ -73,7 +71,7 @@ class Url
                 if (preg_replace('/\s+/', '', $body->value) !== "<body></body>") {
                     $html = $tidy->value;
                 }
-            } 
+            }
 
             $parameters = array();
             if (isset($html) and strlen($html) > 0)
index 2154ce8819f95aad7cb62802aa5c7481fdf4f95a..2d0a39ec4f5da5fc31be63bc318c3b96862dd457 100644 (file)
@@ -29,4 +29,8 @@ define ('TPL', __DIR__ . '/../../tpl');
 define ('LOCALE', __DIR__  . '/../../locale');
 define ('CACHE', __DIR__  . '/../../cache');
 define ('PAGINATION', '10');
-define ('THEME', 'light');
\ No newline at end of file
+define ('THEME', 'light');
+
+define ('IMPORT_POCKET_FILE', './ril_export.html');
+define ('IMPORT_READABILITY_FILE', './readability');
+define ('IMPORT_INSTAPAPER_FILE', './instapaper-export.html');
\ No newline at end of file
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
deleted file mode 100644 (file)
index e69de29..0000000
index 8851c3dc8f37853b3b0eeec22a476fec4a5b6148..89d5bf8430c802eb80eee2b436f7085738492716 100644 (file)
             </ul>
 {% endblock %}
 {% block content %}
-
             <h2>{% trans "Poching a link" %}</h2>
             <p>You can poche a link by several methods: (<a href="http://www.inthepoche.com/?pages/Documentation" title="{% trans "read the documentation" %}">?</a>)</p>
-            <p>
-                <ul>
-                    <li>firefox: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/poche.xpi" title="download the firefox extension">download the extension</a></li>
-                    <li>chrome: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/poche.crx" title="download the chrome extension">download the extension</a></li>
-                    <li>android: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/Poche.apk" title="download the application">download the application</a></li>
-                    <li>bookmarklet: drag & drop this link to your bookmarks bar <a ondragend="this.click();" style="cursor: move; border: 1px dashed grey; background: white; padding: 5px;" title="i am a bookmarklet, use me !" href="javascript:if(top['bookmarklet-url@inthepoche.com']){top['bookmarklet-url@inthepoche.com'];}else{(function(){var%20url%20=%20location.href%20||%20url;window.open('{{ poche_url }}?action=add&url='%20+%20btoa(url),'_self');})();void(0);}">{% trans "poche it!" %}</a></li>
-                </ul>
-            </p>
+            <ul>
+                <li>firefox: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/poche.xpi" title="download the firefox extension">download the extension</a></li>
+                <li>chrome: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/poche.crx" title="download the chrome extension">download the extension</a></li>
+                <li>android: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/Poche.apk" title="download the application">download the application</a></li>
+                <li>bookmarklet: drag & drop this link to your bookmarks bar <a ondragend="this.click();" style="cursor: move; border: 1px dashed grey; background: white; padding: 5px;" title="i am a bookmarklet, use me !" href="javascript:if(top['bookmarklet-url@inthepoche.com']){top['bookmarklet-url@inthepoche.com'];}else{(function(){var%20url%20=%20location.href%20||%20url;window.open('{{ poche_url }}?action=add&url='%20+%20btoa(url),'_self');})();void(0);}">{% trans "poche it!" %}</a></li>
+            </ul>
+
             <h2>{% trans "Updating poche" %}</h2>
-            <p><ul>
+            <ul>
                 <li>{% trans "your version" %} : <strong>{{ constant('POCHE_VERSION') }}</strong></li>
                 <li>{% trans "latest stable version" %} : {{ prod }}. {% if compare_prod == -1 %}<strong><a href="http://inthepoche.com/?pages/T%C3%A9l%C3%A9charger-poche">{% trans "a more recent stable version is available." %}</a></strong>{% else %}{% trans "you are up to date." %}{% endif %}</li>
                 {% if constant('DEBUG_POCHE') == 1 %}<li>{% trans "latest dev version" %} : {{ dev }}. {% if compare_dev == -1 %}<strong><a href="http://inthepoche.com/?pages/T%C3%A9l%C3%A9charger-poche">{% trans "a more recent development version is available." %}</a></strong>{% else %}{% trans "you are up to date." %}{% endif %}</li>{% endif %}
             </ul>
-            </p>
 
             <h2>{% trans "Change your password" %}</h2>
             <form method="post" action="?config" name="loginform">
             <h2>{% trans "Import" %}</h2>
             <p>{% trans "Please execute the import script locally, it can take a very long time." %}</p>
             <p>{% trans "More infos in the official doc:" %} <a href="http://inthepoche.com/?pages/Documentation">inthepoche.com</a></p>
-            <p><ul>
-            <li><a href="./?import&from=pocket">{% trans "import from Pocket" %}</a> (you must have a "ril_export.html" file on your server)</li>
-            <li><a href="./?import&from=readability">{% trans "import from Readability" %}</a>  (you must have a "readability" file on your server)</li>
-            <li><a href="./?import&from=instapaper">{% trans "import from Instapaper" %}</a>  (you must have a "instapaper-export.html" file on your server)</li>
-            </ul></p>
+            <ul>
+                <li><a href="./?import&from=pocket">{% trans "import from Pocket" %}</a> (you must have a "{{ defined('IMPORT_POCKET_FILE') ? constant('IMPORT_POCKET_FILE') ? 'INCORRECT CONFIGURATION' }}" file on your server)</li>
+            <li><a href="./?import&from=readability">{% trans "import from Readability" %}</a> (you must have a "{{ defined('IMPORT_READABILITY_FILE') ? constant('IMPORT_READABILITY_FILE') ? 'INCORRECT CONFIGURATION' }}" file on your server)</li>
+            <li><a href="./?import&from=instapaper">{% trans "import from Instapaper" %}</a> (you must have a "{{ defined('IMPORT_INSTAPAPER_FILE') ? constant('IMPORT_INSTAPAPER_FILE') ? 'INCORRECT CONFIGURATION' }}" file on your server)</li>
+            </ul>
 
             <h2>{% trans "Export your poche datas" %}</h2>
             <p><a href="./?export" target="_blank">{% trans "Click here" %}</a> {% trans "to export your poche datas." %}</p>
index 21910ae8c297335ed0eb4bdf6c691cad9a677726..a2fa9a93eb0529c5061a4852f4ed266f7e3e4935 100644 (file)
@@ -5,19 +5,19 @@
 {% endblock %}
 {% block precontent %}
             <ul id="sort">
-                <li><a href="./?sort=ia&view={{ view }}"><img src="./tpl/img/{{ constant('THEME') }}/top.png" alt="{% trans "by date asc" %}" title="{% trans "by date asc" %}" /></a> {% trans "by date" %} <a href="./?sort=id&view={{ view }}"><img src="./tpl/img/{{ constant('THEME') }}/down.png" alt="{% trans "by date desc" %}" title="{% trans "by date desc" %}" /></a></li>
-                <li><a href="./?sort=ta&view={{ view }}"><img src="./tpl/img/{{ constant('THEME') }}/top.png" alt="{% trans "by title asc" %}" title="{% trans "by title asc" %}" /></a> {% trans "by title" %} <a href="./?sort=td&view={{ view }}"><img src="./tpl/img/{{ constant('THEME') }}/down.png" alt="{% trans "by title desc" %}" title="{% trans "by title desc" %}" /></a></li>
+                <li><a href="./?sort=ia&amp;view={{ view }}"><img src="./tpl/img/{{ constant('THEME') }}/top.png" alt="{% trans "by date asc" %}" title="{% trans "by date asc" %}" /></a> {% trans "by date" %} <a href="./?sort=id&amp;view={{ view }}"><img src="./tpl/img/{{ constant('THEME') }}/down.png" alt="{% trans "by date desc" %}" title="{% trans "by date desc" %}" /></a></li>
+                <li><a href="./?sort=ta&amp;view={{ view }}"><img src="./tpl/img/{{ constant('THEME') }}/top.png" alt="{% trans "by title asc" %}" title="{% trans "by title asc" %}" /></a> {% trans "by title" %} <a href="./?sort=td&amp;view={{ view }}"><img src="./tpl/img/{{ constant('THEME') }}/down.png" alt="{% trans "by title desc" %}" title="{% trans "by title desc" %}" /></a></li>
             </ul>
 {% endblock %}
 {% block content %}
             {{ page_links | raw }}
             {% for entry in entries %}
             <div id="entry-{{ entry.id|e }}" class="entrie">
-                <h2><a href="index.php?view=view&id={{ entry.id|e }}">{{ entry.title|raw }}</a></h2>
+                <h2><a href="index.php?view=view&amp;id={{ entry.id|e }}">{{ entry.title|raw }}</a></h2>
                 <ul class="tools">
-                    <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>{% trans "toggle mark as read" %}</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>{% trans "toggle favorite" %}</span></a></li>
-                    <li><a title="{% trans "delete" %}" class="tool delete" href="./?action=delete&id={{ entry.id|e }}"><span>{% trans "delete" %}</span></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&amp;id={{ entry.id|e }}"><span>{% trans "toggle mark as read" %}</span></a></li>
+                    <li><a title="{% trans "toggle favorite" %}" class="tool fav {% if entry.is_fav == 0 %}fav-off{% endif %}" href="./?action=toggle_fav&amp;id={{ entry.id|e }}"><span>{% trans "toggle favorite" %}</span></a></li>
+                    <li><a title="{% trans "delete" %}" class="tool delete" href="./?action=delete&amp;id={{ entry.id|e }}"><span>{% trans "delete" %}</span></a></li>
                     <li class="reading-time">{{ entry.content| getReadingTime }} min</li>
                 </ul>
                 <p>{{ entry.content|striptags|slice(0, 300) }}...</p>
index b86983da27d9a127f814528da825c15c779f97b2..07ca231c004135b8ef3012cc9dd883e6515ad9c3 100644 (file)
@@ -1,13 +1,15 @@
 <!DOCTYPE html>
-<!--[if lte IE 6]> <html class="no-js ie6 ie67 ie678" lang="en"> <![endif]-->
-<!--[if lte IE 7]> <html class="no-js ie7 ie67 ie678" lang="en"> <![endif]-->
-<!--[if IE 8]> <html class="no-js ie8 ie678" lang="en"> <![endif]-->
-<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
+<!--[if lte IE 6]><html class="no-js ie6 ie67 ie678" lang="en"><![endif]-->
+<!--[if lte IE 7]><html class="no-js ie7 ie67 ie678" lang="en"><![endif]-->
+<!--[if IE 8]><html class="no-js ie8 ie678" lang="en"><![endif]-->
+<!--[if gt IE 8]><html class="no-js" lang="en"><![endif]-->
 <html>
     <head>
         <meta name="viewport" content="initial-scale=1.0">
         <meta charset="utf-8">
+        <!--[if IE]>
         <meta http-equiv="X-UA-Compatible" content="IE=10">
+        <![endif]-->
         <title>{% block title %}{% endblock %} - poche</title>
 {% include '_head.twig' %}
 {% include '_bookmarklet.twig' %}
index 99a9821782099212131caf359b00a1487a622587..f78ac62ebc2e7134fd865efb5dbddd903a6595b6 100644 (file)
@@ -5,34 +5,34 @@
             <div class="tools">
                 <ul class="tools">
                     <li><a href="./" title="{% trans "back to home" %}" class="tool back"><span>{% trans "back to home" %}</span></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>{% trans "toggle mark as read" %}</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>{% trans "toggle favorite" %}</span></a></li>
-                    <li><a title="{% trans "delete" %}" class="tool delete" href="./?action=delete&id={{ entry.id|e }}"><span>{% trans "delete" %}</span></a></li>
-                    {% if constant('SHARE_TWITTER') == 1 %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|e }}%20via%20@getpoche" target="_blank" class="tool twitter" title="{% trans "tweet" %}"><span>{% trans "tweet" %}</span></a></li>{% endif %}
-                    {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&body={{ entry.url|e }} via @getpoche" class="tool email" title="{% trans "email" %}"><span>{% trans "email" %}</span></a></li>{% endif %}
-                    {% if constant('SHARE_SHAARLI') == 1 %}<li><a href="{{ constant('SHAARLI_URL') }}/index.php?post={{ entry.url|url_encode }}&title={{ entry.title|e }}" target="_blank" class="tool shaarli" title="{% trans "shaarli" %}"><span>{% trans "shaarli" %}</span></a></li>{% endif %} 
+                    <li><a title="{% trans "toggle mark as read" %}" class="tool archive {% if entry.is_read == 0 %}archive-off{% endif %}" href="./?action=toggle_archive&amp;id={{ entry.id|e }}"><span>{% trans "toggle mark as read" %}</span></a></li>
+                    <li><a title="{% trans "toggle favorite" %}" class="tool fav {% if entry.is_fav == 0 %}fav-off{% endif %}" href="./?action=toggle_fav&amp;id={{ entry.id|e }}"><span>{% trans "toggle favorite" %}</span></a></li>
+                    <li><a title="{% trans "delete" %}" class="tool delete" href="./?action=delete&amp;id={{ entry.id|e }}"><span>{% trans "delete" %}</span></a></li>
+                    {% 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 %}
+                    {% 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 %}
+                    {% 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 %}
                 </ul>
             </div>
             <header class="mbm">
                 <h1>{{ entry.title|raw }}</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>
+                <div class="vieworiginal txtright small"><a href="{{ entry.url|url_encode }}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}">{{ entry.url | e | getDomain }}</a></div>
             </header>
             <article>
                 {{ content | raw }}
-                <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="vieworiginal txtright small"><a href="{{ entry.url|url_encode }}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}">{{ entry.url | e | getDomain }}</a></div>
             </article>
             <div class="tools">
                 <ul class="tools">
                     <li><a href="./?" title="{% trans "back to home" %}" class="tool back"><span>{% trans "back to home" %}</span></a></li>
                     <li><a href="#top" title="{% trans "back to top" %}" class="tool top"><span>{% trans "back to top" %}</span></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>{% trans "toggle mark as read" %}</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>{% trans "toggle favorite" %}</span></a></li>
-                    <li><a title="{% trans "delete" %}" class="tool delete" href="./?action=delete&id={{ entry.id|e }}"><span>{% trans "delete" %}</span></a></li>
-                    {% if constant('SHARE_TWITTER') == 1 %}<li><a href="https://twitter.com/home?status={{entry.title}}%20{{ entry.url|url_encode }}%20via%20@getpoche" target="_blank" class="tool twitter" title="{% trans "tweet" %}"><span>{% trans "tweet" %}</span></a></li>{% endif %}
-                    {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|e }}&body={{ entry.url|url_encode }} via @getpoche" class="tool email" title="{% trans "email" %}"><span>{% trans "email" %}</span></a></li>{% endif %}
-                    {% if constant('SHARE_SHAARLI') == 1 %}<li><a href="{{ constant('SHAARLI_URL') }}/index.php?post={{ entry.url|url_encode }}&title={{ entry.title|e }}" target="_blank" class="tool shaarli" title="{% trans "shaarli" %}"><span>{% trans "shaarli" %}</span></a></li>{% endif %} 
+                    <li><a title="{% trans "toggle mark as read" %}" class="tool archive {% if entry.is_read == 0 %}archive-off{% endif %}" href="./?action=toggle_archive&amp;id={{ entry.id|e }}"><span>{% trans "toggle mark as read" %}</span></a></li>
+                    <li><a title="{% trans "toggle favorite" %}" class="tool fav {% if entry.is_fav == 0 %}fav-off{% endif %}" href="./?action=toggle_fav&amp;id={{ entry.id|e }}"><span>{% trans "toggle favorite" %}</span></a></li>
+                    <li><a title="{% trans "delete" %}" class="tool delete" href="./?action=delete&amp;id={{ entry.id|e }}"><span>{% trans "delete" %}</span></a></li>
+                    {% 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 %}
+                    {% 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 %}
+                    {% 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 %}
                 </ul>
-                <p>{% 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></p>
+                <p>{% 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%20display%20in%20poche&amp;body={{ entry.url|url_encode }}">{% trans "contact us by mail" %}</a></p>
             </div>
         </div>
 {% endblock %}
\ No newline at end of file