diff options
-rwxr-xr-x[-rw-r--r--] | inc/poche/Database.class.php | 79 | ||||
-rwxr-xr-x | inc/poche/Poche.class.php | 31 | ||||
-rw-r--r-- | inc/poche/Tools.class.php | 2 | ||||
-rw-r--r-- | themes/baggy/_menu.twig | 5 | ||||
-rwxr-xr-x | themes/baggy/css/main.css | 5 | ||||
-rw-r--r-- | themes/baggy/edit-tags.twig | 7 | ||||
-rw-r--r-- | themes/baggy/home.twig | 5 | ||||
-rw-r--r-- | themes/baggy/tag.twig | 34 | ||||
-rwxr-xr-x | themes/courgette/home.twig | 4 | ||||
-rw-r--r-- | themes/default/edit-tags.twig | 15 | ||||
-rw-r--r-- | themes/default/home.twig | 8 | ||||
-rw-r--r-- | themes/default/tag.twig | 33 | ||||
-rw-r--r-- | themes/default/view.twig | 11 | ||||
-rw-r--r-- | themes/solarized-dark/css/style-solarized-dark.css | 12 | ||||
-rw-r--r-- | themes/solarized/css/style-solarized.css | 12 |
15 files changed, 138 insertions, 125 deletions
diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index a366e866..c998fe14 100644..100755 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php | |||
@@ -10,8 +10,15 @@ | |||
10 | 10 | ||
11 | class Database { | 11 | class Database { |
12 | var $handle; | 12 | var $handle; |
13 | 13 | private $order = array( | |
14 | function __construct() | 14 | 'ia' => 'ORDER BY entries.id', |
15 | 'id' => 'ORDER BY entries.id DESC', | ||
16 | 'ta' => 'ORDER BY lower(entries.title)', | ||
17 | 'td' => 'ORDER BY lower(entries.title) DESC', | ||
18 | 'default' => 'ORDER BY entries.id' | ||
19 | ); | ||
20 | |||
21 | function __construct() | ||
15 | { | 22 | { |
16 | switch (STORAGE) { | 23 | switch (STORAGE) { |
17 | case 'sqlite': | 24 | case 'sqlite': |
@@ -257,48 +264,62 @@ class Database { | |||
257 | $query = $this->executeQuery($sql, $params); | 264 | $query = $this->executeQuery($sql, $params); |
258 | } | 265 | } |
259 | 266 | ||
260 | public function getEntriesByView($view, $user_id, $limit = '') { | 267 | public function getEntriesByView($view, $user_id, $limit = '', $tag_id = 0) { |
261 | switch ($_SESSION['sort']) | 268 | switch ($view) { |
262 | { | 269 | case 'archive': |
263 | case 'ia': | 270 | $sql = "SELECT * FROM entries WHERE user_id=? AND is_read=? "; |
264 | $order = 'ORDER BY id'; | 271 | $params = array($user_id, 1); |
265 | break; | ||
266 | case 'id': | ||
267 | $order = 'ORDER BY id DESC'; | ||
268 | break; | 272 | break; |
269 | case 'ta': | 273 | case 'fav' : |
270 | $order = 'ORDER BY lower(title)'; | 274 | $sql = "SELECT * FROM entries WHERE user_id=? AND is_fav=? "; |
275 | $params = array($user_id, 1); | ||
271 | break; | 276 | break; |
272 | case 'td': | 277 | case 'tag' : |
273 | $order = 'ORDER BY lower(title) DESC'; | 278 | $sql = "SELECT entries.* FROM entries |
279 | LEFT JOIN tags_entries ON tags_entries.entry_id=entries.id | ||
280 | WHERE entries.user_id=? AND tags_entries.tag_id = ? "; | ||
281 | $params = array($user_id, $tag_id); | ||
274 | break; | 282 | break; |
275 | default: | 283 | default: |
276 | $order = 'ORDER BY id'; | 284 | $sql = "SELECT * FROM entries WHERE user_id=? AND is_read=? "; |
285 | $params = array($user_id, 0); | ||
277 | break; | 286 | break; |
278 | } | 287 | } |
279 | 288 | ||
280 | switch ($view) | 289 | $sql .= $this->getEntriesOrder().' ' . $limit; |
281 | { | 290 | |
291 | $query = $this->executeQuery($sql, $params); | ||
292 | $entries = $query->fetchAll(); | ||
293 | |||
294 | return $entries; | ||
295 | } | ||
296 | |||
297 | public function getEntriesByViewCount($view, $user_id, $tag_id = 0) { | ||
298 | switch ($view) { | ||
282 | case 'archive': | 299 | case 'archive': |
283 | $sql = "SELECT * FROM entries WHERE user_id=? AND is_read=? " . $order; | 300 | $sql = "SELECT count(*) FROM entries WHERE user_id=? AND is_read=? "; |
284 | $params = array($user_id, 1); | 301 | $params = array($user_id, 1); |
285 | break; | 302 | break; |
286 | case 'fav' : | 303 | case 'fav' : |
287 | $sql = "SELECT * FROM entries WHERE user_id=? AND is_fav=? " . $order; | 304 | $sql = "SELECT count(*) FROM entries WHERE user_id=? AND is_fav=? "; |
288 | $params = array($user_id, 1); | 305 | $params = array($user_id, 1); |
289 | break; | 306 | break; |
307 | case 'tag' : | ||
308 | $sql = "SELECT count(*) FROM entries | ||
309 | LEFT JOIN tags_entries ON tags_entries.entry_id=entries.id | ||
310 | WHERE entries.user_id=? AND tags_entries.tag_id = ? "; | ||
311 | $params = array($user_id, $tag_id); | ||
312 | break; | ||
290 | default: | 313 | default: |
291 | $sql = "SELECT * FROM entries WHERE user_id=? AND is_read=? " . $order; | 314 | $sql = "SELECT count(*) FROM entries WHERE user_id=? AND is_read=? "; |
292 | $params = array($user_id, 0); | 315 | $params = array($user_id, 0); |
293 | break; | 316 | break; |
294 | } | 317 | } |
295 | 318 | ||
296 | $sql .= ' ' . $limit; | ||
297 | |||
298 | $query = $this->executeQuery($sql, $params); | 319 | $query = $this->executeQuery($sql, $params); |
299 | $entries = $query->fetchAll(); | 320 | list($count) = $query->fetch(); |
300 | 321 | ||
301 | return $entries; | 322 | return $count; |
302 | } | 323 | } |
303 | 324 | ||
304 | public function updateContent($id, $content, $user_id) { | 325 | public function updateContent($id, $content, $user_id) { |
@@ -420,4 +441,14 @@ class Database { | |||
420 | $query = $this->executeQuery($sql_action, $params_action); | 441 | $query = $this->executeQuery($sql_action, $params_action); |
421 | return $query; | 442 | return $query; |
422 | } | 443 | } |
444 | |||
445 | private function getEntriesOrder() { | ||
446 | if (isset($_SESSION['sort']) and array_key_exists($_SESSION['sort'], $this->order)) { | ||
447 | return $this->order[$_SESSION['sort']]; | ||
448 | } | ||
449 | else { | ||
450 | return $this->order['default']; | ||
451 | } | ||
452 | } | ||
453 | |||
423 | } | 454 | } |
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index e7985cf1..33dddf1e 100755 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php | |||
@@ -595,14 +595,7 @@ class Poche | |||
595 | $tpl_vars = array( | 595 | $tpl_vars = array( |
596 | 'entry_id' => $id, | 596 | 'entry_id' => $id, |
597 | 'tags' => $tags, | 597 | 'tags' => $tags, |
598 | ); | 598 | 'entry' => $entry, |
599 | break; | ||
600 | case 'tag': | ||
601 | $entries = $this->store->retrieveEntriesByTag($id, $this->user->getId()); | ||
602 | $tag = $this->store->retrieveTag($id, $this->user->getId()); | ||
603 | $tpl_vars = array( | ||
604 | 'tag' => $tag, | ||
605 | 'entries' => $entries, | ||
606 | ); | 599 | ); |
607 | break; | 600 | break; |
608 | case 'tags': | 601 | case 'tags': |
@@ -643,22 +636,28 @@ class Poche | |||
643 | Tools::logm('error in view call : entry is null'); | 636 | Tools::logm('error in view call : entry is null'); |
644 | } | 637 | } |
645 | break; | 638 | break; |
646 | default: # home, favorites and archive views | 639 | default: # home, favorites, archive and tag views |
647 | $entries = $this->store->getEntriesByView($view, $this->user->getId()); | ||
648 | $tpl_vars = array( | 640 | $tpl_vars = array( |
649 | 'entries' => '', | 641 | 'entries' => '', |
650 | 'page_links' => '', | 642 | 'page_links' => '', |
651 | 'nb_results' => '', | 643 | 'nb_results' => '', |
652 | ); | 644 | ); |
653 | 645 | ||
654 | if (count($entries) > 0) { | 646 | //if id is given - we retrive entries by tag: id is tag id |
655 | $this->pagination->set_total(count($entries)); | 647 | if ($id) { |
648 | $tpl_vars['tag'] = $this->store->retrieveTag($id, $this->user->getId()); | ||
649 | $tpl_vars['id'] = intval($id); | ||
650 | } | ||
651 | |||
652 | $count = $this->store->getEntriesByViewCount($view, $this->user->getId(), $id); | ||
653 | |||
654 | if ($count > 0) { | ||
655 | $this->pagination->set_total($count); | ||
656 | $page_links = str_replace(array('previous', 'next'), array(_('previous'), _('next')), | 656 | $page_links = str_replace(array('previous', 'next'), array(_('previous'), _('next')), |
657 | $this->pagination->page_links('?view=' . $view . '&sort=' . $_SESSION['sort'] . '&')); | 657 | $this->pagination->page_links('?view=' . $view . '&sort=' . $_SESSION['sort'] . (($id)?'&id='.$id:'') . '&' )); |
658 | $datas = $this->store->getEntriesByView($view, $this->user->getId(), $this->pagination->get_limit()); | 658 | $tpl_vars['entries'] = $this->store->getEntriesByView($view, $this->user->getId(), $this->pagination->get_limit(), $id); |
659 | $tpl_vars['entries'] = $datas; | ||
660 | $tpl_vars['page_links'] = $page_links; | 659 | $tpl_vars['page_links'] = $page_links; |
661 | $tpl_vars['nb_results'] = count($entries); | 660 | $tpl_vars['nb_results'] = $count; |
662 | } | 661 | } |
663 | Tools::logm('display ' . $view . ' view'); | 662 | Tools::logm('display ' . $view . ' view'); |
664 | break; | 663 | break; |
diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 515a08aa..4ed28ed1 100644 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php | |||
@@ -92,7 +92,7 @@ class Tools | |||
92 | { | 92 | { |
93 | $views = array( | 93 | $views = array( |
94 | 'install', 'import', 'export', 'config', 'tags', | 94 | 'install', 'import', 'export', 'config', 'tags', |
95 | 'edit-tags', 'view', 'login', 'error', 'tag' | 95 | 'edit-tags', 'view', 'login', 'error' |
96 | ); | 96 | ); |
97 | 97 | ||
98 | if (in_array($view, $views)) { | 98 | if (in_array($view, $views)) { |
diff --git a/themes/baggy/_menu.twig b/themes/baggy/_menu.twig index 3e7a2cbf..e9cd9d4a 100644 --- a/themes/baggy/_menu.twig +++ b/themes/baggy/_menu.twig | |||
@@ -4,6 +4,9 @@ | |||
4 | <li><a href="./?view=fav" {% if view == 'fav' %}class="current"{% endif %}>{% trans "favorites" %}</a></li> | 4 | <li><a href="./?view=fav" {% if view == 'fav' %}class="current"{% endif %}>{% trans "favorites" %}</a></li> |
5 | <li><a href="./?view=archive" {% if view == 'archive' %}class="current"{% endif %}>{% trans "archive" %}</a></li> | 5 | <li><a href="./?view=archive" {% if view == 'archive' %}class="current"{% endif %}>{% trans "archive" %}</a></li> |
6 | <li><a href="./?view=tags" {% if view == 'tags' %}class="current"{% endif %}>{% trans "tags" %}</a></li> | 6 | <li><a href="./?view=tags" {% if view == 'tags' %}class="current"{% endif %}>{% trans "tags" %}</a></li> |
7 | <li><a href="javascript: void(null);" id="pocheit">{% trans "save a link" %}</a></li> | ||
7 | <li><a href="./?view=config" {% if view == 'config' %}class="current"{% endif %}>{% trans "config" %}</a></li> | 8 | <li><a href="./?view=config" {% if view == 'config' %}class="current"{% endif %}>{% trans "config" %}</a></li> |
8 | <li><a class="icon icon-power" href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li> | 9 | <li><a class="icon icon-power" href="./?logout" title="{% trans "logout" %}">{% trans "logout" %}</a></li> |
9 | </ul> \ No newline at end of file | 10 | </ul> |
11 | |||
12 | {% include '_pocheit-form.twig' %} | ||
diff --git a/themes/baggy/css/main.css b/themes/baggy/css/main.css index 45211a87..3b8220d9 100755 --- a/themes/baggy/css/main.css +++ b/themes/baggy/css/main.css | |||
@@ -563,7 +563,8 @@ footer a { | |||
563 | ========================================================================== */ | 563 | ========================================================================== */ |
564 | 564 | ||
565 | .messages { | 565 | .messages { |
566 | text-align: center; | 566 | text-align: left; |
567 | margin-top: 1em; | ||
567 | } | 568 | } |
568 | 569 | ||
569 | .messages > * { display: inline-block;} | 570 | .messages > * { display: inline-block;} |
@@ -818,4 +819,4 @@ blockquote { | |||
818 | #article_toolbar a { | 819 | #article_toolbar a { |
819 | padding: 0.3em 0.4em 0.2em; | 820 | padding: 0.3em 0.4em 0.2em; |
820 | } | 821 | } |
821 | } \ No newline at end of file | 822 | } |
diff --git a/themes/baggy/edit-tags.twig b/themes/baggy/edit-tags.twig index 9f11a2c3..9e9012ee 100644 --- a/themes/baggy/edit-tags.twig +++ b/themes/baggy/edit-tags.twig | |||
@@ -4,6 +4,9 @@ | |||
4 | {% include '_menu.twig' %} | 4 | {% include '_menu.twig' %} |
5 | {% endblock %} | 5 | {% endblock %} |
6 | {% block content %} | 6 | {% block content %} |
7 | <div id="article"> | ||
8 | <h2>{{ entry.title|raw }}</21> | ||
9 | </div> | ||
7 | {% if tags is empty %} | 10 | {% if tags is empty %} |
8 | <div class="notags">no tags</div> | 11 | <div class="notags">no tags</div> |
9 | {% endif %} | 12 | {% endif %} |
@@ -11,10 +14,10 @@ | |||
11 | {% for tag in tags %}<li>{{ tag.value }} <a href="./?action=remove_tag&tag_id={{ tag.id }}&id={{ entry_id }}">✘</a></li>{% endfor %} | 14 | {% for tag in tags %}<li>{{ tag.value }} <a href="./?action=remove_tag&tag_id={{ tag.id }}&id={{ entry_id }}">✘</a></li>{% endfor %} |
12 | </ul> | 15 | </ul> |
13 | <form method="post" action="./?action=add_tag"> | 16 | <form method="post" action="./?action=add_tag"> |
14 | <label for="value">Add tags: </label><input type="text" placeholder="interview, editorial, video" id="value" name="value" required="required" /> | ||
15 | <p>{% trans "You can enter multiple tags, separated by commas." %}</p> | ||
16 | <input type="hidden" name="entry_id" value="{{ entry_id }}" /> | 17 | <input type="hidden" name="entry_id" value="{{ entry_id }}" /> |
18 | <label for="value">Add tags: </label><input type="text" placeholder="interview, editorial, video" id="value" name="value" required="required" /> | ||
17 | <input type="submit" value="Tag" /> | 19 | <input type="submit" value="Tag" /> |
20 | <p>{% trans "You can enter multiple tags, separated by commas." %}</p> | ||
18 | </form> | 21 | </form> |
19 | <a class="icon icon-reply return" href="./?view=view&id={{ entry_id }}">{% trans "return to article" %}</a> | 22 | <a class="icon icon-reply return" href="./?view=view&id={{ entry_id }}">{% trans "return to article" %}</a> |
20 | {% endblock %} | 23 | {% endblock %} |
diff --git a/themes/baggy/home.twig b/themes/baggy/home.twig index 33afdbbd..4f9db063 100644 --- a/themes/baggy/home.twig +++ b/themes/baggy/home.twig | |||
@@ -12,6 +12,9 @@ | |||
12 | {% include '_menu.twig' %} | 12 | {% include '_menu.twig' %} |
13 | {% endblock %} | 13 | {% endblock %} |
14 | {% block content %} | 14 | {% block content %} |
15 | {% if tag %} | ||
16 | <h3>{% trans "Tag" %}: <b>{{ tag.value }}</b></h3> | ||
17 | {% endif %} | ||
15 | {% if entries is empty %} | 18 | {% if entries is empty %} |
16 | <div class="messages warning"><p>{% trans "No articles found." %}</p></div> | 19 | <div class="messages warning"><p>{% trans "No articles found." %}</p></div> |
17 | {% else %} | 20 | {% else %} |
@@ -40,7 +43,7 @@ | |||
40 | </ul> | 43 | </ul> |
41 | <p>{{ entry.content|striptags|slice(0, 300) }}...</p> | 44 | <p>{{ entry.content|striptags|slice(0, 300) }}...</p> |
42 | </div> | 45 | </div> |
43 | 46 | ||
44 | {% endfor %} | 47 | {% endfor %} |
45 | </div> | 48 | </div> |
46 | {% if view == 'home' %}{% if nb_results > 1 %}<a title="{% trans "Mark all the entries as read" %}" href="./?action=archive_all">{{ "Mark all the entries as read" }}</a>{% endif %}{% endif %} | 49 | {% if view == 'home' %}{% if nb_results > 1 %}<a title="{% trans "Mark all the entries as read" %}" href="./?action=archive_all">{{ "Mark all the entries as read" }}</a>{% endif %}{% endif %} |
diff --git a/themes/baggy/tag.twig b/themes/baggy/tag.twig deleted file mode 100644 index 141ac909..00000000 --- a/themes/baggy/tag.twig +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | {% extends "layout.twig" %} | ||
2 | {% block title %}tag {% endblock %} | ||
3 | {% block menu %} | ||
4 | {% include '_menu.twig' %} | ||
5 | {% endblock %} | ||
6 | {% block content %} | ||
7 | <h3>{% trans "Tag" %} {{ tag.value }}</h3> | ||
8 | {% if entries is empty %} | ||
9 | <div class="messages warning"><p>{% trans "No link available here!" %}</p></div> | ||
10 | {% else %} | ||
11 | {% block pager %} | ||
12 | {% if nb_results > 1 %} | ||
13 | <div class="results"> | ||
14 | <div class="nb-results">{{ nb_results }} {% trans "results" %}</div> | ||
15 | {{ page_links | raw }} | ||
16 | </div> | ||
17 | {% endif %} | ||
18 | {% endblock %} | ||
19 | <div class="list-entries"> | ||
20 | {% for entry in entries %} | ||
21 | <div id="entry-{{ entry.id|e }}" class="entrie"> | ||
22 | <h2><a href="index.php?view=view&id={{ entry.id|e }}">{{ entry.title|raw }}</a></h2> | ||
23 | <ul class="tools links"> | ||
24 | <li><a title="{% trans "Toggle mark as read" %}" class="tool icon-check icon {% if entry.is_read == 0 %}archive-off{% else %}archive{% endif %}" href="./?action=toggle_archive&id={{ entry.id|e }}"><span>{% trans "Toggle mark as read" %}</span></a></li> | ||
25 | <li><a title="{% trans "toggle favorite" %}" class="tool icon-star icon {% if entry.is_fav == 0 %}fav-off{% else %}fav{% endif %}" href="./?action=toggle_fav&id={{ entry.id|e }}"><span>{% trans "toggle favorite" %}</span></a></li> | ||
26 | <li><a title="{% trans "delete" %}" class="tool delete icon-trash icon" href="./?action=delete&id={{ entry.id|e }}"><span>{% trans "delete" %}</span></a></li> | ||
27 | <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}" class="tool link icon-link icon"><span>{{ entry.url | e | getDomain }}</span></a></li> | ||
28 | </ul> | ||
29 | <p>{{ entry.content|striptags|slice(0, 300) }}...</p> | ||
30 | </div> | ||
31 | {% endfor %} | ||
32 | </div> | ||
33 | {% endif %} | ||
34 | {% endblock %} \ No newline at end of file | ||
diff --git a/themes/courgette/home.twig b/themes/courgette/home.twig index 1367ebe8..416cfa43 100755 --- a/themes/courgette/home.twig +++ b/themes/courgette/home.twig | |||
@@ -14,8 +14,8 @@ | |||
14 | {% block precontent %} | 14 | {% block precontent %} |
15 | {% if entries|length > 1 %} | 15 | {% if entries|length > 1 %} |
16 | <ul id="sort"> | 16 | <ul id="sort"> |
17 | <li><a href="./?sort=ia&view={{ view }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ 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="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/down.png" alt="{% trans "by date desc" %}" title="{% trans "by date desc" %}" /></a></li> | 17 | <li><a href="./?sort=ia&view={{ view }}&id={{ id }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/top.png" alt="{% trans "by date asc" %}" title="{% trans "by date asc" %}" /></a> {% trans "by date" %} <a href="./?sort=id&view={{ view }}&id={{ id }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/down.png" alt="{% trans "by date desc" %}" title="{% trans "by date desc" %}" /></a></li> |
18 | <li><a href="./?sort=ta&view={{ view }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ 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="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/down.png" alt="{% trans "by title desc" %}" title="{% trans "by title desc" %}" /></a></li> | 18 | <li><a href="./?sort=ta&view={{ view }}&id={{ id }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/top.png" alt="{% trans "by title asc" %}" title="{% trans "by title asc" %}" /></a> {% trans "by title" %} <a href="./?sort=td&view={{ view }}&id={{ id }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/down.png" alt="{% trans "by title desc" %}" title="{% trans "by title desc" %}" /></a></li> |
19 | </ul> | 19 | </ul> |
20 | {% endif %} | 20 | {% endif %} |
21 | {% endblock %} | 21 | {% endblock %} |
diff --git a/themes/default/edit-tags.twig b/themes/default/edit-tags.twig index 53852d39..83f04aa0 100644 --- a/themes/default/edit-tags.twig +++ b/themes/default/edit-tags.twig | |||
@@ -4,6 +4,13 @@ | |||
4 | {% include '_menu.twig' %} | 4 | {% include '_menu.twig' %} |
5 | {% endblock %} | 5 | {% endblock %} |
6 | {% block content %} | 6 | {% block content %} |
7 | |||
8 | <div id="article"> | ||
9 | <header class="mbm"> | ||
10 | <h1>{{ entry.title|raw }}</h1> | ||
11 | </header> | ||
12 | </div> | ||
13 | |||
7 | {% if tags is empty %} | 14 | {% if tags is empty %} |
8 | no tags | 15 | no tags |
9 | {% endif %} | 16 | {% endif %} |
@@ -11,10 +18,12 @@ no tags | |||
11 | {% for tag in tags %}<li>{{ tag.value }} <a href="./?action=remove_tag&tag_id={{ tag.id }}&id={{ entry_id }}">✘</a></li>{% endfor %} | 18 | {% for tag in tags %}<li>{{ tag.value }} <a href="./?action=remove_tag&tag_id={{ tag.id }}&id={{ entry_id }}">✘</a></li>{% endfor %} |
12 | </ul> | 19 | </ul> |
13 | <form method="post" action="./?action=add_tag"> | 20 | <form method="post" action="./?action=add_tag"> |
14 | <label for="value">Add tags: </label><input type="text" placeholder="interview, editorial, video" id="value" name="value" required="required" /> | ||
15 | <p>{% trans "You can enter multiple tags, separated by commas." %}</p> | ||
16 | <input type="hidden" name="entry_id" value="{{ entry_id }}" /> | 21 | <input type="hidden" name="entry_id" value="{{ entry_id }}" /> |
22 | <label for="value">Add tags: </label> | ||
23 | <input type="text" placeholder="interview, editorial, video" id="value" name="value" required="required" /> | ||
17 | <input type="submit" value="Tag" /> | 24 | <input type="submit" value="Tag" /> |
25 | <p>{% trans "You can enter multiple tags, separated by commas." %}</p> | ||
26 | |||
18 | </form> | 27 | </form> |
19 | <a href="./?view=view&id={{ entry_id }}">{% trans "return to article" %}</a> | 28 | <a href="./?view=view&id={{ entry_id }}">« {% trans "return to article" %}</a> |
20 | {% endblock %} | 29 | {% endblock %} |
diff --git a/themes/default/home.twig b/themes/default/home.twig index 21013ec8..165fecc6 100644 --- a/themes/default/home.twig +++ b/themes/default/home.twig | |||
@@ -14,12 +14,16 @@ | |||
14 | {% block precontent %} | 14 | {% block precontent %} |
15 | {% if entries|length > 1 %} | 15 | {% if entries|length > 1 %} |
16 | <ul id="sort"> | 16 | <ul id="sort"> |
17 | <li><a href="./?sort=ia&view={{ view }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ 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="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/down.png" alt="{% trans "by date desc" %}" title="{% trans "by date desc" %}" /></a></li> | 17 | <li><a href="./?sort=ia&view={{ view }}&id={{ id }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/top.png" alt="{% trans "by date asc" %}" title="{% trans "by date asc" %}" /></a> {% trans "by date" %} <a href="./?sort=id&view={{ view }}&id={{ id }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/down.png" alt="{% trans "by date desc" %}" title="{% trans "by date desc" %}" /></a></li> |
18 | <li><a href="./?sort=ta&view={{ view }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ 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="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/down.png" alt="{% trans "by title desc" %}" title="{% trans "by title desc" %}" /></a></li> | 18 | <li><a href="./?sort=ta&view={{ view }}&id={{ id }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/top.png" alt="{% trans "by title asc" %}" title="{% trans "by title asc" %}" /></a> {% trans "by title" %} <a href="./?sort=td&view={{ view }}&id={{ id }}"><img src="{{ poche_url }}/themes/{{ theme }}/img/{{ theme }}/down.png" alt="{% trans "by title desc" %}" title="{% trans "by title desc" %}" /></a></li> |
19 | </ul> | 19 | </ul> |
20 | {% endif %} | 20 | {% endif %} |
21 | {% endblock %} | 21 | {% endblock %} |
22 | {% block content %} | 22 | {% block content %} |
23 | {% if tag %} | ||
24 | <h3>{% trans "Tag" %}: <b>{{ tag.value }}</b></h3> | ||
25 | {% endif %} | ||
26 | |||
23 | {% if entries is empty %} | 27 | {% if entries is empty %} |
24 | <div class="messages warning"><p>{% trans "No articles found." %}</p></div> | 28 | <div class="messages warning"><p>{% trans "No articles found." %}</p></div> |
25 | {% else %} | 29 | {% else %} |
diff --git a/themes/default/tag.twig b/themes/default/tag.twig deleted file mode 100644 index 364c7cd4..00000000 --- a/themes/default/tag.twig +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | {% extends "layout.twig" %} | ||
2 | {% block title %}tag {% endblock %} | ||
3 | {% block menu %} | ||
4 | {% include '_menu.twig' %} | ||
5 | {% endblock %} | ||
6 | {% block content %} | ||
7 | <h3>{% trans "Tag" %} {{ tag.value }}</h3> | ||
8 | {% if entries is empty %} | ||
9 | <div class="messages warning"><p>{% trans "No link available here!" %}</p></div> | ||
10 | {% else %} | ||
11 | {% block pager %} | ||
12 | {% if nb_results > 1 %} | ||
13 | <div class="results"> | ||
14 | <div class="nb-results">{{ nb_results }} {% trans "results" %}</div> | ||
15 | {{ page_links | raw }} | ||
16 | </div> | ||
17 | {% endif %} | ||
18 | {% endblock %} | ||
19 | {% for entry in entries %} | ||
20 | <div id="entry-{{ entry.id|e }}" class="entrie"> | ||
21 | <h2><a href="index.php?view=view&id={{ entry.id|e }}">{{ entry.title|raw }}</a></h2> | ||
22 | <ul class="tools"> | ||
23 | <li><a title="{% trans "toggle mark as read" %}" class="tool {% if entry.is_read == 0 %}archive-off{% else %}archive{% endif %}" href="./?action=toggle_archive&id={{ entry.id|e }}"><span>{% trans "toggle mark as read" %}</span></a></li> | ||
24 | <li><a title="{% trans "toggle favorite" %}" class="tool {% if entry.is_fav == 0 %}fav-off{% else %}fav{% endif %}" href="./?action=toggle_fav&id={{ entry.id|e }}"><span>{% trans "toggle favorite" %}</span></a></li> | ||
25 | <li><a title="{% trans "delete" %}" class="tool delete" href="./?action=delete&id={{ entry.id|e }}"><span>{% trans "delete" %}</span></a></li> | ||
26 | <li><a href="{{ entry.url|e }}" target="_blank" title="{% trans "original" %} : {{ entry.title|e }}" class="tool link"><span>{{ entry.url | e | getDomain }}</span></a></li> | ||
27 | <li><a target="_blank" title="{% trans "estimated reading time:" %} {{ entry.content| getReadingTime }} min" class="reading-time"><span>{{ entry.content| getReadingTime }} min</span></a></li> | ||
28 | </ul> | ||
29 | <p>{{ entry.content|striptags|slice(0, 300) }}...</p> | ||
30 | </div> | ||
31 | {% endfor %} | ||
32 | {% endif %} | ||
33 | {% endblock %} \ No newline at end of file | ||
diff --git a/themes/default/view.twig b/themes/default/view.twig index 9858996f..916abe0d 100644 --- a/themes/default/view.twig +++ b/themes/default/view.twig | |||
@@ -20,12 +20,15 @@ | |||
20 | <header class="mbm"> | 20 | <header class="mbm"> |
21 | <h1>{{ entry.title|raw }}</h1> | 21 | <h1>{{ entry.title|raw }}</h1> |
22 | </header> | 22 | </header> |
23 | <aside class="tags"> | 23 | {% block tags %} |
24 | {% trans "tags:" %} {% for tag in tags %}<a href="./?view=tag&id={{ tag.id }}">{{ tag.value }}</a> {% endfor %}<a href="./?view=edit-tags&id={{ entry.id|e }}" title="{% trans "Edit tags" %}">✎</a> | 24 | <aside class="tags"> |
25 | </aside> | 25 | {% trans "tags:" %} {% for tag in tags %}<a href="./?view=tag&id={{ tag.id }}">{{ tag.value }}</a> {% endfor %}<a href="./?view=edit-tags&id={{ entry.id|e }}" title="{% trans "Edit tags" %}">✎</a> |
26 | </aside> | ||
27 | {% endblock %} | ||
26 | <article> | 28 | <article> |
27 | {{ content | raw }} | 29 | {{ content | raw }} |
28 | </article> | 30 | </article> |
31 | {{ block('tags') }} | ||
29 | </div> | 32 | </div> |
30 | <script src="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/js/restoreScroll.js"></script> | 33 | <script src="{{ poche_url }}/themes/{{ constant('DEFAULT_THEME') }}/js/restoreScroll.js"></script> |
31 | <script type="text/javascript"> | 34 | <script type="text/javascript"> |
@@ -50,5 +53,5 @@ | |||
50 | $('#article_toolbar .tool.top').parent().hide(); | 53 | $('#article_toolbar .tool.top').parent().hide(); |
51 | } | 54 | } |
52 | }); | 55 | }); |
53 | </script> | 56 | </script> |
54 | {% endblock %} | 57 | {% endblock %} |
diff --git a/themes/solarized-dark/css/style-solarized-dark.css b/themes/solarized-dark/css/style-solarized-dark.css index 3b0feb2a..77a97d38 100644 --- a/themes/solarized-dark/css/style-solarized-dark.css +++ b/themes/solarized-dark/css/style-solarized-dark.css | |||
@@ -217,4 +217,16 @@ a.link span { | |||
217 | 217 | ||
218 | a.bad-display span { | 218 | a.bad-display span { |
219 | background-image: url('../img/solarized-dark/bad-display.png'); | 219 | background-image: url('../img/solarized-dark/bad-display.png'); |
220 | } | ||
221 | |||
222 | .arrow-down { | ||
223 | width: 0px; | ||
224 | height: 0px; | ||
225 | border-style: solid; | ||
226 | border-width: 10px 10px 0 10px; | ||
227 | border-color: #586E75 transparent transparent transparent; | ||
228 | |||
229 | position: absolute; | ||
230 | margin-top: 1.5em; | ||
231 | margin-left: -30px; | ||
220 | } \ No newline at end of file | 232 | } \ No newline at end of file |
diff --git a/themes/solarized/css/style-solarized.css b/themes/solarized/css/style-solarized.css index 6058d056..cf16338f 100644 --- a/themes/solarized/css/style-solarized.css +++ b/themes/solarized/css/style-solarized.css | |||
@@ -217,4 +217,16 @@ a.link span { | |||
217 | 217 | ||
218 | a.bad-display span { | 218 | a.bad-display span { |
219 | background-image: url('../img/solarized/bad-display.png'); | 219 | background-image: url('../img/solarized/bad-display.png'); |
220 | } | ||
221 | |||
222 | .arrow-down { | ||
223 | width: 0px; | ||
224 | height: 0px; | ||
225 | border-style: solid; | ||
226 | border-width: 10px 10px 0 10px; | ||
227 | border-color: #93A1A1 transparent transparent transparent; | ||
228 | |||
229 | position: absolute; | ||
230 | margin-top: 1.5em; | ||
231 | margin-left: -30px; | ||
220 | } \ No newline at end of file | 232 | } \ No newline at end of file |