From ae27d0ffca1c3a381226fed42adea66c3971fdde Mon Sep 17 00:00:00 2001
From: Thomas Citharel
Date: Fri, 13 Mar 2015 17:08:14 +0100
Subject: [PATCH] fix little problems and bring previous features to all themes
---
inc/poche/Poche.class.php | 2 +-
themes/baggy/home.twig | 12 +++++------
themes/default/css/style.css | 2 +-
themes/default/home.twig | 39 +++++++++++++++++++++++++++++-------
4 files changed, 40 insertions(+), 15 deletions(-)
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index 1a5cbe6cc..b27dda6c2 100755
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -523,7 +523,7 @@ class Poche
$this->pagination->page_links('?view=' . $view . '?search=' . $search . '&sort=' . $_SESSION['sort'] . '&' ));
$tpl_vars['page_links'] = $page_links;
$tpl_vars['nb_results'] = $count;
- $tpl_vars['search_term'] = $search;
+ $tpl_vars['searchterm'] = $search;
}
break;
case 'view':
diff --git a/themes/baggy/home.twig b/themes/baggy/home.twig
index 5f097f3f7..84fc8e8bb 100755
--- a/themes/baggy/home.twig
+++ b/themes/baggy/home.twig
@@ -21,7 +21,7 @@
{% elseif view == 'fav' %}{% trans "No articles favourited" %}
{% elseif view == 'archive' %}{% trans "No articles marked as read" %}
{% elseif view == 'tags' %}{% trans "No articles with this tag found" %}
- {% elseif search_term is defined %} {% trans %}No articles found for « {{ search_term }} »{% endtrans %}
+ {% elseif searchterm is defined %} {% trans %}No articles found for « {{ searchterm }} »{% endtrans %}
{% else %}{% trans "No articles found" %}{% endif %}
{% else %}
@@ -41,8 +41,8 @@
{{ nb_results }} {% trans "articles marked as read" %}
{% elseif view == 'tag' %}
{{ nb_results }} {% trans "articles with this tag" %}
- {% elseif search_term is defined %}{{ nb_results }}
- {% trans %}articles found for « {{ search_term }} »{% endtrans %}
+ {% elseif searchterm is defined %}
+ {{ nb_results }} {% trans %}articles found for « {{ searchterm }} »{% endtrans %}
{% else %}
{{ nb_results }} {% trans "articles" %}
{% endif %}
@@ -58,7 +58,7 @@
{% elseif view == 'fav' %}{% trans "Just one article favourited" %}
{% elseif view == 'archive' %}{% trans "One article marked as read" %}
{% elseif view == 'tag' %}{% trans "One article with this tag" %}
- {% elseif search_term is defined %}{% trans %}Only one result found for « {{ search_term }} »{% endtrans %}
+ {% elseif searchterm is defined %}{% trans %}Only one result found for « {{ searchterm }} »{% endtrans %}
{% else %}{% trans "One article found" %}{% endif %}
{% endif %}
@@ -91,20 +91,20 @@
{% if tag %}{% trans "Mark all articles from this tag as read" %} {% endif %}
- {% if entries is not empty %}
{% if tag %}
{% if constant('EPUB') == 1 %}{% trans "Download as ePub3" %}{% endif %}
{% if constant('MOBI') == 1 %}{% trans "Download as Mobi" %}{% endif %}
{% if constant('PDF') == 1 %}{% trans "Download as PDF" %}{% endif %}
+
{% elseif searchterm is defined %}
{% if constant('EPUB') == 1 %}{% trans "Download as ePub3" %}{% endif %}
{% if constant('MOBI') == 1 %}{% trans "Download as Mobi" %}{% endif %}
{% if constant('PDF') == 1 %}{% trans "Download as PDF" %}{% endif %}
+
{% else %}
{% if constant('EPUB') == 1 %}{% trans "Download as ePub3" %}{% endif %}
{% if constant('MOBI') == 1 %}{% trans "Download as Mobi" %}{% endif %}
{% if constant('PDF') == 1 %}{% trans "Download as PDF" %}{% endif %}
{% endif %}
- {% endif %}
{% endif %}
{% endblock %}
diff --git a/themes/default/css/style.css b/themes/default/css/style.css
index 58d908ee3..9a681748e 100755
--- a/themes/default/css/style.css
+++ b/themes/default/css/style.css
@@ -151,7 +151,7 @@ a:visited {
text-indent: -9999px;
}
-.random {
+.icon-random {
display: inline-block;
width: 16px;
height: 16px;
diff --git a/themes/default/home.twig b/themes/default/home.twig
index 8fe563972..a320cc7f0 100755
--- a/themes/default/home.twig
+++ b/themes/default/home.twig
@@ -25,22 +25,47 @@
{% trans "Tag" %}: {{ tag.value }}
{% endif %}
- {% if entries is empty %}
-
{% trans "No articles found." %}
+ {% if entries is empty%}
+ {% if view == 'home' %}
{% trans "No articles unread. Good job !" %}
+ {% elseif view == 'fav' %}
{% trans "No articles favourited" %}
+ {% elseif view == 'archive' %}
{% trans "No articles marked as read" %}
+ {% elseif view == 'tags' %}
{% trans "No articles with this tag found" %}
+ {% elseif searchterm is defined %}
{% trans %}No articles found for « {{ searchterm }} »{% endtrans %}
+ {% else %}
{{ nb_results }} {% trans "results" %}{% if searchterm is defined %}{% trans " found for « " %} {{ searchterm }} »{% endif %}
- {% trans "random" %}
+
+ {% if view == 'home' %}
+ {{ nb_results }} {% trans "articles unread" %}
+ {% elseif view == 'fav' %}
+ {{ nb_results }} {% trans "articles favourited" %}
+ {% elseif view == 'archive' %}
+ {{ nb_results }} {% trans "articles marked as read" %}
+ {% elseif view == 'tag' %}
+ {{ nb_results }} {% trans "articles with this tag" %}
+ {% elseif searchterm is defined %}{{ nb_results }}
+ {% trans %}articles found for « {{ searchterm }} »{% endtrans %}
+ {% else %}
+ {{ nb_results }} {% trans "articles" %}
+ {% endif %}
+ {% if view == 'home' or view == 'fav' or view == 'archive' %}
+ {% trans "random" %}{% endif %}
+
{{ page_links | raw }}
{% elseif nb_results == 1 %}
- {% if searchterm is defined %}
-
{% trans "Only one result found for " %} « {{ searchterm }} »
+
+ {% if view == 'home' %}{% trans "Only one article unread. Way to go !" %}
+ {% elseif view == 'fav' %}{% trans "Just one article favourited" %}
+ {% elseif view == 'archive' %}{% trans "One article marked as read" %}
+ {% elseif view == 'tag' %}{% trans "One article with this tag" %}
+ {% elseif searchterm is defined %}{% trans %}Only one result found for « {{ searchterm }} »{% endtrans %}
+ {% else %}{% trans "One article found" %}{% endif %}
- {% endif %}
{% endif %}
{% endblock %}
{% for entry in entries %}