aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--inc/poche/Poche.class.php30
-rw-r--r--install/mysql.sql34
-rwxr-xr-xinstall/poche.sqlitebin0 -> 360448 bytes
-rw-r--r--install/postgres.sql30
-rw-r--r--install/update.php79
-rw-r--r--install/update_sqlite_from_0_to_1.php72
-rw-r--r--tpl/config.twig15
-rw-r--r--tpl/home.twig12
-rw-r--r--tpl/layout.twig8
-rw-r--r--tpl/view.twig26
10 files changed, 261 insertions, 45 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index cc2d8de3..e0dc0d20 100644
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -35,7 +35,7 @@ class Poche
35 35
36 /** 36 /**
37 * all checks before installation. 37 * all checks before installation.
38 * @return boolean 38 * @return boolean
39 */ 39 */
40 private function checkBeforeInstall() 40 private function checkBeforeInstall()
41 { 41 {
@@ -47,7 +47,7 @@ class Poche
47 die('You don\'t have write access on cache directory.'); 47 die('You don\'t have write access on cache directory.');
48 } 48 }
49 else if (file_exists('./install/update.php') && !DEBUG_POCHE) { 49 else if (file_exists('./install/update.php') && !DEBUG_POCHE) {
50 $msg = 'A poche update is needed. Please execute this update <a href="install/update.php">by clicking here</a>. If you have already done the update, please delete /install folder.'; 50 $msg = 'A poche update is needed. Please execute this update <a href="install/update.php">by clicking here</a>. If you have already do the update, please delete /install folder.';
51 $allIsGood = FALSE; 51 $allIsGood = FALSE;
52 } 52 }
53 else if (file_exists('./install') && !DEBUG_POCHE) { 53 else if (file_exists('./install') && !DEBUG_POCHE) {
@@ -59,7 +59,7 @@ class Poche
59 $msg = 'You don\'t have write access on sqlite file.'; 59 $msg = 'You don\'t have write access on sqlite file.';
60 $allIsGood = FALSE; 60 $allIsGood = FALSE;
61 } 61 }
62 62
63 if (!$allIsGood) { 63 if (!$allIsGood) {
64 echo $this->tpl->render('error.twig', array( 64 echo $this->tpl->render('error.twig', array(
65 'msg' => $msg 65 'msg' => $msg
@@ -90,7 +90,7 @@ class Poche
90 $this->tpl->addFilter($filter); 90 $this->tpl->addFilter($filter);
91 } 91 }
92 92
93 private function init() 93 private function init()
94 { 94 {
95 Tools::initPhp(); 95 Tools::initPhp();
96 Session::init(); 96 Session::init();
@@ -108,21 +108,21 @@ class Poche
108 $language = $this->user->getConfigValue('language'); 108 $language = $this->user->getConfigValue('language');
109 putenv('LC_ALL=' . $language); 109 putenv('LC_ALL=' . $language);
110 setlocale(LC_ALL, $language); 110 setlocale(LC_ALL, $language);
111 bindtextdomain($language, LOCALE); 111 bindtextdomain($language, LOCALE);
112 textdomain($language); 112 textdomain($language);
113 113
114 # Pagination 114 # Pagination
115 $this->pagination = new Paginator($this->user->getConfigValue('pager'), 'p'); 115 $this->pagination = new Paginator($this->user->getConfigValue('pager'), 'p');
116 } 116 }
117 117
118 private function install() 118 private function install()
119 { 119 {
120 Tools::logm('poche still not installed'); 120 Tools::logm('poche still not installed');
121 echo $this->tpl->render('install.twig', array( 121 echo $this->tpl->render('install.twig', array(
122 'token' => Session::getToken() 122 'token' => Session::getToken()
123 )); 123 ));
124 if (isset($_GET['install'])) { 124 if (isset($_GET['install'])) {
125 if (($_POST['password'] == $_POST['password_repeat']) 125 if (($_POST['password'] == $_POST['password_repeat'])
126 && $_POST['password'] != "" && $_POST['login'] != "") { 126 && $_POST['password'] != "" && $_POST['login'] != "") {
127 # let's rock, install poche baby ! 127 # let's rock, install poche baby !
128 if ($this->store->install($_POST['login'], Tools::encodeString($_POST['password'] . $_POST['login']))) 128 if ($this->store->install($_POST['login'], Tools::encodeString($_POST['password'] . $_POST['login'])))
@@ -280,8 +280,8 @@ class Poche
280 } 280 }
281 281
282 /** 282 /**
283 * update the password of the current user. 283 * update the password of the current user.
284 * if MODE_DEMO is TRUE, the password can't be updated. 284 * if MODE_DEMO is TRUE, the password can't be updated.
285 * @todo add the return value 285 * @todo add the return value
286 * @todo set the new password in function header like this updatePassword($newPassword) 286 * @todo set the new password in function header like this updatePassword($newPassword)
287 * @return boolean 287 * @return boolean
@@ -350,7 +350,7 @@ class Poche
350 /** 350 /**
351 * log out the poche user. It cleans the session. 351 * log out the poche user. It cleans the session.
352 * @todo add the return value 352 * @todo add the return value
353 * @return boolean 353 * @return boolean
354 */ 354 */
355 public function logout() 355 public function logout()
356 { 356 {
@@ -403,7 +403,7 @@ class Poche
403 /** 403 /**
404 * import from Pocket. poche needs a ./ril_export.html file 404 * import from Pocket. poche needs a ./ril_export.html file
405 * @todo add the return value 405 * @todo add the return value
406 * @return boolean 406 * @return boolean
407 */ 407 */
408 private function importFromPocket() 408 private function importFromPocket()
409 { 409 {
@@ -430,7 +430,7 @@ class Poche
430 $this->action('toggle_archive', $url, $last_id, TRUE); 430 $this->action('toggle_archive', $url, $last_id, TRUE);
431 } 431 }
432 } 432 }
433 433
434 # the second <ul> is for read links 434 # the second <ul> is for read links
435 $read = 1; 435 $read = 1;
436 } 436 }
@@ -442,7 +442,7 @@ class Poche
442 /** 442 /**
443 * import from Readability. poche needs a ./readability file 443 * import from Readability. poche needs a ./readability file
444 * @todo add the return value 444 * @todo add the return value
445 * @return boolean 445 * @return boolean
446 */ 446 */
447 private function importFromReadability() 447 private function importFromReadability()
448 { 448 {
@@ -495,7 +495,7 @@ class Poche
495 * import datas into your poche 495 * import datas into your poche
496 * @param string $from name of the service to import : pocket, instapaper or readability 496 * @param string $from name of the service to import : pocket, instapaper or readability
497 * @todo add the return value 497 * @todo add the return value
498 * @return boolean 498 * @return boolean
499 */ 499 */
500 public function import($from) 500 public function import($from)
501 { 501 {
diff --git a/install/mysql.sql b/install/mysql.sql
new file mode 100644
index 00000000..cb232a84
--- /dev/null
+++ b/install/mysql.sql
@@ -0,0 +1,34 @@
1CREATE TABLE IF NOT EXISTS `config` (
2 `id` int(11) NOT NULL AUTO_INCREMENT,
3 `name` varchar(255) NOT NULL,
4 `value` varchar(255) NOT NULL,
5 PRIMARY KEY (`id`)
6) ENGINE=InnoDB DEFAULT CHARSET=latin1;
7
8CREATE TABLE IF NOT EXISTS `entries` (
9 `id` int(11) NOT NULL AUTO_INCREMENT,
10 `title` varchar(255) NOT NULL,
11 `url` varchar(255) NOT NULL,
12 `is_read` tinyint(1) NOT NULL,
13 `is_fav` tinyint(1) NOT NULL,
14 `content` blob NOT NULL,
15 `user_id` int(11) NOT NULL,
16 PRIMARY KEY (`id`)
17) ENGINE=InnoDB DEFAULT CHARSET=latin1;
18
19CREATE TABLE IF NOT EXISTS `users` (
20 `id` int(11) NOT NULL AUTO_INCREMENT,
21 `username` varchar(255) NOT NULL,
22 `password` varchar(255) NOT NULL,
23 `name` int(255) NOT NULL,
24 `email` varchar(255) NOT NULL,
25 PRIMARY KEY (`id`)
26) ENGINE=InnoDB DEFAULT CHARSET=latin1;
27
28CREATE TABLE IF NOT EXISTS `users_config` (
29 `id` int(11) NOT NULL AUTO_INCREMENT,
30 `user_id` int(11) NOT NULL,
31 `name` varchar(255) NOT NULL,
32 `value` varchar(255) NOT NULL,
33 PRIMARY KEY (`id`)
34) ENGINE=InnoDB DEFAULT CHARSET=latin1; \ No newline at end of file
diff --git a/install/poche.sqlite b/install/poche.sqlite
new file mode 100755
index 00000000..c268223d
--- /dev/null
+++ b/install/poche.sqlite
Binary files differ
diff --git a/install/postgres.sql b/install/postgres.sql
new file mode 100644
index 00000000..9e0e8276
--- /dev/null
+++ b/install/postgres.sql
@@ -0,0 +1,30 @@
1CREATE TABLE config (
2 id bigserial primary key,
3 name varchar(255) NOT NULL,
4 value varchar(255) NOT NULL
5);
6
7CREATE TABLE entries (
8 id bigserial primary key,
9 title varchar(255) NOT NULL,
10 url varchar(255) NOT NULL,
11 is_read boolean DEFAULT false,
12 is_fav boolean DEFAULT false,
13 content TEXT,
14 user_id integer NOT NULL
15);
16
17CREATE TABLE users (
18 id bigserial primary key,
19 username varchar(255) NOT NULL,
20 password varchar(255) NOT NULL,
21 name varchar(255) NOT NULL,
22 email varchar(255) NOT NULL
23);
24
25CREATE TABLE users_config (
26 id bigserial primary key,
27 user_id integer NOT NULL,
28 name varchar(255) NOT NULL,
29 value varchar(255) NOT NULL
30); \ No newline at end of file
diff --git a/install/update.php b/install/update.php
new file mode 100644
index 00000000..8c93af6d
--- /dev/null
+++ b/install/update.php
@@ -0,0 +1,79 @@
1<?php
2require_once dirname(__FILE__).'/../inc/poche/Tools.class.php';
3include dirname(__FILE__).'/../inc/poche/define.inc.php';
4require_once __DIR__ . '/../inc/poche/Database.class.php';
5$store = new Database();
6$old_salt = '464v54gLLw928uz4zUBqkRJeiPY68zCX';
7?>
8<!DOCTYPE html>
9<!--[if lte IE 6]> <html class="no-js ie6 ie67 ie678" lang="en"> <![endif]-->
10<!--[if lte IE 7]> <html class="no-js ie7 ie67 ie678" lang="en"> <![endif]-->
11<!--[if IE 8]> <html class="no-js ie8 ie678" lang="en"> <![endif]-->
12<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
13<html>
14 <head>
15 <meta charset="utf-8">
16 <title>updating poche</title>
17 </head>
18 <body>
19 <h1>update poche to 1.0-beta3</h1>
20
21 <h2>Changelog</h2>
22 <p>
23 <ul>
24 <li>this awesome updating step</li>
25 <li>error message when install folder exists</li>
26 <li>more tests before installation (write access, etc.)</li>
27 <li>updated README to make installation easier</li>
28 <li>german language thanks to HLFH</li>
29 <li>spanish language thanks to Nitche</li>
30 <li>new file ./inc/poche/myconfig.inc.php created to store language and salt</li>
31 <li><a href="https://github.com/inthepoche/poche/issues/119">#119</a>: salt is now created when installing poche</li>
32 <li><a href="https://github.com/inthepoche/poche/issues/130">#130</a>: robots.txt added</li>
33 <li><a href="https://github.com/inthepoche/poche/issues/136">#136</a>: error during readability import</li>
34 <li><a href="https://github.com/inthepoche/poche/issues/137">#137</a>: mixed content alert in https</li>
35 <li><a href="https://github.com/inthepoche/poche/issues/138">#138</a>: change pattern to parse url with #</li>
36 </ul>
37 </p>
38 <p>To update your poche, please fill the following fields.</p>
39 <p>
40 <form name="update" method="post">
41 <div><label for="login">login:</label> <input type="text" name="login" id="login" /></div>
42 <div><label for="password">password:</label> <input type="password" name="password" id="password" /></div>
43 <div><input type="hidden" name="go" value="ok" /><input type="submit" value="update" /></div>
44 </form>
45 </p>
46<?php
47if (isset($_POST['go'])) {
48 if (!empty($_POST['login']) && !empty($_POST['password'])) {
49 $user = $store->login($_POST['login'], sha1($_POST['password'] . $_POST['login'] . $old_salt));
50 if ($user != array()) {
51 $new_salt = md5(time() . $_SERVER['SCRIPT_FILENAME'] . rand());
52 $myconfig_file = '../inc/poche/myconfig.inc.php';
53 if (!is_writable('../inc/poche/')) {
54 die('You don\'t have write access to create ./inc/poche/myconfig.inc.php.');
55 }
56
57 if (!file_exists($myconfig_file))
58 {
59 $fp = fopen($myconfig_file, 'w');
60
61 fwrite($fp, '<?php'."\r\n");
62 fwrite($fp, "define ('POCHE_VERSION', '1.0-beta3');" . "\r\n");
63 fwrite($fp, "define ('SALT', '" . $new_salt . "');" . "\r\n");
64 fwrite($fp, "define ('LANG', 'en_EN.utf8');" . "\r\n");
65 fclose($fp);
66 }
67 # faire une mise à jour de la table users en prenant en compte le nouveau SALT généré
68 $store->updatePassword($user['id'], sha1($_POST['password'] . $_POST['login'] . $new_salt));
69?>
70 <p><span style="color: green;">your poche is up to date!</span></p>
71 <p><span style="color: red;">don't forget to delete ./install/ folder after the update.</span></p>
72 <p><a href="../">go back to your poche</a></p>
73<?php
74 }
75 }
76}
77?>
78 </body>
79</html> \ No newline at end of file
diff --git a/install/update_sqlite_from_0_to_1.php b/install/update_sqlite_from_0_to_1.php
new file mode 100644
index 00000000..299abf48
--- /dev/null
+++ b/install/update_sqlite_from_0_to_1.php
@@ -0,0 +1,72 @@
1<?php
2# import script to upgrade from poche 0.3
3$db_path = 'sqlite:../db/poche.sqlite';
4$handle = new PDO($db_path);
5$handle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
6
7# Requêtes à exécuter pour mettre à jour poche.sqlite en 1.x
8
9# ajout d'un champ user_id sur la table entries
10$sql = 'ALTER TABLE entries RENAME TO tempEntries;';
11$query = $handle->prepare($sql);
12$query->execute();
13
14$sql = 'CREATE TABLE entries (id INTEGER PRIMARY KEY, title TEXT, url TEXT, is_read NUMERIC DEFAULT 0, is_fav NUMERIC DEFAULT 0, content BLOB, user_id NUMERIC);';
15$query = $handle->prepare($sql);
16$query->execute();
17
18$sql = 'INSERT INTO entries (id, title, url, is_read, is_fav, content) SELECT id, title, url, is_read, is_fav, content FROM tempEntries;';
19$query = $handle->prepare($sql);
20$query->execute();
21
22# Update tout pour mettre user_id = 1
23$sql = 'UPDATE entries SET user_id = 1;';
24$query = $handle->prepare($sql);
25$query->execute();
26
27# Changement des flags pour les lus / favoris
28$sql = 'UPDATE entries SET is_read = 1 WHERE is_read = -1;';
29$query = $handle->prepare($sql);
30$query->execute();
31
32$sql = 'UPDATE entries SET is_fav = 1 WHERE is_fav = -1;';
33$query = $handle->prepare($sql);
34$query->execute();
35
36# Création de la table users
37$sql = 'CREATE TABLE users (id INTEGER PRIMARY KEY, username TEXT, password TEXT, name TEXT, email TEXT);';
38$query = $handle->prepare($sql);
39$query->execute();
40
41$sql = 'INSERT INTO users (username) SELECT value FROM config WHERE name = "login";';
42$query = $handle->prepare($sql);
43$query->execute();
44
45$sql = "UPDATE users SET password = (SELECT value FROM config WHERE name = 'password')";
46$query = $handle->prepare($sql);
47$query->execute();
48
49# Création de la table users_config
50$sql = 'CREATE TABLE users_config (id INTEGER PRIMARY KEY, user_id NUMERIC, name TEXT, value TEXT);';
51$query = $handle->prepare($sql);
52$query->execute();
53
54$sql = 'INSERT INTO users_config (user_id, name, value) VALUES (1, "pager", "10");';
55$query = $handle->prepare($sql);
56$query->execute();
57
58$sql = 'INSERT INTO users_config (user_id, name, value) VALUES (1, "language", "en_EN.UTF8");';
59$query = $handle->prepare($sql);
60$query->execute();
61
62# Suppression de la table temporaire
63$sql = 'DROP TABLE tempEntries;';
64$query = $handle->prepare($sql);
65$query->execute();
66
67# Vidage de la table de config
68$sql = 'DELETE FROM config;';
69$query = $handle->prepare($sql);
70$query->execute();
71
72echo 'welcome to poche 1.0 !'; \ No newline at end of file
diff --git a/tpl/config.twig b/tpl/config.twig
index 9f2fe5a4..5324cda7 100644
--- a/tpl/config.twig
+++ b/tpl/config.twig
@@ -14,14 +14,15 @@
14 <h2>{% trans "Bookmarklet" %}</h2> 14 <h2>{% trans "Bookmarklet" %}</h2>
15 <p>{% trans "Thanks to the bookmarklet, you will be able to easily add a link to your poche." %} {% trans "Have a look to this documentation:" %} <a href="http://inthepoche.com/?pages/Documentation">inthepoche.com</a>.</p> 15 <p>{% trans "Thanks to the bookmarklet, you will be able to easily add a link to your poche." %} {% trans "Have a look to this documentation:" %} <a href="http://inthepoche.com/?pages/Documentation">inthepoche.com</a>.</p>
16 <p>{% trans "Drag & drop this link to your bookmarks bar and have fun with poche." %}</p> 16 <p>{% trans "Drag & drop this link to your bookmarks bar and have fun with poche." %}</p>
17 <p class="txtcenter"><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&amp;url='%20+%20btoa(url),'_self');})();void(0);}">{% trans "poche it!" %}</a></p> 17 <p class="txtcenter"><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></p>
18 18
19 <h2>{% trans "Updating poche" %}</h2> 19 <h2>{% trans "Updating poche" %}</h2>
20 <ul> 20 <p><ul>
21 <li>{% trans "your version" %} : <strong>{{ constant('POCHE_VERSION') }}</strong></li> 21 <li>{% trans "your version" %} : <strong>{{ constant('POCHE_VERSION') }}</strong></li>
22 <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> 22 <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>
23 {% 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 %} 23 {% 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 %}
24 </ul> 24 </ul>
25 </p>
25 26
26 <h2>{% trans "Change your password" %}</h2> 27 <h2>{% trans "Change your password" %}</h2>
27 <form method="post" action="?config" name="loginform"> 28 <form method="post" action="?config" name="loginform">
@@ -45,11 +46,11 @@
45 <h2>{% trans "Import" %}</h2> 46 <h2>{% trans "Import" %}</h2>
46 <p>{% trans "Please execute the import script locally, it can take a very long time." %}</p> 47 <p>{% trans "Please execute the import script locally, it can take a very long time." %}</p>
47 <p>{% trans "More infos in the official doc:" %} <a href="http://inthepoche.com/?pages/Documentation">inthepoche.com</a></p> 48 <p>{% trans "More infos in the official doc:" %} <a href="http://inthepoche.com/?pages/Documentation">inthepoche.com</a></p>
48 <ul> 49 <p><ul>
49 <li><a href="./?import&amp;from=pocket">{% trans "import from Pocket" %}</a> (you must have a "ril_export.html" file on your server)</li> 50 <li><a href="./?import&from=pocket">{% trans "import from Pocket" %}</a> (you must have a "ril_export.html" file on your server)</li>
50 <li><a href="./?import&amp;from=readability">{% trans "import from Readability" %}</a> (you must have a "readability" file on your server)</li> 51 <li><a href="./?import&from=readability">{% trans "import from Readability" %}</a> (you must have a "readability" file on your server)</li>
51 <li><a href="./?import&amp;from=instapaper">{% trans "import from Instapaper" %}</a> (you must have a "instapaper-export.html" file on your server)</li> 52 <li><a href="./?import&from=instapaper">{% trans "import from Instapaper" %}</a> (you must have a "instapaper-export.html" file on your server)</li>
52 </ul> 53 </ul></p>
53 54
54 <h2>{% trans "Export your poche datas" %}</h2> 55 <h2>{% trans "Export your poche datas" %}</h2>
55 <p><a href="./?export" target="_blank">{% trans "Click here" %}</a> {% trans "to export your poche datas." %}</p> 56 <p><a href="./?export" target="_blank">{% trans "Click here" %}</a> {% trans "to export your poche datas." %}</p>
diff --git a/tpl/home.twig b/tpl/home.twig
index a2fa9a93..21910ae8 100644
--- a/tpl/home.twig
+++ b/tpl/home.twig
@@ -5,19 +5,19 @@
5{% endblock %} 5{% endblock %}
6{% block precontent %} 6{% block precontent %}
7 <ul id="sort"> 7 <ul id="sort">
8 <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> 8 <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>
9 <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> 9 <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>
10 </ul> 10 </ul>
11{% endblock %} 11{% endblock %}
12{% block content %} 12{% block content %}
13 {{ page_links | raw }} 13 {{ page_links | raw }}
14 {% for entry in entries %} 14 {% for entry in entries %}
15 <div id="entry-{{ entry.id|e }}" class="entrie"> 15 <div id="entry-{{ entry.id|e }}" class="entrie">
16 <h2><a href="index.php?view=view&amp;id={{ entry.id|e }}">{{ entry.title|raw }}</a></h2> 16 <h2><a href="index.php?view=view&id={{ entry.id|e }}">{{ entry.title|raw }}</a></h2>
17 <ul class="tools"> 17 <ul class="tools">
18 <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> 18 <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>
19 <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> 19 <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>
20 <li><a title="{% trans "delete" %}" class="tool delete" href="./?action=delete&amp;id={{ entry.id|e }}"><span>{% trans "delete" %}</span></a></li> 20 <li><a title="{% trans "delete" %}" class="tool delete" href="./?action=delete&id={{ entry.id|e }}"><span>{% trans "delete" %}</span></a></li>
21 <li class="reading-time">{{ entry.content| getReadingTime }} min</li> 21 <li class="reading-time">{{ entry.content| getReadingTime }} min</li>
22 </ul> 22 </ul>
23 <p>{{ entry.content|striptags|slice(0, 300) }}...</p> 23 <p>{{ entry.content|striptags|slice(0, 300) }}...</p>
diff --git a/tpl/layout.twig b/tpl/layout.twig
index 7084a215..b86983da 100644
--- a/tpl/layout.twig
+++ b/tpl/layout.twig
@@ -1,8 +1,8 @@
1<!DOCTYPE html> 1<!DOCTYPE html>
2<!--[if lte IE 6]><html class="no-js ie6 ie67 ie678" lang="en"><![endif]--> 2<!--[if lte IE 6]> <html class="no-js ie6 ie67 ie678" lang="en"> <![endif]-->
3<!--[if lte IE 7]><html class="no-js ie7 ie67 ie678" lang="en"><![endif]--> 3<!--[if lte IE 7]> <html class="no-js ie7 ie67 ie678" lang="en"> <![endif]-->
4<!--[if IE 8]><html class="no-js ie8 ie678" lang="en"><![endif]--> 4<!--[if IE 8]> <html class="no-js ie8 ie678" lang="en"> <![endif]-->
5<!--[if gt IE 8]><html class="no-js" lang="en"><![endif]--> 5<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
6<html> 6<html>
7 <head> 7 <head>
8 <meta name="viewport" content="initial-scale=1.0"> 8 <meta name="viewport" content="initial-scale=1.0">
diff --git a/tpl/view.twig b/tpl/view.twig
index 4dee38c8..82d1fd2a 100644
--- a/tpl/view.twig
+++ b/tpl/view.twig
@@ -5,32 +5,32 @@
5 <div class="tools"> 5 <div class="tools">
6 <ul class="tools"> 6 <ul class="tools">
7 <li><a href="./" title="{% trans "back to home" %}" class="tool back"><span>{% trans "back to home" %}</span></a></li> 7 <li><a href="./" title="{% trans "back to home" %}" class="tool back"><span>{% trans "back to home" %}</span></a></li>
8 <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> 8 <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>
9 <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> 9 <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>
10 <li><a title="{% trans "delete" %}" class="tool delete" href="./?action=delete&amp;id={{ entry.id|e }}"><span>{% trans "delete" %}</span></a></li> 10 <li><a title="{% trans "delete" %}" class="tool delete" href="./?action=delete&id={{ entry.id|e }}"><span>{% trans "delete" %}</span></a></li>
11 {% 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 %} 11 {% 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" title="{% trans "tweet" %}"><span>{% trans "tweet" %}</span></a></li>{% endif %}
12 {% 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 %} 12 {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|e }}&body={{ entry.url|e }} via @getpoche" class="tool email" title="{% trans "email" %}"><span>{% trans "email" %}</span></a></li>{% endif %}
13 </ul> 13 </ul>
14 </div> 14 </div>
15 <header class="mbm"> 15 <header class="mbm">
16 <h1>{{ entry.title|raw }}</h1> 16 <h1>{{ entry.title|raw }}</h1>
17 <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> 17 <div class="vieworiginal txtright small"><a href="{{ entry.url|e }}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}">{{ entry.url | e | getDomain }}</a></div>
18 </header> 18 </header>
19 <article> 19 <article>
20 {{ content | raw }} 20 {{ content | raw }}
21 <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> 21 <div class="vieworiginal txtright small"><a href="{{ entry.url|e }}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}">{{ entry.url | e | getDomain }}</a></div>
22 </article> 22 </article>
23 <div class="tools"> 23 <div class="tools">
24 <ul class="tools"> 24 <ul class="tools">
25 <li><a href="./?" title="{% trans "back to home" %}" class="tool back"><span>{% trans "back to home" %}</span></a></li> 25 <li><a href="./?" title="{% trans "back to home" %}" class="tool back"><span>{% trans "back to home" %}</span></a></li>
26 <li><a href="#top" title="{% trans "back to top" %}" class="tool top"><span>{% trans "back to top" %}</span></a></li> 26 <li><a href="#top" title="{% trans "back to top" %}" class="tool top"><span>{% trans "back to top" %}</span></a></li>
27 <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> 27 <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>
28 <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> 28 <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>
29 <li><a title="{% trans "delete" %}" class="tool delete" href="./?action=delete&amp;id={{ entry.id|e }}"><span>{% trans "delete" %}</span></a></li> 29 <li><a title="{% trans "delete" %}" class="tool delete" href="./?action=delete&id={{ entry.id|e }}"><span>{% trans "delete" %}</span></a></li>
30 {% 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 %} 30 {% 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" title="{% trans "tweet" %}"><span>{% trans "tweet" %}</span></a></li>{% endif %}
31 {% 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 %} 31 {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|e }}&body={{ entry.url|e }} via @getpoche" class="tool email" title="{% trans "email" %}"><span>{% trans "email" %}</span></a></li>{% endif %}
32 </ul> 32 </ul>
33 <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> 33 <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>
34 </div> 34 </div>
35 </div> 35 </div>
36{% endblock %} \ No newline at end of file 36{% endblock %} \ No newline at end of file