]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entries.html.twig
Use only one method to randomize
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Resources / views / themes / baggy / Entry / entries.html.twig
CommitLineData
ad4d1caa 1{% extends "WallabagCoreBundle::layout.html.twig" %}
9d50517c 2
bd40f1af
TC
3{% block head %}
4 {{ parent() }}
5 {% if tag is defined and app.user.config.rssToken %}
6 <link rel="alternate" type="application/rss+xml" href="{{ path('tag_rss', {'username': app.user.username, 'token': app.user.config.rssToken, 'slug': tag.slug}) }}" />
7 {% endif %}
8{% endblock %}
9
371bcca0 10{% block title %}
398de405 11 {% set filter = '' %}
7a5043f1 12 {% if tag is defined %}
398de405 13 {% set filter = tag %}
7a5043f1 14 {% endif %}
398de405
NL
15 {% if searchTerm is defined and searchTerm is not empty %}
16 {% set filter = searchTerm %}
17 {% endif %}
18 {% include "@WallabagCore/themes/common/Entry/_title.html.twig" with {'filter': filter} %}
371bcca0 19{% endblock %}
9d50517c 20
9d50517c 21{% block content %}
bd40f1af 22 {% set currentRoute = app.request.attributes.get('_route') %}
09ef25c3
NL
23 {% if currentRoute == 'homepage' %}
24 {% set currentRoute = 'unread' %}
25 {% endif %}
9aa99128 26 {% set listMode = app.user.config.listMode %}
817724a7
JB
27 <div class="results">
28 <div class="nb-results">{{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}</div>
29 <div class="pagination">
64f81bc3 30 <a href="{{ path('switch_view_mode') }}"><i class="listMode-btn material-icons md-24">{% if listMode == 0 %}list{% else %}view_module{% endif %}</i></a>
0447a75b 31 <a href="{{ path('random_entry', { 'type': currentRoute }) }}">random</a>
bd40f1af
TC
32 {% if app.user.config.rssToken %}
33 {% include "@WallabagCore/themes/common/Entry/_rss_link.html.twig" %}
34 {% endif %}
64f81bc3
TC
35 <i class="btn-clickable download-btn material-icons md-24 js-export-action">file_download</i>
36 <i class="btn-clickable filter-btn material-icons md-24 js-filters-action">filter_list</i>
817724a7
JB
37 {% if entries.getNbPages > 1 %}
38 {{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }}
39 {% endif %}
40 </div>
41 </div>
9d50517c 42
0d42217e 43 {% for entry in entries %}
9aa99128 44 <div id="entry-{{ entry.id|e }}" class="{% if listMode == 0 %}entry{% else %}listmode entry{% endif %}">
4d9128de 45 <h2><a href="{{ path('view', { 'id': entry.id }) }}" title="{{ entry.title|e|raw }}">{{ entry.title | striptags | truncate(80, true, '…') | default('entry.default_title'|trans) | raw }}</a></h2>
4a749cad
NL
46
47 {% set readingTime = entry.readingTime / app.user.config.readingSpeed %}
48 <div class="estimatedTime">
0d42217e 49 <span class="tool reading-time">
4a749cad
NL
50 {% if readingTime > 0 %}
51 {{ 'entry.list.reading_time_minutes'|trans({'%readingTime%': readingTime|round}) }}
0d42217e 52 {% else %}
4a749cad 53 {{ 'entry.list.reading_time_less_one_minute'|trans|raw }}
0d42217e 54 {% endif %}
4a749cad 55 </span>
1c282b1d
NL
56 <span class="tool created-at">
57 <i class="tool icon icon-calendar" title="{{ 'entry.view.created_at'|trans }}">
58 {{ entry.createdAt|date('Y-m-d') }}
59 </i>
60 </span>
4a749cad 61 </div>
0d42217e
JB
62
63 <ul class="tools links">
a22b8043 64 <li><a href="{{ entry.url|e }}" target="_blank" rel="noopener" title="{{ 'entry.list.original_article'|trans }} : {{ entry.title|e }}"><span>{{ entry.domainName|removeWww }}</span></a></li>
64f81bc3
TC
65 <li><a title="{{ 'entry.list.toogle_as_read'|trans }}" class="tool icon {% if entry.isArchived == 0 %}archive-off{% else %}archive{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"><i class="material-icons md-24 vertical-align-middle">check</i><span>{{ 'entry.list.toogle_as_read'|trans }}</span></a></li>
66 <li><a title="{{ 'entry.list.toogle_as_star'|trans }}" class="tool icon {% if entry.isStarred == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><i class="material-icons md-24 vertical-align-middle">star_rate</i><span>{{ 'entry.list.toogle_as_star'|trans }}</span></a></li>
fa0f5ee1 67 <li><a title="{{ 'entry.list.delete'|trans }}" class="tool icon" onclick="return confirm('{{ 'entry.confirm.delete'|trans|escape('js') }}')" href="{{ path('delete_entry', { 'id': entry.id }) }}"><i class="material-icons md-24 vertical-align-middle">delete</i><span>{{ 'entry.list.delete'|trans }}</span></a></li>
0d42217e 68 </ul>
9aa99128 69 {% if (entry.previewPicture is null or listMode == 1) %}
1d4d9aaf
TC
70 <ul class="card-entry-tags">
71 {% for tag in entry.tags %}
645c0d5b 72 <li><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a></li>
1d4d9aaf
TC
73 {% endfor %}
74 </ul>
9aa99128 75 <p {% if listMode == 1 %}class="hide"{% endif %}>{{ entry.content|striptags|slice(0, 300) }}&hellip;</p>
0d42217e 76 {% else %}
1d4d9aaf
TC
77 <ul class="card-entry-labels">
78 {% for tag in entry.tags | slice(0, 3) %}
645c0d5b 79 <li><a href="{{ path('tag_entries', {'slug': tag.slug}) }}">{{ tag.label }}</a></li>
1d4d9aaf
TC
80 {% endfor %}
81 </ul>
3d995079 82 <img class="preview" src="{{ entry.previewPicture }}" alt="{{ entry.title|e|raw }}" />
0d42217e
JB
83 {% endif %}
84 </div>
85 {% endfor %}
5def3f58 86
817724a7
JB
87 {% if entries.getNbPages > 1 %}
88 {{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }}
89 {% endif %}
90
5ecdfcd0
TC
91 <!-- Export -->
92 <aside id="download-form">
bde23a44 93 {% set currentTag = null %}
920d8859
NL
94 {% if tag is defined %}
95 {% set currentTag = tag %}
5ecdfcd0
TC
96 {% endif %}
97 <h2>{{ 'entry.list.export_title'|trans }}</h2>
98 <a href="javascript: void(null);" id="download-form-close" class="close-button--popup close-button">&times;</a>
99 <ul>
920d8859
NL
100 {% if craue_setting('export_epub') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'epub', 'tag' : currentTag }) }}">EPUB</a></li>{% endif %}
101 {% if craue_setting('export_mobi') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'mobi', 'tag' : currentTag }) }}">MOBI</a></li>{% endif %}
102 {% if craue_setting('export_pdf') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'pdf', 'tag' : currentTag }) }}">PDF</a></li>{% endif %}
bb8ad42b
EC
103 {% if craue_setting('export_json') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'json', 'tag' : currentTag }) }}">JSON</a></li>{% endif %}
104 {% if craue_setting('export_csv') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'csv', 'tag' : currentTag }) }}">CSV</a></li>{% endif %}
920d8859
NL
105 {% if craue_setting('export_txt') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'txt', 'tag' : currentTag }) }}">TXT</a></li>{% endif %}
106 {% if craue_setting('export_xml') %}<li class="bold"><a class="waves-effect" href="{{ path('export_entries', { 'category': currentRoute, 'format': 'xml', 'tag' : currentTag }) }}">XML</a></li>{% endif %}
5ecdfcd0
TC
107 </ul>
108 </aside>
371bcca0 109
5ecdfcd0 110 <!-- Filter -->
371bcca0 111 {% if form is not null %}
817724a7 112 <div id="filters">
5def3f58 113 <form method="get" action="{{ path('all') }}">
0d42217e 114 <h2>{{ 'entry.filters.title'|trans }}</h2>
5def3f58
JB
115 <a href="javascript: void(null);" id="filter-form-close" class="close-button--popup close-button">&times;</a>
116
117 <div id="filter-status" class="filter-group">
118 <div class="">
0d42217e 119 <label>{{ 'entry.filters.status_label'|trans }}</label>
5def3f58
JB
120 </div>
121 <div class="input-field">
122 {{ form_widget(form.isArchived) }}
0d42217e 123 {{ form_label(form.isArchived) }}
5def3f58
JB
124 </div>
125
126 <div class="input-field">
127 {{ form_widget(form.isStarred) }}
0d42217e 128 {{ form_label(form.isStarred) }}
5def3f58 129 </div>
5e98404d 130
5ecdfcd0
TC
131 <div class="input-field">
132 {{ form_widget(form.isUnread) }}
133 {{ form_label(form.isUnread) }}
134 </div>
135
5e98404d
JB
136 <div class="input-field">
137 {{ form_widget(form.previewPicture) }}
0d42217e 138 {{ form_label(form.previewPicture) }}
5e98404d 139 </div>
e8911f7c
JB
140
141 <div class="input-field">
142 {{ form_widget(form.isPublic) }}
143 {{ form_label(form.isPublic) }}
144 </div>
5def3f58 145 </div>
d4ebe5c5
JB
146
147 <div id="filter-language" class="filter-group">
0d42217e 148 {{ form_label(form.language) }}
d4ebe5c5
JB
149 <div class="input-field ">
150 {{ form_widget(form.language) }}
151 </div>
152 </div>
153
10b35097
NL
154 <div id="filter-http-status" class="filter-group">
155 {{ form_label(form.httpStatus) }}
156 <div class="input-field ">
157 {{ form_widget(form.httpStatus) }}
158 </div>
159 </div>
160
5def3f58
JB
161 <div id="filter-reading-time" class="filter-group">
162 <div class="">
0d42217e 163 {{ form_label(form.readingTime) }}
5def3f58
JB
164 </div>
165 <div class="input-field ">
0d42217e 166 <label for="entry_filter_readingTime_left_number">{{ 'entry.filters.reading_time.from'|trans }}</label>
5e98404d 167 {{ form_widget(form.readingTime.left_number, {'type': 'number'}) }}
5def3f58
JB
168 </div>
169 <div class="input-field ">
0d42217e 170 <label for="entry_filter_readingTime_right_number">{{ 'entry.filters.reading_time.to'|trans }}</label>
5def3f58
JB
171 {{ form_widget(form.readingTime.right_number, {'type': 'number'}) }}
172 </div>
173 </div>
174
175 <div id="filter-domain-name" class="filter-group">
0d42217e 176 {{ form_label(form.domainName) }}
5def3f58
JB
177 <div class="input-field ">
178 {{ form_widget(form.domainName, {'type': 'text', 'attr' : {'placeholder': 'website.com'} }) }}
179 </div>
180 </div>
181
182 <div id="filter-creation-date" class="filter-group">
183 <div class="">
0d42217e 184 {{ form_label(form.createdAt) }}
5def3f58
JB
185 </div>
186 <div class="input-field ">
0d42217e 187 <label for="entry_filter_createdAt_left_date" class="active">{{ 'entry.filters.created_at.from'|trans }}</label>
5def3f58
JB
188 {{ form_widget(form.createdAt.left_date, {'type': 'date', 'attr': {'class': 'datepicker', 'data-value': form.createdAt.left_date.vars.value} }) }}
189 </div>
190 <div class="input-field ">
0d42217e 191 <label for="entry_filter_createdAt_right_date" class="active">{{ 'entry.filters.created_at.to'|trans }}</label>
5def3f58
JB
192 {{ form_widget(form.createdAt.right_date, {'type': 'date', 'attr': {'class': 'datepicker', 'data-value': form.createdAt.right_date.vars.value} }) }}
193 </div>
194 </div>
5def3f58 195
0d42217e 196 <div id="filter-buttons" class="filter-group">
5def3f58 197 <div class="">
0d42217e 198 <a href="#!" class="center waves-effect waves-green btn-flat" id="clear_form_filters">{{ 'entry.filters.action.clear'|trans }}</a>
5def3f58
JB
199 </div>
200
0d42217e
JB
201 <button class="btn waves-effect waves-light" type="submit" id="submit-filter" value="filter">{{ 'entry.filters.action.filter'|trans }}</button>
202 </div>
5def3f58 203 </form>
c146f694 204 </div>
371bcca0 205 {% endif %}
9d50517c 206{% endblock %}