]> git.immae.eu Git - github/wallabag/wallabag.git/blob - themes/default/home.twig
fix little problems and bring previous features to all themes
[github/wallabag/wallabag.git] / themes / default / home.twig
1 {% extends "layout.twig" %}
2 {% block title %}
3 {% if view == 'fav' %}
4 {% trans "favoris" %}
5 {% elseif view == 'archive' %}
6 {% trans "archive" %}
7 {% else %}
8 {% trans "unread" %}
9 {% endif %}
10 {% endblock %}
11 {% block menu %}
12 {% include '_menu.twig' %}
13 {% endblock %}
14 {% block precontent %}
15
16 {% include '_sorting.twig' %}
17 {% endblock %}
18 {% block content %}
19
20 {% if includeImport %}
21 {% include '_import.twig' %}
22 {% endif %}
23
24 {% if tag %}
25 <h3>{% trans "Tag" %}: <b>{{ tag.value }}</b></h3>
26 {% endif %}
27
28 {% if entries is empty%}
29 {% if view == 'home' %}<div class="messages success"><p>{% trans "No articles unread. Good job !" %}
30 {% elseif view == 'fav' %}<div class="messages warning"><p>{% trans "No articles favourited" %}
31 {% elseif view == 'archive' %}<div class="messages warning"><p>{% trans "No articles marked as read" %}
32 {% elseif view == 'tags' %}<div class="messages warning"><p>{% trans "No articles with this tag found" %}
33 {% elseif searchterm is defined %}<div class="messages warning"><p>{% trans %}No articles found for « {{ searchterm }} »{% endtrans %}
34 {% else %}<div class="messages warning"><p>{% trans "No articles found" %}{% endif %}
35 </p></div>
36 {% else %}
37 {% block pager %}
38 {% if nb_results > 1 %}
39 <div class="results">
40 <div class="nb-results">
41 {% if view == 'home' %}
42 {{ nb_results }} {% trans "articles unread" %}
43 {% elseif view == 'fav' %}
44 {{ nb_results }} {% trans "articles favourited" %}
45 {% elseif view == 'archive' %}
46 {{ nb_results }} {% trans "articles marked as read" %}
47 {% elseif view == 'tag' %}
48 {{ nb_results }} {% trans "articles with this tag" %}
49 {% elseif searchterm is defined %}{{ nb_results }}
50 {% trans %}articles found for « {{ searchterm }} »{% endtrans %}
51 {% else %}
52 {{ nb_results }} {% trans "articles" %}
53 {% endif %}
54 {% if view == 'home' or view == 'fav' or view == 'archive' %}
55 <a href="?action=random&amp;view={{ view }}" class="icon icon-random"><span> {% trans "random" %}</span></a>{% endif %}
56 </div>
57 {{ page_links | raw }}
58 </div>
59 {% elseif nb_results == 1 %}
60 <div class="results">
61 <div class="nb-results">
62 {% if view == 'home' %}{% trans "Only one article unread. Way to go !" %}
63 {% elseif view == 'fav' %}{% trans "Just one article favourited" %}
64 {% elseif view == 'archive' %}{% trans "One article marked as read" %}
65 {% elseif view == 'tag' %}{% trans "One article with this tag" %}
66 {% elseif searchterm is defined %}{% trans %}Only one result found for « {{ searchterm }} »{% endtrans %}
67 {% else %}{% trans "One article found" %}{% endif %}</div>
68 </div>
69 {% endif %}
70 {% endblock %}
71 {% for entry in entries %}
72 <div id="entry-{{ entry.id|e }}" class="entrie">
73 <h2><a href="index.php?view=view&amp;id={{ entry.id|e }}">{{ entry.title|raw }}</a></h2>
74 <ul class="tools">
75 <li><a title="{% trans "Toggle mark as read" %}" class="tool {% if entry.is_read == 0 %}archive-off{% else %}archive{% endif %}" href="./?action=toggle_archive&amp;id={{ entry.id|e }}"><span>{% trans "Toggle mark as read" %}</span></a></li>
76 <li><a title="{% trans "toggle favorite" %}" class="tool {% if entry.is_fav == 0 %}fav-off{% else %}fav{% endif %}" href="./?action=toggle_fav&amp;id={{ entry.id|e }}"><span>{% trans "toggle favorite" %}</span></a></li>
77 <li><a title="{% trans "delete" %}" class="tool delete" href="./?action=delete&amp;id={{ entry.id|e }}"><span>{% trans "delete" %}</span></a></li>
78 <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>
79 <li><a target="_blank" title="{% trans "estimated reading time:" %} {{ entry.content| getReadingTime }} min" class="reading-time"><span>{{ entry.content| getReadingTime }} min</span></a></li>
80 </ul>
81 <p>{{ entry.content|striptags|slice(0, 300) }}...</p>
82 </div>
83 {% endfor %}
84
85 {{ block('pager') }}
86 {% if view == 'home' %}{% if nb_results > 1 %}<p><a title="{% trans "Mark all the entries as read" %}" href="./?action=archive_all">{% trans "Mark all the entries as read" %}</a></p>{% endif %}{% endif %}
87 {% if searchterm is defined %}<a title="{% trans "Tag these results as" %} {{ searchterm }}" href="./?action=add_tag&search={{ searchterm }}">{% trans "Tag these results as" %} {{ searchterm }}</a>{% endif %}<br />
88
89 {% if searchterm is defined %}<a title="{% trans "Delete results matching" %} {{ searchterm }}" href="./?action=delete&search={{ searchterm }}">{% trans "Delete results matching" %} {{ searchterm }}</a>{% endif %}<br />
90
91 {% if tag %}<a title="{% trans "Mark all articles from this tag as read" %}" href="./?action=toggle_archive&amp;tag_id={{ tag.id }}">{% trans "Mark all articles from this tag as read" %}</a><br />{% endif %}
92
93 {% if tag %}
94 {% if constant('EPUB') == 1 %}<a title="{% trans "Download the articles from this tag in an epub file" %}" href="./?epub&amp;method=tag&amp;value={{ tag.value }}">{% trans "Download as ePub3" %}</a>{% endif %}
95 {% if constant('MOBI') == 1 %}<a title="{% trans "Download the articles from this tag in a mobi file" %}" href="./?mobi&amp;method=tag&amp;value={{ tag.value }}">{% trans "Download as Mobi" %}</a>{% endif %}
96 {% if constant('PDF') == 1 %}<a title="{% trans "Download the articles from this tag in a pdf file" %}" href="./?pdf&amp;method=tag&amp;value={{ tag.value }}">{% trans "Download as PDF" %}</a>{% endif %}
97 {% elseif searchterm is defined %}
98 {% if constant('EPUB') == 1 %}<a title="{% trans "Download the articles from this search in an epub" %}" href="./?epub&amp;method=search&amp;value={{ searchterm }}">{% trans "Download as ePub3" %}</a>{% endif %}
99 {% if constant('MOBI') == 1 %}<a title="{% trans "Download the articles from this search in a mobi file" %}" href="./?mobi&amp;method=search&amp;value={{ searchterm }}">{% trans "Download as Mobi" %}</a>{% endif %}
100 {% if constant('PDF') == 1 %}<a title="{% trans "Download the articles from this search in a pdf file" %}" href="./?pdf&amp;method=search&amp;value={{ searchterm }}">{% trans "Download as PDF" %}</a>{% endif %}
101 {% else %}
102 {% if constant('EPUB') == 1 %}<a title="{% trans "Download the articles from this category in an epub" %}" href="./?epub&amp;method=category&amp;value={{ view }}">{% trans "Download as ePub3" %}</a>{% endif %}
103 {% if constant('MOBI') == 1 %}<a title="{% trans "Download the articles from this category in a mobi file" %}" href="./?mobi&amp;method=category&amp;value={{ view }}">{% trans "Download as Mobi" %}</a>{% endif %}
104 {% if constant('PDF') == 1 %}<a title="{% trans "Download the articles from this category in a pdf file" %}" href="./?pdf&amp;method=category&amp;value={{ view }}">{% trans "Download as PDF" %}</a>{% endif %}
105 {% endif %}
106
107 {% endif %}
108 {% endblock %}