]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entries.html.twig
Use only one method to randomize
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Resources / views / themes / material / Entry / entries.html.twig
1 {% extends "WallabagCoreBundle::layout.html.twig" %}
2
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
10 {% block title %}
11 {% set filter = '' %}
12 {% if tag is defined %}
13 {% set filter = tag.slug %}
14 {% endif %}
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} %}
19 {% endblock %}
20
21 {% block content %}
22 {% set listMode = app.user.config.listMode %}
23 {% set currentRoute = app.request.attributes.get('_route') %}
24 {% if currentRoute == 'homepage' %}
25 {% set currentRoute = 'unread' %}
26 {% endif %}
27 <div class="results">
28 <div class="nb-results">
29 {{ 'entry.list.number_on_the_page'|transchoice(entries.count) }}
30 <a href="{{ path('switch_view_mode') }}"><i class="material-icons">{% if listMode == 0 %}view_list{% else %}view_module{% endif %}</i></a>
31 <a href="{{ path('random_entry', { 'type': currentRoute }) }}">random</a>
32 {% if app.user.config.rssToken %}
33 {% include "@WallabagCore/themes/common/Entry/_rss_link.html.twig" %}
34 {% endif %}
35 </div>
36 {% if entries.getNbPages > 1 %}
37 {{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }}
38 {% endif %}
39 </div>
40
41 <ul class="{% if listMode == 1 %}collection{% else %}row data{% endif %}">
42 {% for entry in entries %}
43 <li id="entry-{{ entry.id|e }}" class="col {% if listMode == 0 %}l3 m6{% else %}collection-item{% endif %} s12">
44 {% if listMode == 1 %}
45 {% include "@WallabagCore/themes/material/Entry/_card_list.html.twig" with {'entry': entry} only %}
46 {% elseif not entry.previewPicture is null and entry.mimetype starts with 'image/' %}
47 {% include "@WallabagCore/themes/material/Entry/_card_full_image.html.twig" with {'entry': entry} only %}
48 {% else %}
49 {% include "@WallabagCore/themes/material/Entry/_card_preview.html.twig" with {'entry': entry} only %}
50 {% endif %}
51 </li>
52 {% endfor %}
53 </ul>
54
55 {% if entries.getNbPages > 1 %}
56 <div class="results">
57 {{ pagerfanta(entries, 'twitter_bootstrap_translated', {'proximity': 1}) }}
58 </div>
59 {% endif %}
60
61 <!-- Export -->
62 <div id="export" class="side-nav right-aligned">
63 {% set currentTag = null %}
64 {% if tag is defined %}
65 {% set currentTag = tag.slug %}
66 {% endif %}
67 <h4 class="center">{{ 'entry.list.export_title'|trans }}</h4>
68 <ul>
69 {% 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 %}
70 {% 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 %}
71 {% 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 %}
72 {% 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 %}
73 {% 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 %}
74 {% 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 %}
75 {% 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 %}
76 </ul>
77 </div>
78
79 <!-- Filters -->
80 {% if form is not null %}
81 <div id="filters" class="side-nav right-aligned">
82 <form action="{{ path('all') }}">
83
84 <h4 class="center">{{ 'entry.filters.title'|trans }}</h4>
85
86 <div class="row">
87 <div class="col s12">
88 <label>{{ 'entry.filters.status_label'|trans }}</label>
89 </div>
90
91 <div class="input-field col s6 with-checkbox">
92 {{ form_widget(form.isArchived) }}
93 {{ form_label(form.isArchived) }}
94 </div>
95
96 <div class="input-field col s6 with-checkbox">
97 {{ form_widget(form.isStarred) }}
98 {{ form_label(form.isStarred) }}
99 </div>
100
101 <div class="input-field col s6 with-checkbox">
102 {{ form_widget(form.isUnread) }}
103 {{ form_label(form.isUnread) }}
104 </div>
105
106 <div class="col s12">
107 <label>{{ 'entry.filters.preview_picture_help'|trans }}</label>
108 </div>
109
110 <div class="input-field col s12 with-checkbox">
111 {{ form_widget(form.previewPicture) }}
112 {{ form_label(form.previewPicture) }}
113 </div>
114
115 <div class="col s12">
116 <label>{{ 'entry.filters.is_public_help'|trans }}</label>
117 </div>
118
119 <div class="input-field col s12 with-checkbox">
120 {{ form_widget(form.isPublic) }}
121 {{ form_label(form.isPublic) }}
122 </div>
123
124 <div class="col s12">
125 {{ form_label(form.language) }}
126 </div>
127
128 <div class="input-field col s12">
129 {{ form_widget(form.language) }}
130 </div>
131
132 <div class="col s12">
133 {{ form_label(form.httpStatus) }}
134 </div>
135
136 <div class="input-field col s12">
137 {{ form_widget(form.httpStatus) }}
138 </div>
139
140 <div class="col s12">
141 {{ form_label(form.readingTime) }}
142 </div>
143
144 <div class="input-field col s6">
145 {{ form_widget(form.readingTime.left_number, {'type': 'number'}) }}
146 <label for="entry_filter_readingTime_left_number">{{ 'entry.filters.reading_time.from'|trans }}</label>
147 </div>
148
149 <div class="input-field col s6">
150 {{ form_widget(form.readingTime.right_number, {'type': 'number'}) }}
151 <label for="entry_filter_readingTime_right_number">{{ 'entry.filters.reading_time.to'|trans }}</label>
152 </div>
153
154 <div class="input-field col s12">
155 {{ form_widget(form.domainName, {'type': 'text', 'attr' : {'placeholder': 'website.com'} }) }}
156 {{ form_label(form.domainName) }}
157 </div>
158
159 <div class="col s12">
160 {{ form_label(form.createdAt) }}
161 </div>
162
163 <div class="input-field col s6">
164 {{ form_widget(form.createdAt.left_date, {'type': 'date', 'attr': {'class': 'datepicker', 'data-value': form.createdAt.left_date.vars.value} }) }}
165 <label for="entry_filter_createdAt_left_date" class="active">{{ 'entry.filters.created_at.from'|trans }}</label>
166 </div>
167 <div class="input-field col s6">
168 {{ form_widget(form.createdAt.right_date, {'type': 'date', 'attr': {'class': 'datepicker', 'data-value': form.createdAt.right_date.vars.value} }) }}
169 <label for="entry_filter_createdAt_right_date" class="active">{{ 'entry.filters.created_at.to'|trans }}</label>
170 </div>
171
172 <div class="col s6">
173 <a href="#!" class="center waves-effect waves-green btn-flat" id="clear_form_filters">{{ 'entry.filters.action.clear'|trans }}</a>
174 </div>
175
176 <div class="col s6">
177 <button class="btn waves-effect waves-light" type="submit" id="submit-filter" value="filter">{{ 'entry.filters.action.filter'|trans }}</button>
178 </div>
179 </div>
180
181 </form>
182 </div>
183 {% endif %}
184
185 {% endblock %}