preferences.html 9.46 KB
Newer Older
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
{% from 'simple/macros.html' import tabs_open, tabs_close, tab_header, tab_footer, checkbox_onoff, checkbox %}

{% extends "simple/base.html" %}

{%- macro plugin_preferences(section) -%}
{%- for plugin in plugins -%}
{%- if plugin.preference_section == section -%}
<fieldset>{{- '' -}}
    <legend>{{ _(plugin.name) }}</legend>{{- '' -}}
    <div class="value">
      {{- checkbox_onoff('plugin_' + plugin.id, plugin.id not in allowed_plugins) -}}
    </div>{{- '' -}}
    <div class="description">
      {{- _(plugin.description) -}}
    </div>{{- '' -}}
</fieldset>
{%- endif -%}
{%- endfor -%}
{%- endmacro -%}

{% block head %} {% endblock %}
{% block content %}

<a href="{{ url_for('index') }}"><h1><span>searx</span></h1></a>

<h2>{{ _('Preferences') }}</h2>

<form id="search_form" method="post" action="{{ url_for('preferences') }}">

{{ tabs_open() }}

{{ tab_header('maintab', 'general', _('General')) }}
  <fieldset>
    <legend>{{ _('Default categories') }}</legend>
    {% set display_tooltip = false %}
    {% include 'simple/categories.html' %}
  </fieldset>
  <fieldset>
    <legend>{{ _('Search language') }}</legend>
    <p class="value">{{- '' -}}
      <select name='language'>{{- '' -}}
        <option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Default language') }}</option>
        {%- for lang_id,lang_name,country_name,english_name in language_codes | sort(attribute=1) -%}
        <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>{{ lang_name }} {% if country_name %}({{ country_name }}) {% endif %}- {{ lang_id }}</option>
        {%- endfor -%}
      </select>{{- '' -}}
    </p>
    <div class="description">{{ _('What language do you prefer for search?') }}</div>
  </fieldset>
  <fieldset>
    <legend>{{ _('Autocomplete') }}</legend>
    <p class="value">
      <select name="autocomplete">
        <option value=""> - </option>
Alex's avatar
Alex committed
55
        {%- for backend in autocomplete_backends -%}
56
        <option value="{{ backend }}" {% if backend == autocomplete %}selected="selected"{% endif %}>{{ backend }}</option>
Alex's avatar
Alex committed
57
        {%- endfor -%}
58
59
60
61
62
63
64
65
66
67
68
69
70
      </select>
    </p>
    <div class="description">{{ _('Find stuff as you type') }}</div>
  </fieldset>
  <fieldset>
    <legend>{{ _('SafeSearch') }}</legend>
    <p class="value">
      <select name='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>
    </p>
71
    <p class="description">{{ _('Filter content') }}</p>
72
73
  </fieldset>
  {{ plugin_preferences('general') }}
Alex's avatar
Alex committed
74
75
76
77
78
79
80
81
82
83
84
85
86
  <fieldset>
    <legend>{{ _('Open Access DOI resolver') }}</legend>
    <p class="value">
      <select id='doi_resolver' name='doi_resolver'>
      {%- for doi_resolver_name,doi_resolver_url in doi_resolvers.items() -%}
         <option value="{{ doi_resolver_name }}" {% if doi_resolver_name == current_doi_resolver %}selected="selected"{% endif %}>
         {{- doi_resolver_name }} - {{ doi_resolver_url -}}
         </option>
      {%- endfor -%}
      </select>
    </p>
    <div class="description"><!-- {{ _('Redirect to open-access versions of publications when available (plugin required)') }} --></div>
  </fieldset>
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
  {{ tab_footer() }}

  {{ tab_header('maintab', 'engines', _('Engines')) }}
    <p>{{ _('Currently used search engines') }}</p>

    {{ tabs_open() }}
    {% for categ in all_categories %}

    {{ tab_header('enginetab', 'category' + categ, _(categ)) }}
    <div class="scrollx">
    <table class="striped">
      <tr>
        <th class="engine_checkbox">{{ _("Allow") }}</th>
        <th class="name">{{ _("Engine name") }}</th>
        <th class="shortcut">{{ _("Shortcut") }}</th>
        <th>{{ _("Supports selected language") }}</th>
        <th>{{ _("SafeSearch") }}</th>
        <th>{{ _("Time range") }}</th>
        <th>{{ _("Avg. time") }}</th>
        <th>{{ _("Max time") }}</th>
      </tr>
      {% for search_engine in engines_by_category[categ] %}

      {% if not search_engine.private %}
      {% set engine_id = 'engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_') %}
      <tr>
        <td class="engine_checkbox">{{ checkbox_onoff(engine_id, (search_engine.name, categ) in disabled_engines) }}</td>
        <th class="name">{{ search_engine.name }}</th>
        <td class="shortcut">{{ shortcuts[search_engine.name] }}</td>
        <td>{{ checkbox(engine_id + '_supported_languages', current_language == 'all' or current_language in search_engine.supported_languages or current_language.split('-')[0] in search_engine.supported_languages, true, true) }}</td>
        <td>{{ checkbox(engine_id + '_safesearch', search_engine.safesearch==True, true, true) }}</td>
        <td>{{ checkbox(engine_id + '_time_range_support', search_engine.time_range_support==True, true, true) }}</td>
        <td class="{{ 'danger' if stats[search_engine.name]['warn_time'] else '' }}">{{ 'N/A' if stats[search_engine.name].time==None else stats[search_engine.name].time }}</td>
        <td class="{{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}">{{ search_engine.timeout }}</td>
      </tr>
      {% endif %}
      {% endfor %}
    </table>
125
    </div>
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
    {{ tab_footer() }}
    {% endfor %}
    {{ tabs_close() }}
  {{ tab_footer() }}

  {{ tab_header('maintab', 'ui', _('User interface')) }}
  <fieldset>
    <legend>{{ _('Interface language') }}</legend>
    <p class="value">
      <select name='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>
    </p>
    <div class="description">{{ _('Change the language of the layout') }}</div>
  </fieldset>
  <fieldset>
    <legend>{{ _('Themes') }}</legend>
    <p class="value">
      <select name="theme">
        {%- for name in themes -%}
        <option value="{{ name }}" {% if name == theme %}selected="selected"{% endif %}>{{ name }}</option>
        {%- endfor -%}
      </select>
    </p>
    <div class="description">{{ _('Change searx layout') }}</div>
  </fieldset>
  <fieldset>
    <legend>{{ _('Results on new tabs') }}</legend>
    <p class="value">
      <select name='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>
    </p>
    <div class="description">{{_('Open result links on new browser tabs') }}</div>
  </fieldset>
  {{ plugin_preferences('ui') }}
  {{ tab_footer() }}

Alex's avatar
Alex committed
167
168
169
170
171
172
173
  {{ tab_header('maintab', 'cookies', _('Cookies')) }}

     <p class="text-muted" style="margin:20px 0;">
        {{ _('This is the list of cookies and their values searx is storing on your computer.') }}<br />
        {{ _('With that list, you can assess searx transparency.') }}<br />
     </p>

174
     {% if cookies %}
Alex's avatar
Alex committed
175
176
177
178
179
180
181
182
183
184
185
186
187
188
     <table class="cookies">
       <tr>
          <th>{{ _('Cookie name') }}</th>
          <th>{{ _('Value') }}</th>
       </tr>
       {% for cookie in cookies %}
       <tr>
          <td>{{ cookie }}</td>
          <td>{{ cookies[cookie] }}</td>
       </tr>
       {% endfor %}
     </table>
     {% else %}
        {% include 'oscar/messages/no_cookies.html' %}
189
     {% endif %}
Alex's avatar
Alex committed
190
191
192
193
194
195

     <h4>{{ _('Search URL of the currently saved preferences') }} :</h4>
     <div class="selectable_url">
       <pre>{{ url_for('index', _external=True) }}?preferences={{ preferences_url_params|e }}{% raw %}&amp;q=%s{% endraw %}</pre>
     </div>
     <p class="small_font">{{ _('Note: specifying custom settings in the search URL can reduce privacy by leaking data to the clicked result sites.') }}</p>
196

Alex's avatar
Alex committed
197
198
  {{ tab_footer() }}

199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
  {{ tab_header('maintab', 'privacy', _('Privacy')) }}
  <fieldset>
    <legend>{{ _('Method') }}</legend>
    <p class="value">
      <select name='method'>
        <option value="POST" {% if method == 'POST' %}selected="selected"{% endif %}>POST</option>
        <option value="GET" {% if method == 'GET' %}selected="selected"{% endif %}>GET</option>
      </select>
    </p>
    <div class="description">{{ _('Search language') }}</div>
  </fieldset>
  <fieldset>
    <legend>{{ _('Image proxy') }}</legend>
    <p class="value">
      <select name='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>
    </p>
    <div class="description">{{ _('Proxying image results through searx') }}</div>
  </fieldset>
  {{ plugin_preferences('privacy') }}
221

222
223
224
225
226
227
228
  {{ tab_footer() }}

  {{ tabs_close() }}

  <p class="small_font">{{ _('These settings are stored in your cookies, this allows us not to store this data about you.') }}
    <br />
    {{ _("These cookies serve your sole convenience, we don't use these cookies to track you.") }}
229
  </p>
230
231
232
233
234
235
236

  <input type="submit" value="{{ _('save') }}" />
  <div class="{% if rtl %}left{% else %}right{% endif %} preferences_back"><a href="{{ url_for('clear_cookies') }}">{{ _('Reset defaults') }}</a></div>
  <div class="{% if rtl %}left{% else %}right{% endif %} preferences_back"><a href="{{ url_for('index') }}">{{ _('back') }}</a></div>

</form>
{% endblock %}