diff options
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | inc/3rdparty/FlattrItem.class.php | 49 | ||||
m--------- | inc/3rdparty/site_config | 0 | ||||
-rw-r--r-- | inc/3rdparty/site_config/README.txt | 6 | ||||
-rw-r--r-- | inc/3rdparty/site_config/custom/bfmtv.com.txt | 6 | ||||
-rw-r--r-- | inc/3rdparty/site_config/custom/inthepoche.com.txt | 7 | ||||
-rw-r--r-- | inc/3rdparty/site_config/custom/tldp.org.txt | 6 | ||||
-rw-r--r-- | inc/3rdparty/site_config/index.php | 3 | ||||
-rw-r--r-- | inc/3rdparty/site_config/standard/.wikipedia.org.txt | 19 | ||||
-rw-r--r-- | inc/3rdparty/site_config/standard/index.php | 3 | ||||
-rw-r--r-- | inc/3rdparty/site_config/standard/version.php | 2 | ||||
-rw-r--r-- | inc/poche/Poche.class.php | 61 | ||||
-rwxr-xr-x | inc/poche/config.inc.php | 8 | ||||
-rw-r--r-- | inc/poche/define.inc.php | 8 | ||||
-rw-r--r-- | index.php | 4 | ||||
-rw-r--r-- | poche_compatibility_test.php | 14 | ||||
-rw-r--r-- | tpl/_menu.twig | 2 | ||||
-rw-r--r-- | tpl/_top.twig | 6 | ||||
-rw-r--r-- | tpl/config.twig | 23 | ||||
-rw-r--r-- | tpl/css/style.css | 42 | ||||
-rw-r--r-- | tpl/error.twig | 2 | ||||
-rw-r--r-- | tpl/home.twig | 13 | ||||
-rw-r--r-- | tpl/install.twig | 2 | ||||
-rw-r--r-- | tpl/js/poche.js | 2 | ||||
-rw-r--r-- | tpl/view.twig | 4 |
25 files changed, 140 insertions, 155 deletions
diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..fcc2e52c --- /dev/null +++ b/.gitmodules | |||
@@ -0,0 +1,3 @@ | |||
1 | [submodule "inc/3rdparty/site_config"] | ||
2 | path = inc/3rdparty/site_config | ||
3 | url = git://github.com/inthepoche/site_config.git | ||
diff --git a/inc/3rdparty/FlattrItem.class.php b/inc/3rdparty/FlattrItem.class.php new file mode 100644 index 00000000..c940fcd6 --- /dev/null +++ b/inc/3rdparty/FlattrItem.class.php | |||
@@ -0,0 +1,49 @@ | |||
1 | <?php | ||
2 | /* | ||
3 | * Class for Flattr querying | ||
4 | */ | ||
5 | class FlattrItem { | ||
6 | |||
7 | public $status; | ||
8 | public $urltoflattr; | ||
9 | public $flattrItemURL; | ||
10 | public $numflattrs; | ||
11 | |||
12 | public function checkItem($urltoflattr) { | ||
13 | $this->cacheflattrfile($urltoflattr); | ||
14 | $flattrResponse = file_get_contents(CACHE . "/flattr/".base64_encode($urltoflattr).".cache"); | ||
15 | if($flattrResponse != FALSE) { | ||
16 | $result = json_decode($flattrResponse); | ||
17 | if (isset($result->message)){ | ||
18 | if ($result->message == "flattrable") { | ||
19 | $this->status = FLATTRABLE; | ||
20 | } | ||
21 | } | ||
22 | elseif ($result->link) { | ||
23 | $this->status = FLATTRED; | ||
24 | $this->flattrItemURL = $result->link; | ||
25 | $this->numflattrs = $result->flattrs; | ||
26 | } | ||
27 | else { | ||
28 | $this->status = NOT_FLATTRABLE; | ||
29 | } | ||
30 | } | ||
31 | else { | ||
32 | $this->status = "FLATTR_ERR_CONNECTION"; | ||
33 | } | ||
34 | } | ||
35 | |||
36 | private function cacheflattrfile($urltoflattr) { | ||
37 | if (!is_dir(CACHE . '/flattr')) { | ||
38 | mkdir(CACHE . '/flattr', 0777); | ||
39 | } | ||
40 | |||
41 | // if a cache flattr file for this url already exists and it's been less than one day than it have been updated, see in /cache | ||
42 | if ((!file_exists(CACHE . "/flattr/".base64_encode($urltoflattr).".cache")) || (time() - filemtime(CACHE . "/flattr/".base64_encode($urltoflattr).".cache") > 86400)) { | ||
43 | $askForFlattr = Tools::getFile(FLATTR_API . $urltoflattr); | ||
44 | $flattrCacheFile = fopen(CACHE . "/flattr/".base64_encode($urltoflattr).".cache", 'w+'); | ||
45 | fwrite($flattrCacheFile, $askForFlattr); | ||
46 | fclose($flattrCacheFile); | ||
47 | } | ||
48 | } | ||
49 | } \ No newline at end of file | ||
diff --git a/inc/3rdparty/site_config b/inc/3rdparty/site_config new file mode 160000 | |||
Subproject fe9f0d3f60d44a8701f3ecab0c4077a4ed39bfe | |||
diff --git a/inc/3rdparty/site_config/README.txt b/inc/3rdparty/site_config/README.txt deleted file mode 100644 index 0aff456b..00000000 --- a/inc/3rdparty/site_config/README.txt +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | Full-Text RSS Site Patterns | ||
2 | --------------------------- | ||
3 | |||
4 | Site patterns allow you to specify what should be extracted from specific sites. | ||
5 | |||
6 | Please see http://help.fivefilters.org/customer/portal/articles/223153-site-patterns for more information. \ No newline at end of file | ||
diff --git a/inc/3rdparty/site_config/custom/bfmtv.com.txt b/inc/3rdparty/site_config/custom/bfmtv.com.txt deleted file mode 100644 index 0ff28d56..00000000 --- a/inc/3rdparty/site_config/custom/bfmtv.com.txt +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | title: //title | ||
2 | body: //h2 | //span[@class='masque'] | //article[@class='corps_article_right'] | ||
3 | prune: no | ||
4 | tidy: no | ||
5 | |||
6 | test_url: http://www.bfmtv.com/societe/cigarette-electronique-dangers-588622.html \ No newline at end of file | ||
diff --git a/inc/3rdparty/site_config/custom/inthepoche.com.txt b/inc/3rdparty/site_config/custom/inthepoche.com.txt deleted file mode 100644 index ede74b97..00000000 --- a/inc/3rdparty/site_config/custom/inthepoche.com.txt +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | title: //title | ||
2 | body: //div[@class='post-content'] | ||
3 | |||
4 | prune: no | ||
5 | tidy: no | ||
6 | |||
7 | test_url: http://www.inthepoche.com/?post/poche-hosting \ No newline at end of file | ||
diff --git a/inc/3rdparty/site_config/custom/tldp.org.txt b/inc/3rdparty/site_config/custom/tldp.org.txt deleted file mode 100644 index 7dd5cdb5..00000000 --- a/inc/3rdparty/site_config/custom/tldp.org.txt +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | title: //title | ||
2 | body: //h2 | //p | //ul | ||
3 | prune: no | ||
4 | tidy: no | ||
5 | |||
6 | test_url: http://www.tldp.org/HOWTO/Plug-and-Play-HOWTO-7.html \ No newline at end of file | ||
diff --git a/inc/3rdparty/site_config/index.php b/inc/3rdparty/site_config/index.php deleted file mode 100644 index a3d5f739..00000000 --- a/inc/3rdparty/site_config/index.php +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | <?php | ||
2 | // this is here to prevent directory listing over the web | ||
3 | ?> \ No newline at end of file | ||
diff --git a/inc/3rdparty/site_config/standard/.wikipedia.org.txt b/inc/3rdparty/site_config/standard/.wikipedia.org.txt deleted file mode 100644 index 8b98ae4b..00000000 --- a/inc/3rdparty/site_config/standard/.wikipedia.org.txt +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | title: //h1[@id='firstHeading'] | ||
2 | body: //div[@id = 'bodyContent'] | ||
3 | strip_id_or_class: editsection | ||
4 | #strip_id_or_class: toc | ||
5 | strip_id_or_class: vertical-navbox | ||
6 | strip: //table[@id='toc'] | ||
7 | strip: //div[@id='catlinks'] | ||
8 | strip: //div[@id='jump-to-nav'] | ||
9 | strip: //div[@class='thumbcaption']//div[@class='magnify'] | ||
10 | strip: //table[@class='navbox'] | ||
11 | strip: //table[contains(@class, 'infobox')] | ||
12 | strip: //div[@class='dablink'] | ||
13 | strip: //div[@id='contentSub'] | ||
14 | strip: //table[contains(@class, 'metadata')] | ||
15 | strip: //*[contains(@class, 'noprint')] | ||
16 | strip: //span[@title='pronunciation:'] | ||
17 | prune: no | ||
18 | tidy: no | ||
19 | test_url: http://en.wikipedia.org/wiki/Christopher_Lloyd \ No newline at end of file | ||
diff --git a/inc/3rdparty/site_config/standard/index.php b/inc/3rdparty/site_config/standard/index.php deleted file mode 100644 index a3d5f739..00000000 --- a/inc/3rdparty/site_config/standard/index.php +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | <?php | ||
2 | // this is here to prevent directory listing over the web | ||
3 | ?> \ No newline at end of file | ||
diff --git a/inc/3rdparty/site_config/standard/version.php b/inc/3rdparty/site_config/standard/version.php deleted file mode 100644 index e61807ed..00000000 --- a/inc/3rdparty/site_config/standard/version.php +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | <?php | ||
2 | return 1; \ No newline at end of file | ||
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index b0efe69a..9db4a034 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php | |||
@@ -182,7 +182,7 @@ class Poche | |||
182 | } | 182 | } |
183 | 183 | ||
184 | if (!$import) { | 184 | if (!$import) { |
185 | Tools::redirect(); | 185 | Tools::redirect('?view=home'); |
186 | } | 186 | } |
187 | break; | 187 | break; |
188 | case 'delete': | 188 | case 'delete': |
@@ -248,9 +248,9 @@ class Poche | |||
248 | $tidy->cleanRepair(); | 248 | $tidy->cleanRepair(); |
249 | $content = $tidy->value; | 249 | $content = $tidy->value; |
250 | 250 | ||
251 | // flattr checking | 251 | # flattr checking |
252 | $flattr = new FlattrItem(); | 252 | $flattr = new FlattrItem(); |
253 | $flattr->checkitem($entry['url']); | 253 | $flattr->checkItem($entry['url']); |
254 | 254 | ||
255 | $tpl_vars = array( | 255 | $tpl_vars = array( |
256 | 'entry' => $entry, | 256 | 'entry' => $entry, |
@@ -263,11 +263,12 @@ class Poche | |||
263 | Tools::logm('error in view call : entry is null'); | 263 | Tools::logm('error in view call : entry is null'); |
264 | } | 264 | } |
265 | break; | 265 | break; |
266 | default : // home, favorites and archive views | 266 | default: # home, favorites and archive views |
267 | $entries = $this->store->getEntriesByView($view, $this->user->getId()); | 267 | $entries = $this->store->getEntriesByView($view, $this->user->getId()); |
268 | $tpl_vars = array( | 268 | $tpl_vars = array( |
269 | 'entries' => '', | 269 | 'entries' => '', |
270 | 'page_links' => '', | 270 | 'page_links' => '', |
271 | 'nb_results' => '', | ||
271 | ); | 272 | ); |
272 | if (count($entries) > 0) { | 273 | if (count($entries) > 0) { |
273 | $this->pagination->set_total(count($entries)); | 274 | $this->pagination->set_total(count($entries)); |
@@ -275,6 +276,7 @@ class Poche | |||
275 | $datas = $this->store->getEntriesByView($view, $this->user->getId(), $this->pagination->get_limit()); | 276 | $datas = $this->store->getEntriesByView($view, $this->user->getId(), $this->pagination->get_limit()); |
276 | $tpl_vars['entries'] = $datas; | 277 | $tpl_vars['entries'] = $datas; |
277 | $tpl_vars['page_links'] = $page_links; | 278 | $tpl_vars['page_links'] = $page_links; |
279 | $tpl_vars['nb_results'] = count($entries); | ||
278 | } | 280 | } |
279 | Tools::logm('display ' . $view . ' view'); | 281 | Tools::logm('display ' . $view . ' view'); |
280 | break; | 282 | break; |
@@ -564,53 +566,4 @@ class Poche | |||
564 | } | 566 | } |
565 | return $version; | 567 | return $version; |
566 | } | 568 | } |
567 | } | 569 | } \ No newline at end of file |
568 | |||
569 | /* class for Flattr querying. Should be put in a separate file | ||
570 | * Or maybe just create an array instead of a complete class... My mistake. :-° | ||
571 | */ | ||
572 | class FlattrItem{ | ||
573 | public $status; | ||
574 | public $urltoflattr; | ||
575 | public $flattrItemURL; | ||
576 | public $numflattrs; | ||
577 | |||
578 | public function checkitem($urltoflattr){ | ||
579 | $this->cacheflattrfile($urltoflattr); | ||
580 | $flattrResponse = file_get_contents("cache/flattr/".base64_encode($urltoflattr).".cache"); | ||
581 | if($flattrResponse != FALSE){ | ||
582 | $result = json_decode($flattrResponse); | ||
583 | if (isset($result->message)){ | ||
584 | if ($result->message == "flattrable"){ | ||
585 | $this->status = "flattrable"; | ||
586 | } | ||
587 | } | ||
588 | elseif ($result->link) { | ||
589 | $this->status = "flattred"; | ||
590 | $this->flattrItemURL = $result->link; | ||
591 | $this->numflattrs = $result->flattrs; | ||
592 | } | ||
593 | else{ | ||
594 | $this->status = "not flattrable"; | ||
595 | } | ||
596 | } | ||
597 | else | ||
598 | { | ||
599 | $this->status = "FLATTR_ERR_CONNECTION"; | ||
600 | } | ||
601 | } | ||
602 | |||
603 | private function cacheflattrfile($urltoflattr){ | ||
604 | if (!is_dir('cache/flattr')){ | ||
605 | mkdir('./cache/flattr', 0777); | ||
606 | } | ||
607 | // if a cache flattr file for this url already exists and it's been less than one day than it have been updated, see in /cache | ||
608 | if ((!file_exists("cache/flattr/".base64_encode($urltoflattr).".cache")) || (time() - filemtime("cache/flattr/".base64_encode($urltoflattr).".cache") > 86400)) | ||
609 | { | ||
610 | $askForFlattr = Tools::getFile("https://api.flattr.com/rest/v2/things/lookup/?url=".$urltoflattr); | ||
611 | $flattrCacheFile = fopen("cache/flattr/".base64_encode($urltoflattr).".cache", 'w+'); | ||
612 | fwrite($flattrCacheFile, $askForFlattr); | ||
613 | fclose($flattrCacheFile); | ||
614 | } | ||
615 | } | ||
616 | } | ||
diff --git a/inc/poche/config.inc.php b/inc/poche/config.inc.php index a1917295..45526695 100755 --- a/inc/poche/config.inc.php +++ b/inc/poche/config.inc.php | |||
@@ -3,7 +3,7 @@ | |||
3 | * poche, a read it later open source system | 3 | * poche, a read it later open source system |
4 | * | 4 | * |
5 | * @category poche | 5 | * @category poche |
6 | * @author Nicolas LÅ“uillet <nicolas@loeuillet.org> | 6 | * @author Nicolas LÅ“uillet <support@inthepoche.com> |
7 | * @copyright 2013 | 7 | * @copyright 2013 |
8 | * @license http://www.wtfpl.net/ see COPYING file | 8 | * @license http://www.wtfpl.net/ see COPYING file |
9 | */ | 9 | */ |
@@ -12,12 +12,9 @@ require_once __DIR__ . '/../../inc/poche/define.inc.php'; | |||
12 | 12 | ||
13 | # /!\ Be careful if you change the lines below /!\ | 13 | # /!\ Be careful if you change the lines below /!\ |
14 | if (!file_exists(__DIR__ . '/../../vendor/autoload.php')) { | 14 | if (!file_exists(__DIR__ . '/../../vendor/autoload.php')) { |
15 | die('Twig does not seem installed. Have a look at <a href="http://inthepoche.com/?pages/Documentation">the documentation.</a>'); | 15 | die('Twig does not seem installed. Have a look at <a href="inthepoche.com/doc">the documentation.</a>'); |
16 | } | 16 | } |
17 | 17 | ||
18 | // if (file_exists(__DIR__ . '/../../inc/poche/myconfig.inc.php')) { | ||
19 | // require_once __DIR__ . '/../../inc/poche/myconfig.inc.php'; | ||
20 | // } | ||
21 | require_once __DIR__ . '/../../inc/poche/User.class.php'; | 18 | require_once __DIR__ . '/../../inc/poche/User.class.php'; |
22 | require_once __DIR__ . '/../../inc/poche/Url.class.php'; | 19 | require_once __DIR__ . '/../../inc/poche/Url.class.php'; |
23 | require_once __DIR__ . '/../../inc/3rdparty/class.messages.php'; | 20 | require_once __DIR__ . '/../../inc/3rdparty/class.messages.php'; |
@@ -40,6 +37,7 @@ require_once __DIR__ . '/../../inc/3rdparty/humble-http-agent/CookieJar.php'; | |||
40 | require_once __DIR__ . '/../../inc/3rdparty/feedwriter/FeedItem.php'; | 37 | require_once __DIR__ . '/../../inc/3rdparty/feedwriter/FeedItem.php'; |
41 | require_once __DIR__ . '/../../inc/3rdparty/feedwriter/FeedWriter.php'; | 38 | require_once __DIR__ . '/../../inc/3rdparty/feedwriter/FeedWriter.php'; |
42 | require_once __DIR__ . '/../../inc/3rdparty/feedwriter/DummySingleItemFeed.php'; | 39 | require_once __DIR__ . '/../../inc/3rdparty/feedwriter/DummySingleItemFeed.php'; |
40 | require_once __DIR__ . '/../../inc/3rdparty/FlattrItem.class.php'; | ||
43 | 41 | ||
44 | if (DOWNLOAD_PICTURES) { | 42 | if (DOWNLOAD_PICTURES) { |
45 | require_once __DIR__ . '/../../inc/poche/pochePictures.php'; | 43 | require_once __DIR__ . '/../../inc/poche/pochePictures.php'; |
diff --git a/inc/poche/define.inc.php b/inc/poche/define.inc.php index 62777282..40f77b5c 100644 --- a/inc/poche/define.inc.php +++ b/inc/poche/define.inc.php | |||
@@ -3,7 +3,7 @@ | |||
3 | * poche, a read it later open source system | 3 | * poche, a read it later open source system |
4 | * | 4 | * |
5 | * @category poche | 5 | * @category poche |
6 | * @author Nicolas LÅ“uillet <nicolas@loeuillet.org> | 6 | * @author Nicolas LÅ“uillet <support@inthepoche.com> |
7 | * @copyright 2013 | 7 | * @copyright 2013 |
8 | * @license http://www.wtfpl.net/ see COPYING file | 8 | * @license http://www.wtfpl.net/ see COPYING file |
9 | */ | 9 | */ |
@@ -20,9 +20,13 @@ define ('DEBUG_POCHE', FALSE); | |||
20 | define ('DOWNLOAD_PICTURES', FALSE); | 20 | define ('DOWNLOAD_PICTURES', FALSE); |
21 | define ('SHARE_TWITTER', TRUE); | 21 | define ('SHARE_TWITTER', TRUE); |
22 | define ('SHARE_MAIL', TRUE); | 22 | define ('SHARE_MAIL', TRUE); |
23 | define ('SHARE_SHAARLI', TRUE); | 23 | define ('SHARE_SHAARLI', FALSE); |
24 | define ('SHAARLI_URL', 'http://myshaarliurl.com'); | 24 | define ('SHAARLI_URL', 'http://myshaarliurl.com'); |
25 | define ('FLATTR', TRUE); | 25 | define ('FLATTR', TRUE); |
26 | define ('FLATTR_API', 'https://api.flattr.com/rest/v2/things/lookup/?url='); | ||
27 | define ('NOT_FLATTRABLE', '0'); | ||
28 | define ('FLATTRABLE', '1'); | ||
29 | define ('FLATTRED', '2'); | ||
26 | define ('ABS_PATH', 'assets/'); | 30 | define ('ABS_PATH', 'assets/'); |
27 | define ('TPL', __DIR__ . '/../../tpl'); | 31 | define ('TPL', __DIR__ . '/../../tpl'); |
28 | define ('LOCALE', __DIR__ . '/../../locale'); | 32 | define ('LOCALE', __DIR__ . '/../../locale'); |
@@ -43,6 +43,10 @@ elseif (isset($_GET['import'])) { | |||
43 | elseif (isset($_GET['export'])) { | 43 | elseif (isset($_GET['export'])) { |
44 | $poche->export(); | 44 | $poche->export(); |
45 | } | 45 | } |
46 | elseif (isset($_GET['plainurl']) && !empty($_GET['plainurl'])) { | ||
47 | $plain_url = new Url(base64_encode($_GET['plainurl'])); | ||
48 | $poche->action('add', $plain_url); | ||
49 | } | ||
46 | 50 | ||
47 | # vars to send to templates | 51 | # vars to send to templates |
48 | $tpl_vars = array( | 52 | $tpl_vars = array( |
diff --git a/poche_compatibility_test.php b/poche_compatibility_test.php index 7c85a583..be4fd6f8 100644 --- a/poche_compatibility_test.php +++ b/poche_compatibility_test.php | |||
@@ -1,18 +1,4 @@ | |||
1 | <?php | 1 | <?php |
2 | /* | ||
3 | FULL-TEXT-RSS V2 COMPATIBILITY TEST | ||
4 | |||
5 | 1) Upload ftr_compatibility_test.php to the web-accessible root of your website. | ||
6 | For example, if your website is www.example.com, upload it so that you can get | ||
7 | to it at www.example.com/ftr_compatibility_test.php | ||
8 | |||
9 | 2) Open your web browser and go to the page you just uploaded. | ||
10 | |||
11 | Note: This compatibility test has been borrowed (and slightly adapted) from the one supplied by | ||
12 | SimplePie.org. We have kept most of their checks intact as we use SimplePie in our application. | ||
13 | http://github.com/simplepie/simplepie/tree/master/compatibility_test/ | ||
14 | */ | ||
15 | |||
16 | $app_name = 'poche 1.0'; | 2 | $app_name = 'poche 1.0'; |
17 | 3 | ||
18 | $php_ok = (function_exists('version_compare') && version_compare(phpversion(), '5.2.0', '>=')); | 4 | $php_ok = (function_exists('version_compare') && version_compare(phpversion(), '5.2.0', '>=')); |
diff --git a/tpl/_menu.twig b/tpl/_menu.twig index 699d6a0c..523d63cc 100644 --- a/tpl/_menu.twig +++ b/tpl/_menu.twig | |||
@@ -4,4 +4,4 @@ | |||
4 | <li><a href="./?view=archive" {% if view == 'archive' %}class="current"{% endif %}>{% trans "archive" %}</a></li> | 4 | <li><a href="./?view=archive" {% if view == 'archive' %}class="current"{% endif %}>{% trans "archive" %}</a></li> |
5 | <li><a href="./?view=config" {% if view == 'config' %}class="current"{% endif %}>{% trans "config" %}</a></li> | 5 | <li><a href="./?view=config" {% if view == 'config' %}class="current"{% endif %}>{% trans "config" %}</a></li> |
6 | <li><a href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li> | 6 | <li><a href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li> |
7 | </ul> \ No newline at end of file | 7 | </ul> \ No newline at end of file |
diff --git a/tpl/_top.twig b/tpl/_top.twig index ae01cc3f..dc20081e 100644 --- a/tpl/_top.twig +++ b/tpl/_top.twig | |||
@@ -1,3 +1,7 @@ | |||
1 | <header class="w600p center mbm"> | 1 | <header class="w600p center mbm"> |
2 | <h1><a href="./" title="{% trans "back to home" %}" ><img src="./tpl/img/logo.png" alt="logo poche" /></a></h1> | 2 | <h1> |
3 | {% if view == 'home' %}{% block logo %}<img src="./tpl/img/logo.png" alt="logo poche" />{% endblock %} | ||
4 | {% else %}<a href="./" title="{% trans "back to home" %}" >{{ block('logo') }}</a> | ||
5 | {% endif %} | ||
6 | </h1> | ||
3 | </header> \ No newline at end of file | 7 | </header> \ No newline at end of file |
diff --git a/tpl/config.twig b/tpl/config.twig index c838c319..70788876 100644 --- a/tpl/config.twig +++ b/tpl/config.twig | |||
@@ -2,29 +2,30 @@ | |||
2 | 2 | ||
3 | {% block title %}{% trans "config" %}{% endblock %} | 3 | {% block title %}{% trans "config" %}{% endblock %} |
4 | {% block menu %} | 4 | {% block menu %} |
5 | <ul id="links"> | 5 | {% include '_menu.twig' %} |
6 | <li><a href="./" {% if view == 'home' %}class="current"{% endif %}>{% trans "home" %}</a></li> | ||
7 | <li><a href="./?view=fav" {% if view == 'fav' %}class="current"{% endif %}>{% trans "favorites" %}</a></li> | ||
8 | <li><a href="./?view=archive" {% if view == 'archive' %}class="current"{% endif %}>{% trans "archive" %}</a></li> | ||
9 | <li><a href="./?view=config" {% if view == 'config' %}class="current"{% endif %}>{% trans "config" %}</a></li> | ||
10 | <li><a href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li> | ||
11 | </ul> | ||
12 | {% endblock %} | 6 | {% endblock %} |
13 | {% block content %} | 7 | {% block content %} |
14 | <h2>{% trans "Poching a link" %}</h2> | 8 | <h2>{% trans "Poching a link" %}</h2> |
15 | <p>You can poche a link by several methods: (<a href="http://www.inthepoche.com/?pages/Documentation" title="{% trans "read the documentation" %}">?</a>)</p> | 9 | <p>You can poche a link by several methods: (<a href="http://inthepoche.com/doc" title="{% trans "read the documentation" %}">?</a>)</p> |
16 | <ul> | 10 | <ul> |
17 | <li>firefox: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/poche.xpi" title="download the firefox extension">download the extension</a></li> | 11 | <li>firefox: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/poche.xpi" title="download the firefox extension">download the extension</a></li> |
18 | <li>chrome: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/poche.crx" title="download the chrome extension">download the extension</a></li> | 12 | <li>chrome: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/poche.crx" title="download the chrome extension">download the extension</a></li> |
19 | <li>android: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/Poche.apk" title="download the application">download the application</a></li> | 13 | <li>android: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/Poche.apk" title="download the application">download the application</a></li> |
14 | <li> | ||
15 | <form method="get" action="index.php"> | ||
16 | <label class="addurl" for="plainurl">{% trans "by filling this field" %}:</label> | ||
17 | <input autofocus required placeholder="Ex:mywebsite.com/article" class="addurl" id="plainurl" name="plainurl" type="url" /> | ||
18 | <input type="submit" value="{% trans "poche it!" %}" /> | ||
19 | </form> | ||
20 | </li> | ||
20 | <li>bookmarklet: drag & drop this link to your bookmarks bar <a id="bookmarklet" ondragend="this.click();" 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> | 21 | <li>bookmarklet: drag & drop this link to your bookmarks bar <a id="bookmarklet" ondragend="this.click();" 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> |
21 | </ul> | 22 | </ul> |
22 | 23 | ||
23 | <h2>{% trans "Updating poche" %}</h2> | 24 | <h2>{% trans "Updating poche" %}</h2> |
24 | <ul> | 25 | <ul> |
25 | <li>{% trans "your version" %} : <strong>{{ constant('POCHE_VERSION') }}</strong></li> | 26 | <li>{% trans "your version" %} : <strong>{{ constant('POCHE_VERSION') }}</strong></li> |
26 | <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> | 27 | <li>{% trans "latest stable version" %} : {{ prod }}. {% if compare_prod == -1 %}<strong><a href="http://inthepoche.com/">{% trans "a more recent stable version is available." %}</a></strong>{% else %}{% trans "you are up to date." %}{% endif %}</li> |
27 | {% 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 %} | 28 | {% if constant('DEBUG_POCHE') == 1 %}<li>{% trans "latest dev version" %} : {{ dev }}. {% if compare_dev == -1 %}<strong><a href="http://inthepoche.com/">{% trans "a more recent development version is available." %}</a></strong>{% else %}{% trans "you are up to date." %}{% endif %}</li>{% endif %} |
28 | </ul> | 29 | </ul> |
29 | 30 | ||
30 | <h2>{% trans "Change your password" %}</h2> | 31 | <h2>{% trans "Change your password" %}</h2> |
@@ -48,7 +49,7 @@ | |||
48 | 49 | ||
49 | <h2>{% trans "Import" %}</h2> | 50 | <h2>{% trans "Import" %}</h2> |
50 | <p>{% trans "Please execute the import script locally, it can take a very long time." %}</p> | 51 | <p>{% trans "Please execute the import script locally, it can take a very long time." %}</p> |
51 | <p>{% trans "More infos in the official doc:" %} <a href="http://inthepoche.com/?pages/Documentation">inthepoche.com</a></p> | 52 | <p>{% trans "More infos in the official doc:" %} <a href="http://inthepoche.com/doc">inthepoche.com</a></p> |
52 | <ul> | 53 | <ul> |
53 | <li><a href="./?import&from=pocket">{% trans "import from Pocket" %}</a> (you must have a "{{ constant('IMPORT_POCKET_FILE')}}" file on your server)</li> | 54 | <li><a href="./?import&from=pocket">{% trans "import from Pocket" %}</a> (you must have a "{{ constant('IMPORT_POCKET_FILE')}}" file on your server)</li> |
54 | <li><a href="./?import&from=readability">{% trans "import from Readability" %}</a> (you must have a "{{constant('IMPORT_READABILITY_FILE')}}" file on your server)</li> | 55 | <li><a href="./?import&from=readability">{% trans "import from Readability" %}</a> (you must have a "{{constant('IMPORT_READABILITY_FILE')}}" file on your server)</li> |
diff --git a/tpl/css/style.css b/tpl/css/style.css index 7633534c..c056429d 100644 --- a/tpl/css/style.css +++ b/tpl/css/style.css | |||
@@ -98,6 +98,10 @@ a, a:hover, a:visited { | |||
98 | #main #content .entrie { | 98 | #main #content .entrie { |
99 | border-bottom: 1px dashed #222; | 99 | border-bottom: 1px dashed #222; |
100 | } | 100 | } |
101 | /* First entry */ | ||
102 | #main #content .results + .entrie { | ||
103 | clear: both; | ||
104 | } | ||
101 | 105 | ||
102 | #main .entrie .tools { | 106 | #main .entrie .tools { |
103 | list-style-type: none; | 107 | list-style-type: none; |
@@ -189,11 +193,22 @@ a, a:hover, a:visited { | |||
189 | } | 193 | } |
190 | 194 | ||
191 | 195 | ||
192 | /* Pagination */ | 196 | .results { |
193 | .pagination { | 197 | overflow: hidden; |
194 | clear: both; | ||
195 | padding-bottom: 20px; | 198 | padding-bottom: 20px; |
196 | padding-top: 10px; | 199 | padding-top: 10px; |
200 | } | ||
201 | |||
202 | .nb-results { | ||
203 | float: left; | ||
204 | font-size: 0.9em; | ||
205 | line-height: 24px; | ||
206 | vertical-align: middle; | ||
207 | } | ||
208 | |||
209 | /* Pagination */ | ||
210 | .pagination { | ||
211 | float: right; | ||
197 | text-align: right; | 212 | text-align: right; |
198 | } | 213 | } |
199 | .pagination a { | 214 | .pagination a { |
@@ -221,12 +236,7 @@ a, a:hover, a:visited { | |||
221 | margin: 2px; | 236 | margin: 2px; |
222 | } | 237 | } |
223 | .pagination .disabled { | 238 | .pagination .disabled { |
224 | border: 1px solid #eee; | 239 | display: none; |
225 | color: #ddd; | ||
226 | margin: 2px; | ||
227 | padding: 4px 8px; | ||
228 | font-size: 11px; | ||
229 | font-weight: bold; | ||
230 | } | 240 | } |
231 | 241 | ||
232 | #bookmarklet { | 242 | #bookmarklet { |
@@ -257,3 +267,17 @@ footer { | |||
257 | .reading-time { | 267 | .reading-time { |
258 | font-size: 0.8em; | 268 | font-size: 0.8em; |
259 | } | 269 | } |
270 | |||
271 | #inputform { | ||
272 | display: none; | ||
273 | text-align:center; | ||
274 | max-width:300px; | ||
275 | margin-left:auto; | ||
276 | margin-right:auto; | ||
277 | margin-top:5px; | ||
278 | padding-bottom: 5px; | ||
279 | background-color: rgba(0, 0, 0, 0.9); | ||
280 | opacity:0.8; | ||
281 | color:white; | ||
282 | border-radius: 3px; | ||
283 | } | ||
diff --git a/tpl/error.twig b/tpl/error.twig index 14c49925..c829d12b 100644 --- a/tpl/error.twig +++ b/tpl/error.twig | |||
@@ -2,5 +2,5 @@ | |||
2 | {% block title %}{% trans "plop" %}{% endblock %} | 2 | {% block title %}{% trans "plop" %}{% endblock %} |
3 | {% block content %} | 3 | {% block content %} |
4 | {{ msg|raw }} | 4 | {{ msg|raw }} |
5 | <p>Don't forget <a href="http://inthepoche.com/?pages/Documentation">the documentation</a>.</p> | 5 | <p>Don't forget <a href="http://inthepoche.com/doc">the documentation</a>.</p> |
6 | {% endblock %} \ No newline at end of file | 6 | {% endblock %} \ No newline at end of file |
diff --git a/tpl/home.twig b/tpl/home.twig index f51c34f2..771c36c5 100644 --- a/tpl/home.twig +++ b/tpl/home.twig | |||
@@ -12,16 +12,25 @@ | |||
12 | {% include '_menu.twig' %} | 12 | {% include '_menu.twig' %} |
13 | {% endblock %} | 13 | {% endblock %} |
14 | {% block precontent %} | 14 | {% block precontent %} |
15 | {% if entries|length > 1 %} | ||
15 | <ul id="sort"> | 16 | <ul id="sort"> |
16 | <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> | 17 | <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> |
17 | <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> | 18 | <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> |
18 | </ul> | 19 | </ul> |
20 | {% endif %} | ||
19 | {% endblock %} | 21 | {% endblock %} |
20 | {% block content %} | 22 | {% block content %} |
21 | {{ page_links | raw }} | ||
22 | {% if entries is empty %} | 23 | {% if entries is empty %} |
23 | <div class="messages warning"><p>{% trans "No link available here!" %}</p></div> | 24 | <div class="messages warning"><p>{% trans "No link available here!" %}</p></div> |
24 | {% else %} | 25 | {% else %} |
26 | {% block pager %} | ||
27 | {% if nb_results > 1 %} | ||
28 | <div class="results"> | ||
29 | <div class="nb-results">{{ nb_results }} {% trans "results" %}</div> | ||
30 | {{ page_links | raw }} | ||
31 | </div> | ||
32 | {% endif %} | ||
33 | {% endblock %} | ||
25 | {% for entry in entries %} | 34 | {% for entry in entries %} |
26 | <div id="entry-{{ entry.id|e }}" class="entrie"> | 35 | <div id="entry-{{ entry.id|e }}" class="entrie"> |
27 | <h2><a href="index.php?view=view&id={{ entry.id|e }}">{{ entry.title|raw }}</a></h2> | 36 | <h2><a href="index.php?view=view&id={{ entry.id|e }}">{{ entry.title|raw }}</a></h2> |
@@ -36,5 +45,5 @@ | |||
36 | </div> | 45 | </div> |
37 | {% endfor %} | 46 | {% endfor %} |
38 | {% endif %} | 47 | {% endif %} |
39 | {{ page_links | raw }} | 48 | {{ block('pager') }} |
40 | {% endblock %} \ No newline at end of file | 49 | {% endblock %} \ No newline at end of file |
diff --git a/tpl/install.twig b/tpl/install.twig index afb5b0f6..6e85e5cb 100644 --- a/tpl/install.twig +++ b/tpl/install.twig | |||
@@ -5,7 +5,7 @@ | |||
5 | <fieldset class="w500p center"> | 5 | <fieldset class="w500p center"> |
6 | <h2 class="mbs txtcenter">{% trans "install your poche" %}</h2> | 6 | <h2 class="mbs txtcenter">{% trans "install your poche" %}</h2> |
7 | <p> | 7 | <p> |
8 | {% trans "poche is still not installed. Please fill the below form to install it. Don't hesitate to <a href='http://inthepoche.com/?pages/Documentation'>read the documentation on poche website</a>." %} | 8 | {% trans "poche is still not installed. Please fill the below form to install it. Don't hesitate to <a href='http://inthepoche.com/doc'>read the documentation on poche website</a>." %} |
9 | </p> | 9 | </p> |
10 | <p class="row"> | 10 | <p class="row"> |
11 | <label class="col w150p" for="login">{% trans "Login" %}</label> | 11 | <label class="col w150p" for="login">{% trans "Login" %}</label> |
diff --git a/tpl/js/poche.js b/tpl/js/poche.js new file mode 100644 index 00000000..c2e02f9c --- /dev/null +++ b/tpl/js/poche.js | |||
@@ -0,0 +1,2 @@ | |||
1 | function showinput(){ | ||
2 | $('#inputform').fadeIn('fast');} \ No newline at end of file | ||
diff --git a/tpl/view.twig b/tpl/view.twig index 283cfb5b..ee16afa6 100644 --- a/tpl/view.twig +++ b/tpl/view.twig | |||
@@ -11,7 +11,7 @@ | |||
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|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 %} |
12 | {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&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|url_encode }}&body={{ entry.url|url_encode }}%20via%20@getpoche" class="tool email" title="{% trans "email" %}"><span>{% trans "email" %}</span></a></li>{% endif %} |
13 | {% 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 %} | 13 | {% 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 %} |
14 | {% if constant('FLATTR') == 1 %}{% if flattr.status == "flattrable" %}<li><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr" title="flattr"><span>flattr</span></a></li>{% elseif flattr.status == "flattred" %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr"><span>flattr</span>{{ flattr.numflattrs }}</a></li>{% else %}{% endif %}{% endif %} | 14 | {% 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>flattr</span></a></li>{% elseif flattr.status == constant('FLATTRED') %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr" target="_blank" title="{% trans "flattr" %}"><span>flattr</span>{{ flattr.numflattrs }}</a></li>{% endif %}{% endif %} |
15 | </ul> | 15 | </ul> |
16 | </div> | 16 | </div> |
17 | <header class="mbm"> | 17 | <header class="mbm"> |
@@ -32,7 +32,7 @@ | |||
32 | {% 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 %} | 32 | {% 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 %} |
33 | {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&body={{ entry.url|url_encode }}%20via%20@getpoche" class="tool email" title="{% trans "email" %}"><span>{% trans "email" %}</span></a></li>{% endif %} | 33 | {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&body={{ entry.url|url_encode }}%20via%20@getpoche" class="tool email" title="{% trans "email" %}"><span>{% trans "email" %}</span></a></li>{% endif %} |
34 | {% 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 %} | 34 | {% 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 %} |
35 | {% if constant('FLATTR') == 1 %}{% if flattr.status == "flattrable" %}<li><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr" title="flattr"><span>flattr</span></a></li>{% elseif flattr.status == "flattred" %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr"><span>flattr</span>{{ flattr.numflattrs }}</a></li>{% else %}{% endif %}{% endif %} | 35 | {% 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>flattr</span></a></li>{% elseif flattr.status == constant('FLATTRED') %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr" target="_blank" title="{% trans "flattr" %}"><span>flattr</span>{{ flattr.numflattrs }}</a></li>{% endif %}{% endif %} |
36 | </ul> | 36 | </ul> |
37 | <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&body={{ entry.url|url_encode }}">{% trans "contact us by mail" %}</a></p> | 37 | <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&body={{ entry.url|url_encode }}">{% trans "contact us by mail" %}</a></p> |
38 | </div> | 38 | </div> |