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