aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig
blob: 31931ca2e728efc7cd1413f6b7cdf7a8f97fca52 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
{% extends "WallabagCoreBundle::layout.html.twig" %}

{% block title %}{% trans %}config{% endtrans %}{% endblock %}

{% block content %}

    <div class="row">
        <div class="col s12">
            <div class="card-panel settings">

                <div class="row">
                    <div class="div_tabs col s12">
                        <ul class="tabs">
                            <li class="tab col s3"><a class="active" href="#set1">{% trans %}Settings{% endtrans %}</a></li>
                            <li class="tab col s3"><a href="#set2">{% trans %}RSS{% endtrans %}</a></li>
                            <li class="tab col s3"><a href="#set3">{% trans %}User information{% endtrans %}</a></li>
                            <li class="tab col s3"><a href="#set4">{% trans %}Password{% endtrans %}</a></li>
                            <li class="tab col s3"><a href="#set5">{% trans %}Tagging rules{% endtrans %}</a></li>
                            {% if is_granted('ROLE_SUPER_ADMIN') %}
                            <li class="tab col s3"><a href="#set6">{% trans %}Add a user{% endtrans %}</a></li>
                            {% endif %}
                        </ul>
                    </div>

                    <div id="set1" class="col s12">
                        {{ form_start(form.config) }}
                            {{ form_errors(form.config) }}

                            <div class="row">
                                <div class="input-field col s12">
                                    {{ form_errors(form.config.theme) }}
                                    {{ form_widget(form.config.theme) }}
                                    <label class="required">{% trans %}Theme{% endtrans %}</label>
                                </div>
                            </div>

                            <div class="row">
                                <div class="input-field col s12">
                                    {{ form_label(form.config.items_per_page) }}
                                    {{ form_errors(form.config.items_per_page) }}
                                    {{ form_widget(form.config.items_per_page) }}
                                </div>
                            </div>

                            <div class="row">
                                <div class="input-field col s12">
                                    {{ form_label(form.config.reading_speed) }}
                                    {{ form_errors(form.config.reading_speed) }}
                                    {{ form_widget(form.config.reading_speed) }}
                                </div>
                            </div>

                            <div class="row">
                                <div class="input-field col s12">
                                    {{ form_label(form.config.language) }}
                                    {{ form_errors(form.config.language) }}
                                    {{ form_widget(form.config.language) }}
                                </div>
                            </div>

                            <div class="hidden">{{ form_rest(form.config) }}</div>
                            <button class="btn waves-effect waves-light" type="submit" name="action">
                                {% trans %}Save{% endtrans %}
                            </button>
                        </form>
                    </div>

                    <div id="set2" class="col s12">
                        {{ form_start(form.rss) }}
                            {{ form_errors(form.rss) }}

                            <div class="row">
                                <div class="input-field col s12">
                                    {% trans %}RSS feeds provided by wallabag allow you to read your saved articles with your favourite RSS reader. You need to generate a token first.{% endtrans %}
                                </div>
                            </div>

                            <div class="row">
                                <div class="input-field col s12">
                                    <label>{% trans %}RSS token{% endtrans %}</label>
                                    <div>
                                        {% if rss.token %}
                                            {{ rss.token }}
                                        {% else %}
                                            <em>{% trans %}No token{% endtrans %}</em>
                                        {% endif %}<a href="{{ path('generate_token') }}">{% if rss.token %}{% trans %}Reset your token{% endtrans %}{% else %}{% trans %}Create your token{% endtrans %}{% endif %}</a>
                                    </div>
                                </div>
                            </div>
                            {% if rss.token %}
                            <div class="row">
                                <div class="input-field col s12">
                                    <label>{% trans %}RSS links{% endtrans %}</label>
                                        <ul>
                                            <li><a href="{{ path('unread_rss', {'username': rss.username, 'token': rss.token}) }}">{% trans %}unread{% endtrans %}</a></li>
                                            <li><a href="{{ path('starred_rss', {'username': rss.username, 'token': rss.token}) }}">{% trans %}starred{% endtrans %}</a></li>
                                            <li><a href="{{ path('archive_rss', {'username': rss.username, 'token': rss.token}) }}">{% trans %}archive{% endtrans %}</a></li>
                                        </ul>

                                </div>
                            </div>
                            {% endif %}

                            <div class="row">
                                <div class="input-field col s12">
                                    {{ form_label(form.rss.rss_limit) }}
                                    {{ form_errors(form.rss.rss_limit) }}
                                    {{ form_widget(form.rss.rss_limit) }}
                                </div>
                            </div>

                            <div class="hidden">{{ form_rest(form.rss) }}</div>
                            <button class="btn waves-effect waves-light" type="submit" name="action">
                                {% trans %}Save{% endtrans %}
                            </button>

                        </form>
                    </div>

                    <div id="set3" class="col s12">
                        {{ form_start(form.user) }}
                            {{ form_errors(form.user) }}

                            <div class="row">
                                <div class="input-field col s12">
                                    {{ form_label(form.user.name) }}
                                    {{ form_errors(form.user.name) }}
                                    {{ form_widget(form.user.name) }}
                                </div>
                            </div>

                            <div class="row">
                                <div class="input-field col s12">
                                    {{ form_label(form.user.email) }}
                                    {{ form_errors(form.user.email) }}
                                    {{ form_widget(form.user.email) }}
                                </div>
                            </div>

                            {% if twofactor_auth %}
                            <div class="row">
                                <div class="input-field col s12">
                                    {% trans %}Enabling two factor authentication means you'll receive an email with a code on every new untrusted connexion{% endtrans %}
                                </div>
                            </div>

                            <div class="row">
                                <div class="input-field col s12">
                                    {{ form_widget(form.user.twoFactorAuthentication) }}
                                    {{ form_label(form.user.twoFactorAuthentication) }}
                                    {{ form_errors(form.user.twoFactorAuthentication) }}
                                </div>
                            </div>
                            {% endif %}

                            <div class="hidden">{{ form_rest(form.user) }}</div>
                            <button class="btn waves-effect waves-light" type="submit" name="action">
                                {% trans %}Save{% endtrans %}
                            </button>

                        </form>
                    </div>

                    <div id="set4" class="col s12">
                        {{ form_start(form.pwd) }}
                            {{ form_errors(form.pwd) }}

                            <div class="row">
                                <div class="input-field col s12">
                                    {{ form_label(form.pwd.old_password) }}
                                    {{ form_errors(form.pwd.old_password) }}
                                    {{ form_widget(form.pwd.old_password) }}
                                </div>
                            </div>

                            <div class="row">
                                <div class="input-field col s12">
                                    {{ form_label(form.pwd.new_password.first) }}
                                    {{ form_errors(form.pwd.new_password.first) }}
                                    {{ form_widget(form.pwd.new_password.first) }}
                                </div>
                            </div>

                            <div class="row">
                                <div class="input-field col s12">
                                    {{ form_label(form.pwd.new_password.second) }}
                                    {{ form_errors(form.pwd.new_password.second) }}
                                    {{ form_widget(form.pwd.new_password.second) }}
                                </div>
                            </div>

                            <div class="hidden">{{ form_rest(form.pwd) }}</div>
                            <button class="btn waves-effect waves-light" type="submit" name="action">
                                {% trans %}Save{% endtrans %}
                            </button>

                        </form>
                    </div>

                    <div id="set5" class="col s12">
                        <div class="row">
                            <div class="input-field col s12">
                                <ul>
                                    {% for tagging_rule in app.user.config.taggingRules %}
                                    <li>
                                        if « {{ tagging_rule.rule }} » then tag as « {{ tagging_rule.tags|join(', ') }} »
                                        <a href="{{ path('delete_tagging_rule', {id: tagging_rule.id}) }}" title="{% trans %}Delete{% endtrans %}">
                                            <i class="tool grey-text delete mdi-action-delete"></i>
                                        </a>
                                    </li>
                                    {% endfor %}
                                </ul>
                            </div>
                        </div>

                        {{ form_start(form.new_tagging_rule) }}
                            {{ form_errors(form.new_tagging_rule) }}

                            <div class="row">
                                <div class="input-field col s12">
                                    {{ form_label(form.new_tagging_rule.rule) }}
                                    {{ form_errors(form.new_tagging_rule.rule) }}
                                    {{ form_widget(form.new_tagging_rule.rule) }}
                                </div>
                            </div>

                            <div class="row">
                                <div class="input-field col s12">
                                    {{ form_label(form.new_tagging_rule.tags) }}
                                    {{ form_errors(form.new_tagging_rule.tags) }}
                                    {{ form_widget(form.new_tagging_rule.tags) }}
                                </div>
                            </div>

                            <div class="hidden">{{ form_rest(form.new_tagging_rule) }}</div>
                            <button class="btn waves-effect waves-light" type="submit" name="action">
                                {% trans %}Save{% endtrans %}
                            </button>
                        </form>

                        <div class="row">
                            <div class="input-field col s12">
                                <h4>{% trans %}FAQ{% endtrans %}</h4>

                                <h5>{% trans %}What does « tagging rules » mean?{% endtrans %}</h5>
                                <p class="help">
                                    {% trans %}
                                    They are rules used by Wallabag to automatically tag new entries.<br />Each time a new entry is added, all the tagging rules will be used to add the tags you configured, thus saving you the trouble to manually classify your entries.
                                    {% endtrans %}
                                </p>

                                <h5>{% trans %}How do I use them?{% endtrans %}</h5>
                                <p class="help">
                                    {% trans %}
                                    Let assume you want to tag new entries as « <i>short reading</i> » when the reading time is inferior to 3 minutes.<br />In that case, you should put « readingTime &lt;= 3 » in the <i>Rule</i> field and « <i>short reading</i> » in the <i>Tags</i> field.<br />Several tags can added simultaneously by separating them by a comma: « <i>short reading, must read</i> »<br />Complex rules can be written by using predefined operators: if « <i>readingTime &gt;= 5 AND domainName = "github.com"</i> » then tag as « <i>long reading, github </i> »
                                    {% endtrans %}
                                </p>

                                <h5>{% trans %}Which variables and operators can I use to write rules?{% endtrans %}</h5>
                                <p class="help">
                                    {% trans %}The following variables and operators can be used to create tagging rules:{% endtrans %}

                                    <table>
                                        <thead>
                                            <tr>
                                                <th>{% trans %}Variable{% endtrans %}</th>
                                                <th>{% trans %}Meaning{% endtrans %}</th>
                                                <th>{% trans %}Operator{% endtrans %}</th>
                                                <th>{% trans %}Meaning{% endtrans %}</th>
                                            </tr>
                                        </thead>

                                        <tbody>
                                            <tr>
                                                <td>title</td>
                                                <td>{% trans %}Title of the entry{% endtrans %}</td>
                                                <td>&lt;=</td>
                                                <td>{% trans %}Less than…{% endtrans %}</td>
                                            </tr>
                                            <tr>
                                                <td>url</td>
                                                <td>{% trans %}URL of the entry{% endtrans %}</td>
                                                <td>&lt;</td>
                                                <td>{% trans %}Strictly less than…{% endtrans %}</td>
                                            </tr>
                                            <tr>
                                                <td>isArchived</td>
                                                <td>{% trans %}Whether the entry is archived or not{% endtrans %}</td>
                                                <td>=&gt;</td>
                                                <td>{% trans %}Greater than…{% endtrans %}</td>
                                            </tr>
                                            <tr>
                                                <td>isStarred</td>
                                                <td>{% trans %}Whether the entry is starred or not{% endtrans %}</td>
                                                <td>&gt;</td>
                                                <td>{% trans %}Strictly greater than…{% endtrans %}</td>
                                            </tr>
                                            <tr>
                                                <td>content</td>
                                                <td>{% trans %}The entry's content{% endtrans %}</td>
                                                <td>=</td>
                                                <td>{% trans %}Equal to…{% endtrans %}</td>
                                            </tr>
                                            <tr>
                                                <td>language</td>
                                                <td>{% trans %}The entry's language{% endtrans %}</td>
                                                <td>!=</td>
                                                <td>{% trans %}Not equal to…{% endtrans %}</td>
                                            </tr>
                                            <tr>
                                                <td>mimetype</td>
                                                <td>{% trans %}The entry's mime-type{% endtrans %}</td>
                                                <td>OR</td>
                                                <td>{% trans %}One rule or another{% endtrans %}</td>
                                            </tr>
                                            <tr>
                                                <td>readingTime</td>
                                                <td>{% trans %}The estimated entry's reading time, in minutes{% endtrans %}</td>
                                                <td>AND</td>
                                                <td>{% trans %}One rule and another{% endtrans %}</td>
                                            </tr>
                                            <tr>
                                                <td>domainName</td>
                                                <td>{% trans %}The domain name of the entry{% endtrans %}</td>
                                                <td>matches</td>
                                                <td>
                                                    {% trans %}
                                                    Tests that a <i>subject</i> is matches a <i>search</i> (case-insensitive).<br />Example: <code>title matches "football"</code>
                                                    {% endtrans %}
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </p>
                            </div>
                        </div>
                    </div>

                    {% if is_granted('ROLE_SUPER_ADMIN') %}
                    <div id="set6" class="col s12">
                        {{ form_start(form.new_user) }}
                            {{ form_errors(form.new_user) }}

                            <div class="row">
                                <div class="input-field col s12">
                                    {{ form_label(form.new_user.username) }}
                                    {{ form_errors(form.new_user.username) }}
                                    {{ form_widget(form.new_user.username) }}
                                </div>
                            </div>

                            <div class="row">
                                <div class="input-field col s12">
                                    {{ form_label(form.new_user.plainPassword.first) }}
                                    {{ form_errors(form.new_user.plainPassword.first) }}
                                    {{ form_widget(form.new_user.plainPassword.first) }}
                                </div>
                            </div>

                            <div class="row">
                                <div class="input-field col s12">
                                    {{ form_label(form.new_user.plainPassword.second) }}
                                    {{ form_errors(form.new_user.plainPassword.second) }}
                                    {{ form_widget(form.new_user.plainPassword.second) }}
                                </div>
                            </div>

                            <div class="row">
                                <div class="input-field col s12">
                                    {{ form_label(form.new_user.email) }}
                                    {{ form_errors(form.new_user.email) }}
                                    {{ form_widget(form.new_user.email) }}
                                </div>
                            </div>

                            <div class="hidden">{{ form_rest(form.new_user) }}</div>
                            <button class="btn waves-effect waves-light" type="submit" name="action">
                                {% trans %}Add a user{% endtrans %}
                            </button>

                        </form>
                    </div>
                    {% endif %}
                </div>

            </div>
        </div>
    </div>
{% endblock %}