summaryrefslogtreecommitdiff
path: root/searx/templates/oscar/preferences.html
blob: 1a5219b07c8d03d12f89884bb2cf9f5bf0d99595 (plain)
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
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
{% from 'oscar/macros.html' import preferences_item_header, preferences_item_header_rtl, preferences_item_footer, preferences_item_footer_rtl, checkbox_toggle, support_toggle, custom_select_class %}
{% extends "oscar/base.html" %}
{%- macro engine_about(search_engine, id) -%}
{% if search_engine.about is defined or stats[search_engine.name]['result_count'] > 0 %}
{% set about = search_engine.about %}
<div class="engine-tooltip" role="tooltip" id="{{ id }}">{{- "" -}}
    <p class="description"></p>
    {% if search_engine.about is defined %}
        <h5><a href="{{about.website}}" rel="noreferrer">{{about.website}}</a></h5>
        {%- if about.wikidata_id -%}<p><a href="https://www.wikidata.org/wiki/{{about.wikidata_id}}" rel="noreferrer">wikidata.org/wiki/{{about.wikidata_id}}</a></p>{%- endif -%}
    {% endif %}
    {%- if search_engine.enable_http %}<p>{{ icon('exclamation-sign', 'No HTTPS') }}{{ _('No HTTPS')}}</p>{% endif -%}
    {%- if stats[search_engine.name]['result_count'] -%}
        <p>{{ _('Number of results') }}: {{ stats[search_engine.name]['result_count'] }} ( {{ _('Avg.') }} )</p>{{- "" -}}
    {%- endif -%}
    {%- if reliabilities.get(search_engine.name, {}).errors or reliabilities.get(search_engine.name, {}).checker -%}
        <a href="{{ url_for('stats', engine=search_engine.name|e) }}" title="{{ _('View error logs and submit a bug report') }}">
          {{ _('View error logs and submit a bug report') }}
        </a>
    {%- endif -%}
</div>
{%- endif -%}
{%- endmacro %}

{%- macro engine_time(engine_name, css_align_class) -%}
<td class="{{ label }}">{{- "" -}}
    {%- if stats[engine_name].time != None -%}
    <span class="stacked-bar-chart-value">{{- stats[engine_name].time -}}</span>{{- "" -}}
    <span class="stacked-bar-chart" aria-labelledby="{{engine_name}}_chart" aria-hidden="true">
        {%- if max_rate95 is not none and max_rate95 > 0 -%}
        <div class="stacked-bar-chart-median bar{{ (100 * (stats[engine_name].time / max_rate95))|round }}"></div>{{- "" -}}
        <div class="stacked-bar-chart-rate80 bar{{ (100 * ((stats[engine_name].rate80 - stats[engine_name].time) / max_rate95))|round }}"></div>{{- "" -}}
        <div class="stacked-bar-chart-rate95 bar{{ (100 * ((stats[engine_name].rate95 - stats[engine_name].rate80) / max_rate95))|round }}"></div>{{- "" -}}
        <span class="stacked-bar-chart-rate100"></span>
        {%- endif -%}
    </span>{{- "" -}}
    <div class="engine-tooltip text-left" role="tooltip" id="{{engine_name}}_graph">{{- "" -}}
        <p>{{ _('Median') }}: {{ stats[engine_name].time }}</p>{{- "" -}}
        <p>{{ _('P80') }}: {{ stats[engine_name].rate80 }}</p>{{- "" -}}
        <p>{{ _('P95') }}: {{ stats[engine_name].rate95 }}</p>{{- "" -}}
    </div>
    {%- endif -%}
</td>
{%- endmacro -%}

{%- macro engine_reliability(engine_name, css_align_class) -%}
{% set r = reliabilities.get(engine_name, {}).get('reliablity', None) %}
{% set checker_result = reliabilities.get(engine_name, {}).get('checker', []) %}
{% set errors = reliabilities.get(engine_name, {}).get('errors', []) %}
{% if r != None %}
    {% if r <= 50 %}{% set label = 'danger' %}
    {% elif r < 80 %}{% set label = 'warning' %}
    {% elif r < 90 %}{% set label = 'default' %}
    {% else %}{% set label = 'success' %}
    {% endif %}
{% else %}
    {% set r = '' %}
{% endif %}
{% if checker_result or errors %}
<td class="{{ css_align_class }} {{ label }}">{{- "" -}}
    <a href="{{ url_for('stats', engine=engine_name|e) }}">{{- "" -}}
        <span aria-labelledby="{{engine_name}}_reliability">
            {{ icon('exclamation-sign', 'The engine is not reliabled') }} {{ r -}}
        </span>{{- "" -}}
    </a>{{- "" -}}
    <div class="engine-tooltip text-left" role="tooltip" id="{{engine_name}}_reliability">
        {%- if checker_result -%}
        <p>{{ _("Failed checker test(s): ") }} {{ ', '.join(checker_result) }}</p>
        {%- endif -%}
        {%- for error in errors -%}
        <p>{{ error }} </p>{{- "" -}}
        {%- endfor -%}
    </div>{{- "" -}}
</td>
{%- else -%}
<td class="{{ css_align_class }} {{ label }}"><span>{{ r }}</span></td>
{%- endif -%}
{%- endmacro -%}

{%- macro plugin_of_category(plugin_category) -%}
{%- for plugin in plugins -%}
    {%- if plugin.preference_section == plugin_category -%}
        {{- preferences_item_header(_(plugin.description), _(plugin.name), rtl, 'plugin_' + plugin.id) -}}
            {{- checkbox_toggle('plugin_' + plugin.id, plugin.id not in allowed_plugins) -}}
        {{- preferences_item_footer(_(plugin.description), _(plugin.name), rtl) -}}
    {%- endif -%}
{%- endfor -%}
{% endmacro %}

{%- block title %}{{ _('preferences') }} - {% endblock -%}

{% block content %}

<div>

    <h1>{{ _('Preferences') }}</h1>
    <form method="post" action="{{ url_for('preferences') }}" id="search_form" autocomplete="off">

        <!-- Nav tabs -->
        <ul class="nav nav-tabs nav-justified hide_if_nojs" role="tablist">
          <li class="active"><a href="#tab_general" role="tab" data-toggle="tab">{{ _('General') }}</a></li>
          <li><a href="#tab_ui" role="tab" data-toggle="tab">{{ _('User Interface') }}</a></li>
          <li><a href="#tab_privacy" role="tab" data-toggle="tab">{{ _('Privacy') }}</a></li>
          <li><a href="#tab_engine" role="tab" data-toggle="tab">{{ _('Engines') }}</a></li>
          <li><a href="#tab_query" role="tab" data-toggle="tab">{{ _('Special Queries') }}</a></li>
          <li><a href="#tab_cookies" role="tab" data-toggle="tab">{{ _('Cookies') }}</a></li>
        </ul>

        <!-- Tab panes -->
        <noscript>
            <h3>{{ _('General') }}</h3>
        </noscript>
        <div class="tab-content">
            <div class="tab-pane active" id="tab_general">
                <fieldset>
                <div class="container-fluid">
                    {% if 'categories' not in locked_preferences %}
                    <div class="row form-group">
                        {% if rtl %}
                        <div class="col-sm-11 col-md-10">
                            {% include 'oscar/categories.html' %}
                        </div>
                        <label class="col-sm-3 col-md-2" for="categories">{{ _('Default categories') }}</label>
                        {% else %}
                        <label class="col-sm-3 col-md-2" for="categories">{{ _('Default categories') }}</label>
                        <div class="col-sm-11 col-md-10 search-categories">
                            {% include 'oscar/categories.html' %}
                        </div>
                        {% endif %}
                    </div>
                    {% endif %}
                    {% if 'language' not in locked_preferences %}
                    {% set language_label = _('Search language') %}
                    {% set language_info = _('What language do you prefer for search?') %}
                    {{ preferences_item_header(language_info, language_label, rtl, 'language') }}
                                                {% include 'oscar/languages.html' %}
                    {{ preferences_item_footer(language_info, language_label, rtl) }}
                    {% endif %}

                    {% if 'safesearch' not in locked_preferences %}
                    {% set safesearch_label = _('SafeSearch') %}
                    {% set safesearch_info = _('Filter content') %}
                    {{ preferences_item_header(safesearch_info, safesearch_label, rtl, 'safesearch') }}
                        <select class="form-control {{ custom_select_class(rtl) }}" name="safesearch" id="safesearch">
                            <option value="2" {% if safesearch == '2' %}selected="selected"{% endif %}>{{ _('Strict') }}</option>
                            <option value="1" {% if safesearch == '1' %}selected="selected"{% endif %}>{{ _('Moderate') }}</option>
                            <option value="0" {% if safesearch == '0' %}selected="selected"{% endif %}>{{ _('None') }}</option>
                        </select>
                    {{ preferences_item_footer(safesearch_info, safesearch_label, rtl) }}
                    {% endif %}

                    {% if 'autocomplete' not in locked_preferences %}
                    {% set autocomplete_label = _('Autocomplete') %}
                    {% set autocomplete_info = _('Find stuff as you type') %}
                    {{ preferences_item_header(autocomplete_info, autocomplete_label, rtl, 'autocomplete') }}
                        <select class="form-control {{ custom_select_class(rtl) }}" name="autocomplete" id="autocomplete">
                            <option value=""> - </option>
                            {% for backend in autocomplete_backends %}
                            <option value="{{ backend }}" {% if backend == autocomplete %}selected="selected"{% endif %}>{{ backend }}</option>
                            {% endfor %}
                        </select>
                    {{ preferences_item_footer(autocomplete_info, autocomplete_label, rtl) }}
                    {% endif %}

                    {{ plugin_of_category('general' )}}

                    {% if 'doi_resolver' not in locked_preferences %}
                    {% set label = _('Open Access DOI resolver') %}
                    {% set info = _('Redirect to open-access versions of publications when available (plugin required)') %}
                    {{ preferences_item_header(info, label, rtl, 'doi_resolver') }}
                        <select class="form-control {{ custom_select_class(rtl) }}" name="doi_resolver" id="doi_resolver">
                            {% for doi_resolver_name,doi_resolver_url in doi_resolvers.items() %}
                            <option value="{{ doi_resolver_name }}" {% if doi_resolver_url == current_doi_resolver %}selected="selected"{% endif %}>
                                    {{ doi_resolver_name }} - {{ doi_resolver_url }}
                            </option>
                             {% endfor %}
                         </select>
                    {{ preferences_item_footer(info, label, rtl) }}
                    {% endif %}

                    {{ plugin_of_category('onion' )}}

                    {% set label = _('Engine tokens') %}
                    {% set info = _('Access tokens for private engines') %}
                    {{ preferences_item_header(info, label, rtl, 'tokens') }}
                        <input class="form-control" id="tokens" name="tokens" value='{{ preferences.tokens.get_value() }}' autocomplete="off" spellcheck="false" autocorrect="off" />
                    {{ preferences_item_footer(info, label, rtl) }}
                </div>
                </fieldset>
            </div>
            <div class="tab-pane active_if_nojs" id="tab_ui">
                <noscript>
                    <h3>{{ _('User Interface') }}</h3>
                </noscript>
                <fieldset>
                    <div class="container-fluid">
                        {% if 'locale' not in locked_preferences %}
                        {% set locale_label = _('Interface language') %}
                        {% set locale_info = _('Change the language of the layout') %}
                        {{ preferences_item_header(locale_info, locale_label, rtl, 'locale') }}
                            <select class="form-control {{ custom_select_class(rtl)}}" name="locale" id="locale">
                                {% for locale_id,locale_name in locales.items() | sort %}
                                <option value="{{ locale_id }}" {% if locale_id == current_locale %}selected="selected"{% endif %}>{{ locale_name }}</option>
                                {% endfor %}
                            </select>
                        {{ preferences_item_footer(locale_info, locale_label, rtl) }}
                        {% endif %}

                        {% if 'theme' not in locked_preferences %}
                        {% set theme_label = _('Theme') %}
                        {% set theme_info = _('Change SearXNG layout') %}
                        {{ preferences_item_header(theme_info, theme_label, rtl, 'theme') }}
                            <select class="form-control {{ custom_select_class(rtl) }}" name="theme" id="theme">
                                {% for name in themes %}
                                <option value="{{ name }}" {% if name == theme %}selected="selected"{% endif %}>{{ name }}</option>
                                {% endfor %}
                            </select>
                        {{ preferences_item_footer(theme_info, theme_label, rtl) }}
                        {% endif %}

                        {% if 'oscar-style' not in locked_preferences %}
                        {{ preferences_item_header(_('Choose style for this theme'), _('Style'), rtl, 'oscar_style') }}
                            <select class="form-control {{ custom_select_class(rtl) }}" name="oscar-style" id="oscar_style">
                                <option value="logicodev" >Logicodev</option>
                                <option value="pointhi" {% if preferences.get_value('oscar-style') == 'pointhi' %}selected="selected"{% endif %}>Pointhi</option>
                                <option value="logicodev-dark" {% if preferences.get_value('oscar-style') == 'logicodev-dark' %}selected="selected"{% endif %}>Logicodev dark</option>
                            </select>
                        {{ preferences_item_footer(_('Choose style for this theme'), _('Style'), rtl) }}
                        {% endif %}

                        {% set label = _('Show advanced settings') %}
                        {% set info = _('Show advanced settings panel in the home page by default') %}
                        {{ preferences_item_header(info, label, rtl, 'advanced_search') }}
                            <select class="form-control {{ custom_select_class(rtl) }}" name="advanced_search" id="advanced_search">
                                <option value="1" {% if preferences.get_value('advanced_search')%}selected="selected"{% endif %}>{{ _('On') }}</option>
                                <option value="0" {% if not preferences.get_value('advanced_search')%}selected="selected"{% endif %}>{{ _('Off')}}</option>
                            </select>
                        {{ preferences_item_footer(info, label, rtl) }}

                        {% if 'results_on_new_tab' not in locked_preferences %}
                        {% set label = _('Results on new tabs') %}
                        {% set info = _('Open result links on new browser tabs') %}
                        {{ preferences_item_header(info, label, rtl, 'results_on_new_tab') }}
                            <select class="form-control {{ custom_select_class(rtl) }}" name="results_on_new_tab" id="results_on_new_tab">
                                <option value="1" {% if results_on_new_tab %}selected="selected"{% endif %}>{{ _('On') }}</option>
                                <option value="0" {% if not results_on_new_tab %}selected="selected"{% endif %}>{{ _('Off')}}</option>
                            </select>
                        {{ preferences_item_footer(info, label, rtl) }}
                        {% endif %}

                        {% if 'infinite_scroll' not in locked_preferences %}
                        {% set label = _('Infinite scroll') %}
                        {% set info = _('Automatically load next page when scrolling to bottom of current page') %}
                        {{ preferences_item_header(info, label, rtl, 'infinite_scroll') }}
                            <select class="form-control {{ custom_select_class(rtl) }}" name="infinite_scroll" id="infinite_scroll">
                                <option value="1" {% if infinite_scroll %}selected="selected"{% endif %}>{{ _('On') }}</option>
                                <option value="0" {% if not infinite_scroll %}selected="selected"{% endif %}>{{ _('Off')}}</option>
                            </select>
                        {{ preferences_item_footer(info, label, rtl) }}
                        {% endif %}

                        {{ plugin_of_category('ui' )}}
                    </div>
                </fieldset>
            </div>
            <div class="tab-pane active_if_nojs" id="tab_privacy">
                <noscript>
                    <h3>{{ _('Privacy') }}</h3>
                </noscript>
                <fieldset>
                    <div class="container-fluid">
                        {% if 'method' not in locked_preferences %}
                        {% set method_label = _('HTTP Method') %}
                        {% set method_info = _('Change how forms are submited, <a href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods" rel="external">learn more about request methods</a>') %}
                        {{ preferences_item_header(method_info, method_label, rtl, 'method') }}
                            <select class="form-control {{ custom_select_class(rtl) }}" name="method" id="method">
                                <option value="POST" {% if method == 'POST' %}selected="selected"{% endif %}>POST</option>
                                <option value="GET" {% if method == 'GET' %}selected="selected"{% endif %}>GET</option>
                            </select>
                        {{ preferences_item_footer(method_info, method_label, rtl) }}
                        {% endif %}

                        {% if 'image_proxy' not in locked_preferences %}
                        {% set image_proxy_label = _('Image proxy') %}
                        {% set image_proxy_info = _('Proxying image results through SearXNG') %}
                        {{ preferences_item_header(image_proxy_info, image_proxy_label, rtl, 'image_proxy') }}
                            <select class="form-control {{ custom_select_class(rtl) }}" name="image_proxy" id="image_proxy">
                                <option value="1" {% if image_proxy  %}selected="selected"{% endif %}>{{ _('Enabled') }}</option>
                                <option value="" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled')}}</option>
                            </select>
                        {{ preferences_item_footer(image_proxy_info, image_proxy_label, rtl) }}
                        {% endif %}

                        {% if 'query_in_title' not in locked_preferences %}
                        {% set query_in_title_label = _("Query in the page's title") %}
                        {% set query_in_title_info = _("When enabled, the result page's title contains your query. Your browser can record this title") %}
                        {{ preferences_item_header(query_in_title_info, query_in_title_label, rtl, 'query_in_title') }}
                            <select class="form-control {{ custom_select_class(rtl) }}" name="query_in_title" id="query_in_title">
                                <option value="1" {% if query_in_title  %}selected="selected"{% endif %}>{{ _('Enabled') }}</option>
                                <option value="" {% if not query_in_title %}selected="selected"{% endif %}>{{ _('Disabled')}}</option>
                            </select>
                        {{ preferences_item_footer(query_in_title_info, query_in_title_label, rtl) }}
                        {% endif %}

                        {{ plugin_of_category('privacy' )}}
                    </div>
                </fieldset>
            </div>
            <div class="tab-pane active_if_nojs" id="tab_engine">
                <!-- Nav tabs -->
                <ul class="nav nav-tabs nav-justified hide_if_nojs" role="tablist">
                    {% for categ in categories_as_tabs + [OTHER_CATEGORY] %}
                    <li{% if loop.first %} class="active"{% endif %}><a href="#tab_engine_{{ categ|replace(' ', '_') }}" role="tab" data-toggle="tab">{{ _(categ) }}</a></li>
                    {% endfor %}
                </ul>

                <noscript>
                    <h3>{{ _('Engines') }}</h3>
                </noscript>

                <!-- Tab panes -->
                <div class="tab-content">

                    <div class="hide_if_nojs">
                        <p class="text-{% if rtl %}left{% else %}right{% endif %}">
                            <button type="button" class="btn btn-default btn-success" id="allow-all-engines">{{ _("Allow all") }}</button>
                            <button type="button" class="btn btn-default btn-danger" id="disable-all-engines">{{ _("Disable all") }}</button>
                        </p>
                    </div>

                    {% for categ in categories_as_tabs + [OTHER_CATEGORY] %}
                    <noscript><label>{{ _(categ) }}</label>
                    </noscript>
                    <div class="tab-pane{% if loop.first %} active{% endif %} active_if_nojs" id="tab_engine_{{ categ|replace(' ', '_') }}">
                        {% if categ == OTHER_CATEGORY %}
                            <p>{{_('This tab does not show up for search results, but you can search the engines listed here via bangs.')}}</p>
                        {% endif %}
                        <div class="container-fluid">
                        <fieldset>
                          <div class="table-responsive">
                          <table class="table table-hover table-condensed table-striped">
                                <tr>
                                    {% if not rtl %}
                                    <th scope="col">{{ _("Allow") }}</th>
                                    <th scope="col">{{ _("Engine name") }}</th>
                                    <th scope="col">{{ _("Shortcut") }}</th>
                                    <th scope="col" class="col-stat">{{ _("Selected language") }}</th>
                                    <th scope="col" class="col-stat">{{ _("SafeSearch") }}</th>
                                    <th scope="col" class="col-stat">{{ _("Time range") }}</th>
                                    <th scope="col">{{ _("Response time") }}</th>
                                    <th scope="col" class="col-stat text-right">{{ _("Max time") }}</th>
                                    <th scope="col" class="col-stat text-right">{{ _("Reliability") }}</th>
                                    {% else %}
                                    <th scope="col" class="col-stat">{{ _("Reliability") }}</th>
                                    <th scope="col" class="col-stat">{{ _("Max time") }}</th>
                                    <th scope="col" class="text-right">{{ _("Response time") }}</th>
                                    <th scope="col" class="text-right">{{ _("Time range") }}</th>
                                    <th scope="col" class="text-right">{{ _("SafeSearch") }}</th>
                                    <th scope="col" class="text-right">{{ _("Selected language") }}</th>
                                    <th scope="col" class="text-right">{{ _("Shortcut") }}</th>
                                    <th scope="col" class="text-right">{{ _("Engine name") }}</th>
                                    <th scope="col" class="text-right">{{ _("Allow") }}</th>
                                    {% endif %}
                                </tr>
                        {% for group, engines in engines_by_category[categ] | group_engines_in_tab %}
                        {% if loop.length > 1 %}
                        <tr><th colspan="9">{{_(group)}}</th></tr>
                        {% endif %}
                        {% for search_engine in engines %}
                            {% if not search_engine.private %}
                                <tr>
                                    {% if not rtl %}
                                        <td class="onoff-checkbox">
                                        {{- checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) -}}
                                        </td>
                                        <th scope="row" data-engine-name="{{ search_engine.name }}"><span aria-labelledby="{{ 'tooltip_' + categ + '_' + search_engine.name }}">
                                            {%- if search_engine.enable_http %}{{ icon('exclamation-sign', 'No HTTPS') }}{% endif -%}
                                            {{- search_engine.name -}}
                                            {%- if search_engine.about and search_engine.about.language %}
                                                ({{search_engine.about.language | upper}})
                                            {%- endif %}
                                            </span>
                                            {{- engine_about(search_engine, 'tooltip_' + categ + '_' + search_engine.name) -}}
                                        </th>
                                        <td class="name">{{ shortcuts[search_engine.name] }}</td>
                                        <td>{{ support_toggle(supports[search_engine.name]['supports_selected_language']) }}</td>
                                        <td>{{ support_toggle(supports[search_engine.name]['safesearch']) }}</td>
                                        <td>{{ support_toggle(supports[search_engine.name]['time_range_support']) }}</td>
                                        {{ engine_time(search_engine.name, 'text-right') }}
                                        <td class="text-right {{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}">{% if stats[search_engine.name]['warn_timeout'] %}{{ icon('exclamation-sign') }} {% endif %}{{ search_engine.timeout }}</td>
                                        {{ engine_reliability(search_engine.name, 'text-right ') }}
                                    {% else %}
                                        {{ engine_reliability(search_engine.name, 'text-left') }}
                                        <td class="text-left {{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}">{{ search_engine.timeout }}{% if stats[search_engine.name]['warn_time'] %} {{ icon('exclamation-sign')}}{% endif %}</td>
                                        {{ engine_time(search_engine.name, 'text-left') }}
                                        <td>{{ support_toggle(supports[search_engine.name]['time_range_support']) }}</td>
                                        <td>{{ support_toggle(supports[search_engine.name]['safesearch']) }}</td>
                                        <td>{{ support_toggle(supports[search_engine.name]['supports_selected_language']) }}</td>
                                        <td>{{ shortcuts[search_engine.name] }}</td>
                                        <th scope="row" data-engine-name="{{ search_engine.name }}"><span>{% if search_engine.enable_http %}{{ icon('exclamation-sign', 'No HTTPS') }}{% endif %}{{ search_engine.name }}</span>{{ engine_about(search_engine) }}</th>
                                        <td class="onoff-checkbox">
                                        {{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }}
                                        </td>
                                    {% endif %}
                                </tr>
                            {% endif %}
                        {% endfor %}
                        {% endfor %}
                          </table>
                          </div>
                        </fieldset>
                        </div>
                    </div>
                    {% endfor %}
                </div>
            </div>
            <div class="tab-pane active_if_nojs" id="tab_query">
                <noscript>
                    <h3>{{ _('Query') }}</h3>
                </noscript>
                {% if answerers %}
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th{% if rtl %} class="text-right"{% endif %}>{{ _('Allow') }}</th>
                            <th{% if rtl %} class="text-right"{% endif %}>{{ _('Keywords') }}</th>
                            <th{% if rtl %} class="text-right"{% endif %}>{{ _('Name') }}</th>
                            <th{% if rtl %} class="text-right"{% endif %}>{{ _('Description') }}</th>
                            <th{% if rtl %} class="text-right"{% endif %}>{{ _('Examples') }}</th>
                        </tr>
                    </thead>
                    <tbody>
                        <td></td>
                        <th scope="colgroup" colspan="4">{{ _("This is the list of SearXNG's instant answering modules.") }}</th>
                        {% for answerer in answerers %}
                        <tr>
                            <td></td>
                            <td>{{ answerer.keywords|join(', ') }}</td>
                            <td>{{ answerer.info.name }}</td>
                            <td>{{ answerer.info.description }}</td>
                            <td>{{ answerer.info.examples|join(', ') }}</td>
                        </tr>
                        {% endfor %}
                    </tbody>
                    <tbody>
                        <td></td>
                        <th scope="colgroup" colspan="4">{{ _('This is the list of plugins.') }}</th>
                        {%- for plugin in plugins -%}
                        {%- if plugin.preference_section == 'query' -%}
                        <tr>
                            <td>{{- checkbox_toggle('plugin_' + plugin.id, plugin.id not in allowed_plugins) -}}</td>
                            <td>{{ plugin.query_keywords|join(', ') }}</td>
                            <td>{{ _(plugin.name) }}</td>
                            <td>{{ _(plugin.description) }}</td>
                            <td>{{ plugin.query_examples }}</td>
                        </tr>
                        {%- endif -%}
                        {%- endfor -%}
                    </tbody>
                </table>
                {% endif %}
            </div>
            <div class="tab-pane active_if_nojs" id="tab_cookies">
                <noscript>
                    <h3>{{ _('Cookies') }}</h3>
                </noscript>
                <p class="text-muted">
                    {{ _('This is the list of cookies and their values SearXNG is storing on your computer.') }}<br />
                    {{ _('With that list, you can assess SearXNG transparency.') }}<br />
                </p>
                {% if cookies %}
                <table class="table table-striped">
                    <tr>
                        <th class="text-muted{% if rtl %} text-right{% endif %}">{{ _('Cookie name') }}</th>
                        <th class="text-muted{% if rtl %} text-right{% endif %}">{{ _('Value') }}</th>
                    </tr>

                    {% for cookie in cookies %}
                    <tr>
                        <td class="text-muted">{{ cookie }}</td>
                        <td class="text-muted">{{ cookies[cookie] }}</td>
                    </tr>
                    {% endfor %}
                </table>
                {% else %}
                    {% include 'oscar/messages/no_cookies.html' %}
                {% endif %}
            </div>
        </div>

        <p class="text-muted">
          {{ _('These settings are stored in your cookies, this allows us not to store this data about you.') }}
          {{ _("These cookies serve your sole convenience, we don't use these cookies to track you.") }}
        </p>

        <p>
          {{ _('Search URL of the currently saved preferences') }}
          <small class="text-muted">({{ _('Note: specifying custom settings in the search URL can reduce privacy by leaking data to the clicked result sites.') }})</small>:
        </p>

        <div class="tab-pane">
          <input readonly="" class="form-control select-all-on-click cursor-text" type="url" value="{{ url_for('index', _external=True) }}?preferences={{ preferences_url_params|e }}{% raw %}&amp;q=%s{% endraw %}">
          <input type="submit" class="btn btn-primary" value="{{ _('save') }}" />
        <a href="{{ url_for('index') }}"><div class="btn btn-default">{{ _('back') }}</div></a>
        <a href="{{ url_for('clear_cookies') }}"><div class="btn btn-default">{{ _('Reset defaults') }}</div></a>
        </div>
    </form>
</div>
{% endblock %}