]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
Merge pull request #1918 from wallabag/improve-pagination
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Resources / views / themes / material / Entry / entries.html.twig
1 {% extends "WallabagCoreBundle::layout.html.twig" %}
2
3 {% block title %}
4 {% set currentRoute = app.request.attributes.get('_route') %}
5
6 {% if currentRoute == 'starred' %}
7 {{ 'entry.page_titles.starred'|trans }}
8 {% elseif currentRoute == 'archive' %}
9 {{ 'entry.page_titles.archived'|trans }}
10 {% elseif currentRoute == 'all' %}
11 {{ 'entry.page_titles.filtered'|trans }}
12 {% else %}
13 {{ 'entry.page_titles.unread'|trans }}
14 {% endif %}
15
16 {% endblock %}
17
18 {% block content %}
19 {% block pager %}
20 <div class="results clearfix">
21 <div class="nb-results left">
22 {{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}
23 </div>
24 {{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }}
25 </div>
26 {% endblock %}
27 <br />
28 <ul class="row data">
29 {% for entry in entries %}
30 <li id="entry-{{ entry.id|e }}" class="col l4 m6 s12">
31 <div class="card">
32
33 <div class="card-body">
34 {% if not entry.previewPicture is null %}
35 <div class="card-image waves-effect waves-block waves-light">
36 <div class="preview activator" style="background-image: url({{ entry.previewPicture }})"></div>
37 </div>
38 {% endif %}
39
40 <div class="card-content">
41 {% if not entry.previewPicture is null %}
42 <i class="card-title grey-text text-darken-4 activator mdi-navigation-more-vert right"></i>
43 {% endif %}
44
45 <span class="card-title"><a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title|raw }}">{{ entry.title|striptags|slice(0, 42)|raw }}</a></span>
46
47 <div class="estimatedTime grey-text">
48 <span class="tool reading-time">
49 {% set readingTime = entry.readingTime / app.user.config.readingSpeed %}
50 {% if readingTime > 0 %}
51 {{ 'entry.list.reading_time_minutes'|trans({'%readingTime%': readingTime|round}) }}
52 {% else %}
53 {{ 'entry.list.reading_time_less_one_minute'|trans|raw }}
54 {% endif %}
55 </span>
56 </div>
57
58 {% if entry.previewPicture is null %}
59 <p>{{ entry.content|striptags|slice(0, 300)|raw }}&hellip;</p>
60 {% endif %}
61 </div>
62 </div>
63
64 {% if not entry.previewPicture is null %}
65 <div class="card-reveal">
66 <i class="card-title grey-text text-darken-4 mdi-card-close right"></i>
67 <span class="card-title"><a href="{{ path('view', { 'id': entry.id }) }}">{{ entry.title|raw }}</a></span>
68
69 <div class="estimatedTime grey-text">
70 <span class="tool reading-time">
71 {% if readingTime > 0 %}{{ 'entry.list.reading_time_minutes'|trans({'%readingTime%': readingTime|round}) }}{% else %}{{ 'entry.list.reading_time_less_one_minute'|trans|raw }}{% endif %}
72 </span>
73 </div>
74
75 <p>{{ entry.content|striptags|slice(0, 300)|raw }}&hellip;</p>
76 </div>
77 {% endif %}
78
79 <div class="card-action">
80 <span class="bold">
81 <a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.list.original_article'|trans }}: {{ entry.title|e }} - {{ entry.domainName|removeWww }}" class="tool original grey-text"><span>{{ entry.domainName|removeWww|truncate(18) }}</span></a>
82 </bold>
83
84 <ul class="tools links right">
85 <li>
86 <a title="{{ 'entry.list.toogle_as_read'|trans }}" class="tool grey-text {% if entry.isArchived == 0 %}mdi-action-done{% else %}mdi-content-redo{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"></a>
87 <a title="{{ 'entry.list.toogle_as_star'|trans }}" class="tool grey-text {% if entry.isStarred == 0 %}mdi-action-favorite-outline{% else %}mdi-action-favorite{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"></a>
88 <a title="{{ 'entry.list.delete'|trans }}" class="tool grey-text delete mdi-action-delete " href="{{ path('delete_entry', { 'id': entry.id }) }}"></a>
89 </li>
90 </ul>
91 </div>
92 </div>
93 </li>
94 {% endfor %}
95 </ul>
96
97 <!-- Export -->
98 <div id="export" class="side-nav fixed right-aligned">
99 {% set currentRoute = app.request.attributes.get('_route') %}
100 {% if currentRoute == 'homepage' %}
101 {% set currentRoute = 'unread' %}
102 {% endif %}
103 <h4 class="center">{{ 'entry.list.export_title'|trans }}</h4>
104 <ul>
105 {% if craue_setting('export_epub') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'epub' }) }}">EPUB</a></li>{% endif %}
106 {% if craue_setting('export_mobi') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'mobi' }) }}">MOBI</a></li>{% endif %}
107 {% if craue_setting('export_pdf') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'pdf' }) }}">PDF</a></li>{% endif %}
108 {% if craue_setting('export_csv') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'json' }) }}">JSON</a></li>{% endif %}
109 {% if craue_setting('export_json') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'csv' }) }}">CSV</a></li>{% endif %}
110 {% if craue_setting('export_txt') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'txt' }) }}">TXT</a></li>{% endif %}
111 {% if craue_setting('export_xml') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'xml' }) }}">XML</a></li>{% endif %}
112 </ul>
113 </div>
114
115 <!-- Filters -->
116 <div id="filters" class="side-nav fixed right-aligned">
117 <form action="{{ path('all') }}">
118
119 <h4 class="center">{{ 'entry.filters.title'|trans }}</h4>
120
121 <div class="row">
122 <div class="col s12">
123 <label>{{ 'entry.filters.status_label'|trans }}</label>
124 </div>
125
126 <div class="input-field col s6 with-checkbox">
127 {{ form_widget(form.isArchived) }}
128 {{ form_label(form.isArchived) }}
129 </div>
130
131 <div class="input-field col s6 with-checkbox">
132 {{ form_widget(form.isStarred) }}
133 {{ form_label(form.isStarred) }}
134 </div>
135
136 <div class="col s12">
137 <label>{{ 'entry.filters.preview_picture_help'|trans }}</label>
138 </div>
139
140 <div class="input-field col s12 with-checkbox">
141 {{ form_widget(form.previewPicture) }}
142 {{ form_label(form.previewPicture) }}
143 </div>
144
145 <div class="col s12">
146 {{ form_label(form.language) }}
147 </div>
148
149 <div class="input-field col s12">
150 {{ form_widget(form.language) }}
151 </div>
152
153 <div class="col s12">
154 {{ form_label(form.readingTime) }}
155 </div>
156 <div class="input-field col s6">
157 {{ form_widget(form.readingTime.left_number, {'type': 'number'}) }}
158 <label for="entry_filter_readingTime_left_number">{{ 'entry.filters.reading_time.from'|trans }}</label>
159 </div>
160 <div class="input-field col s6">
161 {{ form_widget(form.readingTime.right_number, {'type': 'number'}) }}
162 <label for="entry_filter_readingTime_right_number">{{ 'entry.filters.reading_time.to'|trans }}</label>
163 </div>
164
165 <div class="input-field col s12">
166 {{ form_widget(form.domainName, {'type': 'text', 'attr' : {'placeholder': 'website.com'} }) }}
167 {{ form_label(form.domainName) }}
168 </div>
169
170 <div class="col s12">
171 {{ form_label(form.createdAt) }}
172 </div>
173
174 <div class="input-field col s6">
175 {{ form_widget(form.createdAt.left_date, {'type': 'date', 'attr': {'class': 'datepicker', 'data-value': form.createdAt.left_date.vars.value} }) }}
176 <label for="entry_filter_createdAt_left_date" class="active">{{ 'entry.filters.created_at.from'|trans }}</label>
177 </div>
178 <div class="input-field col s6">
179 {{ form_widget(form.createdAt.right_date, {'type': 'date', 'attr': {'class': 'datepicker', 'data-value': form.createdAt.right_date.vars.value} }) }}
180 <label for="entry_filter_createdAt_right_date" class="active">{{ 'entry.filters.created_at.to'|trans }}</label>
181 </div>
182
183 <div class="col s6">
184 <a href="#!" class="center waves-effect waves-green btn-flat" id="clear_form_filters">{{ 'entry.filters.action.clear'|trans }}</a>
185 </div>
186
187 <div class="col s6">
188 <button class="btn waves-effect waves-light" type="submit" id="submit-filter" value="filter">{{ 'entry.filters.action.filter'|trans }}</button>
189 </div>
190 </div>
191
192 </form>
193 </div>
194 {% endblock %}