]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Better names for epub files and epub in all themes now 691/head
authortcit <tcit@tcit.fr>
Thu, 15 May 2014 13:42:36 +0000 (15:42 +0200)
committertcit <tcit@tcit.fr>
Thu, 15 May 2014 13:42:36 +0000 (15:42 +0200)
inc/poche/Poche.class.php
themes/baggy/config.twig
themes/courgette/_view.twig
themes/courgette/config.twig
themes/courgette/home.twig
themes/default/config.twig
themes/default/home.twig
themes/default/view.twig

index 99d2989b0865f36fa45c5c84732d6a4b76a6c0ae..bce7d65158a04708734968c82f7eefab5c4623ed 100755 (executable)
@@ -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</pre>" . $bookEnd); 
         }
         $book->finalize();
-        $zipData = $book->sendBook(_('wallabag\'s articles'));
+        $zipData = $book->sendBook($bookFileName);
     }
 }
index 1b8b864839d50c519cce70ed6d9c2984b58a1902..46735f0744d1e45816df071a4e5a92b9588eb739 100755 (executable)
             <p><a href="?download" target="_blank">{% trans "Click here" %}</a> {% trans "to download your database." %}</p>{% endif %}
             <p><a href="?export" target="_blank">{% trans "Click here" %}</a> {% trans "to export your wallabag data." %}</p>
             
-            <h2>Fancy a ebook ?</h2>
-            Click on <a href="./?epub&amp;method=all" title="Generate ePub">this link</a> to get all your articles in one ebook (ePub).
+            <h2>{% trans "Fancy an E-Book ?" %}</h2>
+            <p>{% trans "Click on <a href=\"./?epub&amp;method=all\" title=\"Generate ePub\">this link</a> to get all your articles in one ebook (ePub 3 format)." %}
+            <br>{% trans "This can <b>take a while</b> and can <b>even fail</b> if you have too many articles, depending on your server configuration." %}</p>
 
             <h2>{% trans "Cache" %}</h2>
             <p><a href="?empty-cache">{% trans "Click here" %}</a> {% trans "to delete cache." %}</p>
index 9f9ea4f609c14ecad66acd53f2e83ad6a9a909a8..25479a3d79d8830350ab3823685bdb1766a39253 100755 (executable)
@@ -12,6 +12,7 @@
                 {% if constant('SHARE_MAIL') == 1 %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email" title="{% trans "email" %}"><span>{% trans "email" %}</span></a></li>{% endif %}
                 {% if constant('SHARE_SHAARLI') == 1 %}<li><a href="{{ constant('SHAARLI_URL') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans "shaarli" %}"><span>{% trans "shaarli" %}</span></a></li>{% endif %}
                 {% if constant('FLATTR') == 1 %}{% if flattr.status == constant('FLATTRABLE') %}<li class="flattrli"><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr" target="_blank" title="{% trans "flattr" %}"><span>{% trans "flattr" %}</span></a></li>{% elseif flattr.status == constant('FLATTRED') %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr" target="_blank" title="{% trans "flattr" %}"><span>{% trans "flattr" %}</span>{{ flattr.numflattrs }}</a></li>{% endif %}{% endif %}
+                <li><a href="./?epub&amp;method=id&amp;id={{ entry.id|e }}" title="Generate epub file">EPUB</a></li>
                 <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&amp;body={{ entry.url|url_encode }}" title="{% trans "this article appears wrong?" %}" class="tool bad-display"><span>{% trans "this article appears wrong?" %}</span></a></li>
             </ul>
         </div>
index a022d733ff7c25c89b313ea9f1a69cc9683c126f..9ab58461abe2dadd38722e7fe782e1904376f8ad 100755 (executable)
@@ -81,6 +81,9 @@
             <h2>{% trans "Export your wallabag data" %}</h2>
             <p><a href="./?export" target="_blank">{% trans "Click here" %}</a> {% trans "to export your wallabag data." %}</p>
             
+            <h2>{% trans "Fancy an E-Book ?" %}</h2>
+            <p>{% trans "Click on <a href=\"./?epub&amp;method=all\" title=\"Generate ePub\">this link</a> to get all your articles in one ebook (ePub 3 format)." %}
+            <br>{% trans "This can <b>take a while</b> and can <b>even fail</b> if you have too many articles, depending on your server configuration." %}</p>
             
             <h2>{% trans 'Add user' %}</h2>
             <p>{% trans 'Add a new user :' %}</p>
index 6ba72d353576175a2b781b21c8f284b23a44a2bd..401f3f20d96fc6a074c5e31689c813efdda97ba7 100755 (executable)
                 <p>{{ entry.content|striptags|slice(0, 300) }}...</p>
             </div>
                 {% endfor %}
-            {% endif %}
+            
             {{ block('pager') }}
+            
+            {% if tag %}<a title="{% trans "Download the articles from this tag in an epub" %}" href="./?epub&amp;method=tag&amp;tag={{ tag.value }}">{% trans "Download the articles from this tag in an epub" %}</a>
+            {% elseif search_term is defined %}<a title="{% trans "Download the articles from this search in an epub" %}" href="./?epub&amp;method=search&amp;search={{ search_term }}">{% trans "Download the articles from this search in an epub" %}</a>
+            {% else %}<a title="{% trans "Download the articles from this category in an epub" %}" href="./?epub&amp;method=category&amp;category={{ view }}">{% trans "Download the articles from this category in an epub" %}</a>{% endif %}
+            
+            {% endif %}
+
 {% endblock %}
\ No newline at end of file
index 5ed9d80f8d9b157cc1443463b25978334ed157f1..160f6046a46426f5590603bfd2ddb0d5de1f42d3 100755 (executable)
             <h2>{% trans "Cache" %}</h2>
             <p><a href="?empty-cache">{% trans "Click here" %}</a> {% trans "to delete cache." %}</p>
             
+            <h2>{% trans "Fancy an E-Book ?" %}</h2>
+            <p>{% trans "Click on <a href=\"./?epub&amp;method=all\" title=\"Generate ePub\">this link</a> to get all your articles in one ebook (ePub 3 format)." %}
+            <br>{% trans "This can <b>take a while</b> and can <b>even fail</b> if you have too many articles, depending on your server configuration." %}</p>
+            
             <h2>{% trans 'Add user' %}</h2>
             <p>{% trans 'Add a new user :' %}</p>
             <form method="post" action="?newuser">
index d6cb98e8f165fffa59a4cd6ccc6f56e610a47061..e6c781f58e53331c56826517f6cc4c689521d201 100755 (executable)
                 <p>{{ entry.content|striptags|slice(0, 300) }}...</p>
             </div>
                 {% endfor %}
-            {% endif %}
+
             {{ block('pager') }}
+            
             {% if view == 'home' %}{% if nb_results > 1 %}<a title="{% trans "mark all the entries as read" %}"  href="./?action=archive_all">{% trans "mark all the entries as read" %}</a>{% endif %}{% endif %}
+            
+            {% if tag %}<a title="{% trans "Download the articles from this tag in an epub" %}" href="./?epub&amp;method=tag&amp;tag={{ tag.value }}">{% trans "Download the articles from this tag in an epub" %}</a>
+            {% elseif search_term is defined %}<a title="{% trans "Download the articles from this search in an epub" %}" href="./?epub&amp;method=search&amp;search={{ search_term }}">{% trans "Download the articles from this search in an epub" %}</a>
+            {% else %}<a title="{% trans "Download the articles from this category in an epub" %}" href="./?epub&amp;method=category&amp;category={{ view }}">{% trans "Download the articles from this category in an epub" %}</a>{% endif %}
+            
+            {% endif %}
 {% endblock %}
index 983cc1cd3ee45ae485fc9edd63f07d52a49ef0f0..b7d48c00211f153af002668b29379f7a25d50227 100755 (executable)
@@ -15,6 +15,7 @@
                 {% if constant('SHARE_SHAARLI') == 1 %}<li><a href="{{ constant('SHAARLI_URL') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans "shaarli" %}"><span>{% trans "shaarli" %}</span></a></li>{% endif %}
                 {% 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>{% trans "flattr" %}</span></a></li>{% elseif flattr.status == constant('FLATTRED') %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr" target="_blank" title="{% trans "flattr" %}"><span>{% trans "flattr" %}</span>{{ flattr.numflattrs }}</a></li>{% endif %}{% endif %}
                 {% if constant('SHOW_PRINTLINK') == 1 %}<li><a title="{% trans "Print" %}" class="tool print" href="javascript: window.print();"><span>{% trans "Print" %}</span></a></li>{% endif %}
+                <li><a href="./?epub&amp;method=id&amp;id={{ entry.id|e }}" title="Generate epub file">EPUB</a></li>
                 <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&amp;body={{ entry.url|url_encode }}" title="{% trans "Does this article appear wrong?" %}" class="tool bad-display"><span>{% trans "Does this article appear wrong?" %}</span></a></li>
                 {% if constant('SHOW_READPERCENT') == 1 %}<li><div id="readLeftPercent">0%</div></li>{% endif %}
             </ul>