From f3f0b11393dd7f11bc1e63df9488c3930c0bc06f Mon Sep 17 00:00:00 2001 From: tcit Date: Thu, 15 May 2014 15:42:36 +0200 Subject: Better names for epub files and epub in all themes now --- inc/poche/Poche.class.php | 15 ++++++++++----- themes/baggy/config.twig | 5 +++-- themes/courgette/_view.twig | 1 + themes/courgette/config.twig | 3 +++ themes/courgette/home.twig | 9 ++++++++- themes/default/config.twig | 4 ++++ themes/default/home.twig | 9 ++++++++- themes/default/view.twig | 1 + 8 files changed, 38 insertions(+), 9 deletions(-) diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 99d2989b..bce7d651 100755 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -1143,27 +1143,32 @@ class Poche $entry = $this->store->retrieveOneById($entryID, $this->user->getId()); $entries = array($entry); $bookTitle = $entry['title']; + $bookFileName = substr($bookTitle, 0, 200); break; case 'all': $entries = $this->store->retrieveAll($this->user->getId()); - $bookTitle = _('All my articles'); + $bookTitle = sprintf(_('All my articles on '), date(_('d.m.y'))); #translatable because each country has it's own date format system + $bookFileName = _('Allarticles') . date(_('dmY')); break; case 'tag': $tag = filter_var($_GET['tag'],FILTER_SANITIZE_STRING); $tags_id = $this->store->retrieveAllTags($this->user->getId(),$tag); $tag_id = $tags_id[0]["id"]; // we take the first result, which is supposed to match perfectly. There must be a workaround. $entries = $this->store->retrieveEntriesByTag($tag_id,$this->user->getId()); - $bookTitle = sprintf(_('Articles related to %s'),$tag); + $bookTitle = sprintf(_('Articles tagged %s'),$tag); + $bookFileName = substr(sprintf(_('Tag %s'),$tag), 0, 200); break; case 'category': $category = filter_var($_GET['category'],FILTER_SANITIZE_STRING); $entries = $this->store->getEntriesByView($category,$this->user->getId()); - $bookTitle = sprintf(_('All my articles in category %s'), $category); + $bookTitle = sprintf(_('All articles in category %s'), $category); + $bookFileName = substr(sprintf(_('Category %s'),$category), 0, 200); break; case 'search': $search = filter_var($_GET['search'],FILTER_SANITIZE_STRING); $entries = $this->store->search($search,$this->user->getId()); - $bookTitle = sprintf(_('All my articles for search %s'), $search); + $bookTitle = sprintf(_('All articles for search %s'), $search); + $bookFileName = substr(sprintf(_('Search %s'), $search), 0, 200); break; case 'default': die(_('Uh, there is a problem while generating epub.')); @@ -1241,6 +1246,6 @@ class Poche //$book->addChapter("ePubLog", "ePubLog.html", $content_start . $epuplog . "\n" . $bookEnd); } $book->finalize(); - $zipData = $book->sendBook(_('wallabag\'s articles')); + $zipData = $book->sendBook($bookFileName); } } diff --git a/themes/baggy/config.twig b/themes/baggy/config.twig index 1b8b8648..46735f07 100755 --- a/themes/baggy/config.twig +++ b/themes/baggy/config.twig @@ -125,8 +125,9 @@

{% trans "Click here" %} {% trans "to download your database." %}

{% endif %}

{% trans "Click here" %} {% trans "to export your wallabag data." %}

-

Fancy a ebook ?

- Click on this link to get all your articles in one ebook (ePub). +

{% trans "Fancy an E-Book ?" %}

+

{% trans "Click on this link to get all your articles in one ebook (ePub 3 format)." %} +
{% trans "This can take a while and can even fail if you have too many articles, depending on your server configuration." %}

{% trans "Cache" %}

{% trans "Click here" %} {% trans "to delete cache." %}

diff --git a/themes/courgette/_view.twig b/themes/courgette/_view.twig index 9f9ea4f6..25479a3d 100755 --- a/themes/courgette/_view.twig +++ b/themes/courgette/_view.twig @@ -12,6 +12,7 @@ {% if constant('SHARE_MAIL') == 1 %}
  • {% endif %} {% if constant('SHARE_SHAARLI') == 1 %}
  • {% trans "shaarli" %}
  • {% endif %} {% if constant('FLATTR') == 1 %}{% if flattr.status == constant('FLATTRABLE') %}
  • {% trans "flattr" %}
  • {% elseif flattr.status == constant('FLATTRED') %}
  • {% trans "flattr" %}{{ flattr.numflattrs }}
  • {% endif %}{% endif %} +
  • EPUB
  • {% trans "this article appears wrong?" %}
  • diff --git a/themes/courgette/config.twig b/themes/courgette/config.twig index a022d733..9ab58461 100755 --- a/themes/courgette/config.twig +++ b/themes/courgette/config.twig @@ -81,6 +81,9 @@

    {% trans "Export your wallabag data" %}

    {% trans "Click here" %} {% trans "to export your wallabag data." %}

    +

    {% trans "Fancy an E-Book ?" %}

    +

    {% trans "Click on this link to get all your articles in one ebook (ePub 3 format)." %} +
    {% trans "This can take a while and can even fail if you have too many articles, depending on your server configuration." %}

    {% trans 'Add user' %}

    {% trans 'Add a new user :' %}

    diff --git a/themes/courgette/home.twig b/themes/courgette/home.twig index 6ba72d35..401f3f20 100755 --- a/themes/courgette/home.twig +++ b/themes/courgette/home.twig @@ -50,6 +50,13 @@

    {{ entry.content|striptags|slice(0, 300) }}...

    {% endfor %} - {% endif %} + {{ block('pager') }} + + {% if tag %}{% trans "Download the articles from this tag in an epub" %} + {% elseif search_term is defined %}{% trans "Download the articles from this search in an epub" %} + {% else %}{% trans "Download the articles from this category in an epub" %}{% endif %} + + {% endif %} + {% endblock %} \ No newline at end of file diff --git a/themes/default/config.twig b/themes/default/config.twig index 5ed9d80f..160f6046 100755 --- a/themes/default/config.twig +++ b/themes/default/config.twig @@ -127,6 +127,10 @@

    {% trans "Cache" %}

    {% trans "Click here" %} {% trans "to delete cache." %}

    +

    {% trans "Fancy an E-Book ?" %}

    +

    {% trans "Click on this link to get all your articles in one ebook (ePub 3 format)." %} +
    {% trans "This can take a while and can even fail if you have too many articles, depending on your server configuration." %}

    +

    {% trans 'Add user' %}

    {% trans 'Add a new user :' %}

    diff --git a/themes/default/home.twig b/themes/default/home.twig index d6cb98e8..e6c781f5 100755 --- a/themes/default/home.twig +++ b/themes/default/home.twig @@ -55,7 +55,14 @@

    {{ entry.content|striptags|slice(0, 300) }}...

    {% endfor %} - {% endif %} + {{ block('pager') }} + {% if view == 'home' %}{% if nb_results > 1 %}{% trans "mark all the entries as read" %}{% endif %}{% endif %} + + {% if tag %}{% trans "Download the articles from this tag in an epub" %} + {% elseif search_term is defined %}{% trans "Download the articles from this search in an epub" %} + {% else %}{% trans "Download the articles from this category in an epub" %}{% endif %} + + {% endif %} {% endblock %} diff --git a/themes/default/view.twig b/themes/default/view.twig index 983cc1cd..b7d48c00 100755 --- a/themes/default/view.twig +++ b/themes/default/view.twig @@ -15,6 +15,7 @@ {% if constant('SHARE_SHAARLI') == 1 %}
  • {% trans "shaarli" %}
  • {% endif %} {% if constant('FLATTR') == 1 %}{% if flattr.status == constant('FLATTRABLE') %}
  • {% trans "flattr" %}
  • {% elseif flattr.status == constant('FLATTRED') %}
  • {% trans "flattr" %}{{ flattr.numflattrs }}
  • {% endif %}{% endif %} {% if constant('SHOW_PRINTLINK') == 1 %}
  • {% trans "Print" %}
  • {% endif %} +
  • EPUB
  • {% trans "Does this article appear wrong?" %}
  • {% if constant('SHOW_READPERCENT') == 1 %}
  • 0%
  • {% endif %} -- cgit v1.2.3