on master help sign in
Merge branch 'Cqoicebordel-oscar-cookies'
commitbbd83f5a519381ac7ea690a1645258d106a9ba8a authorAdam Tauber <asciimoo@gmail.com> dateSun 26 Apr 2015, 20:17 (12 years ago) parentad8611c41e00e6
1 file changed+176−150
searx/templates/oscar/preferences.html+176−150
searx/templates/oscar/preferences.html+176−150
@@ -12,179 +12,205 @@
1212 <h1>{{ _('Preferences') }}</h1>
1313 <form method="post" action="{{ url_for('preferences') }}" id="search_form">
1414
15− <!-- Nav tabs -->
16− <ul class="nav nav-tabs nav-justified hide_if_nojs" role="tablist" style="margin-bottom:20px;">
17− <li class="active"><a href="#tab_general" role="tab" data-toggle="tab">{{ _('General') }}</a></li>
18− <li><a href="#tab_engine" role="tab" data-toggle="tab">{{ _('Engines') }}</a></li>
19− <li><a href="#tab_plugins" role="tab" data-toggle="tab">{{ _('Plugins') }}</a></li>
20− </ul>
15+ <!-- Nav tabs -->
16+ <ul class="nav nav-tabs nav-justified hide_if_nojs" role="tablist" style="margin-bottom:20px;">
17+ <li class="active"><a href="#tab_general" role="tab" data-toggle="tab">{{ _('General') }}</a></li>
18+ <li><a href="#tab_engine" role="tab" data-toggle="tab">{{ _('Engines') }}</a></li>
19+ <li><a href="#tab_plugins" role="tab" data-toggle="tab">{{ _('Plugins') }}</a></li>
20+ <li><a href="#tab_cookies" role="tab" data-toggle="tab">{{ _('Cookies') }}</a></li>
21+ </ul>
2122
22− <!-- Tab panes -->
23− <noscript>
24− <h3>{{ _('General') }}</h3>
25− </noscript>
26− <div class="tab-content">
27− <div class="tab-pane active" id="tab_general">
28− <fieldset>
29− <div class="container-fluid">
30− <div class="row form-group">
31− {% if rtl %}
32− <div class="col-sm-11 col-md-10">
33− {% include 'oscar/categories.html' %}
34− </div>
35− <label class="col-sm-3 col-md-2">{{ _('Default categories') }}</label>
36− {% else %}
37− <label class="col-sm-3 col-md-2">{{ _('Default categories') }}</label>
38− <div class="col-sm-11 col-md-10">
39− {% include 'oscar/categories.html' %}
23+ <!-- Tab panes -->
24+ <noscript>
25+ <h3>{{ _('General') }}</h3>
26+ </noscript>
27+ <div class="tab-content">
28+ <div class="tab-pane active" id="tab_general">
29+ <fieldset>
30+ <div class="container-fluid">
31+ <div class="row form-group">
32+ {% if rtl %}
33+ <div class="col-sm-11 col-md-10">
34+ {% include 'oscar/categories.html' %}
35+ </div>
36+ <label class="col-sm-3 col-md-2">{{ _('Default categories') }}</label>
37+ {% else %}
38+ <label class="col-sm-3 col-md-2">{{ _('Default categories') }}</label>
39+ <div class="col-sm-11 col-md-10">
40+ {% include 'oscar/categories.html' %}
41+ </div>
42+ {% endif %}
4043 </div>
41− {% endif %}
42− </div>
43− {% set language_label = _('Search language') %}
44− {% set language_info = _('What language do you prefer for search?') %}
45− {{ preferences_item_header(language_info, language_label, rtl) }}
46− <select class="form-control" name='language'>
47− <option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Automatic') }}</option>
48− {% for lang_id,lang_name,country_name in language_codes | sort(attribute=1) %}
49− <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>{{ lang_name }} ({{ country_name }}) - {{ lang_id }}</option>
50− {% endfor %}
51− </select>
52− {{ preferences_item_footer(language_info, language_label, rtl) }}
44+ {% set language_label = _('Search language') %}
45+ {% set language_info = _('What language do you prefer for search?') %}
46+ {{ preferences_item_header(language_info, language_label, rtl) }}
47+ <select class="form-control" name='language'>
48+ <option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Automatic') }}</option>
49+ {% for lang_id,lang_name,country_name in language_codes | sort(attribute=1) %}
50+ <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>{{ lang_name }} ({{ country_name }}) - {{ lang_id }}</option>
51+ {% endfor %}
52+ </select>
53+ {{ preferences_item_footer(language_info, language_label, rtl) }}
5354
54− {% set locale_label = _('Interface language') %}
55− {% set locale_info = _('Change the language of the layout') %}
56− {{ preferences_item_header(locale_info, locale_label, rtl) }}
57− <select class="form-control" name='locale'>
58− {% for locale_id,locale_name in locales.items() | sort %}
59− <option value="{{ locale_id }}" {% if locale_id == current_locale %}selected="selected"{% endif %}>{{ locale_name }}</option>
60− {% endfor %}
61− </select>
62− {{ preferences_item_footer(locale_info, locale_label, rtl) }}
55+ {% set locale_label = _('Interface language') %}
56+ {% set locale_info = _('Change the language of the layout') %}
57+ {{ preferences_item_header(locale_info, locale_label, rtl) }}
58+ <select class="form-control" name='locale'>
59+ {% for locale_id,locale_name in locales.items() | sort %}
60+ <option value="{{ locale_id }}" {% if locale_id == current_locale %}selected="selected"{% endif %}>{{ locale_name }}</option>
61+ {% endfor %}
62+ </select>
63+ {{ preferences_item_footer(locale_info, locale_label, rtl) }}
6364
64− {% set autocomplete_label = _('Autocomplete') %}
65− {% set autocomplete_info = _('Find stuff as you type') %}
66− {{ preferences_item_header(autocomplete_info, autocomplete_label, rtl) }}
67− <select class="form-control" name="autocomplete">
68− <option value=""> - </option>
69− {% for backend in autocomplete_backends %}
70− <option value="{{ backend }}" {% if backend == autocomplete %}selected="selected"{% endif %}>{{ backend }}</option>
71− {% endfor %}
72− </select>
73− {{ preferences_item_footer(autocomplete_info, autocomplete_label, rtl) }}
65+ {% set autocomplete_label = _('Autocomplete') %}
66+ {% set autocomplete_info = _('Find stuff as you type') %}
67+ {{ preferences_item_header(autocomplete_info, autocomplete_label, rtl) }}
68+ <select class="form-control" name="autocomplete">
69+ <option value=""> - </option>
70+ {% for backend in autocomplete_backends %}
71+ <option value="{{ backend }}" {% if backend == autocomplete %}selected="selected"{% endif %}>{{ backend }}</option>
72+ {% endfor %}
73+ </select>
74+ {{ preferences_item_footer(autocomplete_info, autocomplete_label, rtl) }}
7475
75− {% set image_proxy_label = _('Image proxy') %}
76− {% set image_proxy_info = _('Proxying image results through searx') %}
77− {{ preferences_item_header(image_proxy_info, image_proxy_label, rtl) }}
78− <select class="form-control" name='image_proxy'>
79− <option value="1" {% if image_proxy %}selected="selected"{% endif %}>{{ _('Enabled') }}</option>
80− <option value="" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled')}}</option>
81− </select>
82− {{ preferences_item_footer(image_proxy_info, image_proxy_label, rtl) }}
76+ {% set image_proxy_label = _('Image proxy') %}
77+ {% set image_proxy_info = _('Proxying image results through searx') %}
78+ {{ preferences_item_header(image_proxy_info, image_proxy_label, rtl) }}
79+ <select class="form-control" name='image_proxy'>
80+ <option value="1" {% if image_proxy %}selected="selected"{% endif %}>{{ _('Enabled') }}</option>
81+ <option value="" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled')}}</option>
82+ </select>
83+ {{ preferences_item_footer(image_proxy_info, image_proxy_label, rtl) }}
8384
84− {% set method_label = _('Method') %}
85− {% 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>') %}
86− {{ preferences_item_header(method_info, method_label, rtl) }}
87− <select class="form-control" name='method'>
88− <option value="POST" {% if method == 'POST' %}selected="selected"{% endif %}>POST</option>
89− <option value="GET" {% if method == 'GET' %}selected="selected"{% endif %}>GET</option>
90− </select>
91− {{ preferences_item_footer(method_info, method_label, rtl) }}
85+ {% set method_label = _('Method') %}
86+ {% 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>') %}
87+ {{ preferences_item_header(method_info, method_label, rtl) }}
88+ <select class="form-control" name='method'>
89+ <option value="POST" {% if method == 'POST' %}selected="selected"{% endif %}>POST</option>
90+ <option value="GET" {% if method == 'GET' %}selected="selected"{% endif %}>GET</option>
91+ </select>
92+ {{ preferences_item_footer(method_info, method_label, rtl) }}
9293
93− {% set safesearch_label = _('SafeSearch') %}
94− {% set safesearch_info = _('Filter content') %}
95− {{ preferences_item_header(safesearch_info, safesearch_label, rtl) }}
96− <select class="form-control" name='safesearch'>
97− <option value="2" {% if safesearch == '2' %}selected="selected"{% endif %}>{{ _('Strict') }}</option>
98− <option value="1" {% if safesearch == '1' %}selected="selected"{% endif %}>{{ _('Moderate') }}</option>
99− <option value="0" {% if safesearch == '0' %}selected="selected"{% endif %}>{{ _('None') }}</option>
100− </select>
101− {{ preferences_item_footer(safesearch_info, safesearch_label, rtl) }}
94+ {% set safesearch_label = _('SafeSearch') %}
95+ {% set safesearch_info = _('Filter content') %}
96+ {{ preferences_item_header(safesearch_info, safesearch_label, rtl) }}
97+ <select class="form-control" name='safesearch'>
98+ <option value="2" {% if safesearch == '2' %}selected="selected"{% endif %}>{{ _('Strict') }}</option>
99+ <option value="1" {% if safesearch == '1' %}selected="selected"{% endif %}>{{ _('Moderate') }}</option>
100+ <option value="0" {% if safesearch == '0' %}selected="selected"{% endif %}>{{ _('None') }}</option>
101+ </select>
102+ {{ preferences_item_footer(safesearch_info, safesearch_label, rtl) }}
102103
103− {% set theme_label = _('Themes') %}
104− {% set theme_info = _('Change searx layout') %}
105− {{ preferences_item_header(theme_info, theme_label, rtl) }}
106− <select class="form-control" name="theme">
107− {% for name in themes %}
108− <option value="{{ name }}" {% if name == theme %}selected="selected"{% endif %}>{{ name }}</option>
109− {% endfor %}
110− </select>
111− {{ preferences_item_footer(theme_info, theme_label, rtl) }}
104+ {% set theme_label = _('Themes') %}
105+ {% set theme_info = _('Change searx layout') %}
106+ {{ preferences_item_header(theme_info, theme_label, rtl) }}
107+ <select class="form-control" name="theme">
108+ {% for name in themes %}
109+ <option value="{{ name }}" {% if name == theme %}selected="selected"{% endif %}>{{ name }}</option>
110+ {% endfor %}
111+ </select>
112+ {{ preferences_item_footer(theme_info, theme_label, rtl) }}
113+ </div>
114+ </fieldset>
112115 </div>
113− </fieldset>
114− </div>
115− <div class="tab-pane active_if_nojs" id="tab_engine">
116+ <div class="tab-pane active_if_nojs" id="tab_engine">
116117
117− <!-- Nav tabs -->
118− <ul class="nav nav-tabs nav-justified hide_if_nojs" role="tablist" style="margin-bottom:20px;">
119− {% for categ in categories %}
120− <li{% if loop.first %} class="active"{% endif %}><a href="#tab_engine_{{ categ|replace(' ', '_') }}" role="tab" data-toggle="tab">{{ _(categ) }}</a></li>
121− {% endfor %}
122− </ul>
118+ <!-- Nav tabs -->
119+ <ul class="nav nav-tabs nav-justified hide_if_nojs" role="tablist" style="margin-bottom:20px;">
120+ {% for categ in categories %}
121+ <li{% if loop.first %} class="active"{% endif %}><a href="#tab_engine_{{ categ|replace(' ', '_') }}" role="tab" data-toggle="tab">{{ _(categ) }}</a></li>
122+ {% endfor %}
123+ </ul>
123124
124− <noscript>
125− <h3>{{ _('Engines') }}</h3>
126− </noscript>
125+ <noscript>
126+ <h3>{{ _('Engines') }}</h3>
127+ </noscript>
127128
128− <!-- Tab panes -->
129− <div class="tab-content">
130− {% for categ in categories %}
131− <noscript><label>{{ _(categ) }}</label>
129+ <!-- Tab panes -->
130+ <div class="tab-content">
131+ {% for categ in categories %}
132+ <noscript><label>{{ _(categ) }}</label>
133+ </noscript>
134+ <div class="tab-pane{% if loop.first %} active{% endif %} active_if_nojs" id="tab_engine_{{ categ|replace(' ', '_') }}">
135+ <div class="container-fluid">
136+ <fieldset>
137+ {% for search_engine in engines_by_category[categ] %}
138+ {% if not search_engine.private %}
139+ <div class="row">
140+ {% if not rtl %}
141+ <div class="col-xs-6 col-sm-4 col-md-4">{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})</div>
142+ {% endif %}
143+ <div class="col-xs-6 col-sm-4 col-md-4">
144+ {{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in blocked_engines) }}
145+ </div>
146+ {% if rtl %}
147+ <div class="col-xs-6 col-sm-4 col-md-4">{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})&lrm;</div>
148+ {% endif %}
149+ </div>
150+ {% endif %}
151+ {% endfor %}
152+ </fieldset>
153+ </div>
154+ </div>
155+ {% endfor %}
156+ </div>
157+ </div>
158+ <div class="tab-pane active_if_nojs" id="tab_plugins">
159+ <noscript>
160+ <h3>{{ _('Plugins') }}</h3>
132161 </noscript>
133− <div class="tab-pane{% if loop.first %} active{% endif %} active_if_nojs" id="tab_engine_{{ categ|replace(' ', '_') }}">
162+ <fieldset>
134163 <div class="container-fluid">
135− <fieldset>
136− {% for search_engine in engines_by_category[categ] %}
137− {% if not search_engine.private %}
138− <div class="row">
139− {% if not rtl %}
140− <div class="col-xs-6 col-sm-4 col-md-4">{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})</div>
141− {% endif %}
142− <div class="col-xs-6 col-sm-4 col-md-4">
143− {{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in blocked_engines) }}
164+ {% for plugin in plugins %}
165+ <div class="panel panel-default">
166+ <div class="panel-heading">
167+ <h3 class="panel-title">{{ plugin.name }}</h3>
168+ </div>
169+ <div class="panel-body">
170+ <div class="col-xs-6 col-sm-4 col-md-6">{{ plugin.description }}</div>
171+ <div class="col-xs-6 col-sm-4 col-md-6">
172+ {{ checkbox_toggle('plugin_' + plugin.id, plugin.id not in allowed_plugins) }}
144173 </div>
145− {% if rtl %}
146− <div class="col-xs-6 col-sm-4 col-md-4">{{ search_engine.name }} ({{ shortcuts[search_engine.name] }})&lrm;</div>
147− {% endif %}
148174 </div>
149− {% endif %}
150− {% endfor %}
151− </fieldset>
175+ </div>
176+ {% endfor %}
152177 </div>
153− </div>
154− {% endfor %}
178+ </fieldset>
155179 </div>
156− </div>
157− <div class="tab-pane active_if_nojs" id="tab_plugins">
158− <noscript>
159− <h3>{{ _('Plugins') }}</h3>
160− </noscript>
161− <fieldset>
162− <div class="container-fluid">
163− {% for plugin in plugins %}
164− <div class="panel panel-default">
165− <div class="panel-heading">
166− <h3 class="panel-title">{{ plugin.name }}</h3>
167− </div>
168− <div class="panel-body">
169− <div class="col-xs-6 col-sm-4 col-md-6">{{ plugin.description }}</div>
170− <div class="col-xs-6 col-sm-4 col-md-6">
171− {{ checkbox_toggle('plugin_' + plugin.id, plugin.id not in allowed_plugins) }}
180+
181+ <div class="tab-pane active_if_nojs" id="tab_cookies">
182+ <noscript>
183+ <h3>{{ _('Cookies') }}</h3>
184+ </noscript>
185+ <p class="text-muted" style="margin:20px 0;">
186+ {{ _('This is the list of cookies and their values searx is storing on your computer.') }}<br />
187+ {{ _('With that list, you can assess searx transparency.') }}<br />
188+ </p>
189+ <div class="container-fluid">
190+ <fieldset>
191+ <div class="row">
192+ <div class="col-xs-6 col-sm-4 col-md-4 text-muted"><label>{{ _('Cookie name') }}</label></div>
193+ <div class="col-xs-6 col-sm-4 col-md-4 text-muted"><label>{{ _('Value') }}</label></div>
172194 </div>
173− </div>
195+
196+ {% for cookie in cookies %}
197+ <div class="row">
198+ <div class="col-xs-6 col-sm-4 col-md-4 text-muted">{{ cookie }}</div>
199+ <div class="col-xs-6 col-sm-4 col-md-4 text-muted">{{ cookies[cookie] }}</div>
200+ </div>
201+ {% endfor %}
202+ </fieldset>
174203 </div>
175− {% endfor %}
176204 </div>
177− </fieldset>
178205 </div>
179− </div>
180− <p class="text-muted" style="margin:20px 0;">{{ _('These settings are stored in your cookies, this allows us not to store this data about you.') }}
181− <br />
182− {{ _("These cookies serve your sole convenience, we don't use these cookies to track you.") }}
183− </p>
206+ <p class="text-muted" style="margin:20px 0;">{{ _('These settings are stored in your cookies, this allows us not to store this data about you.') }}
207+ <br />
208+ {{ _("These cookies serve your sole convenience, we don't use these cookies to track you.") }}
209+ </p>
184210
185− <input type="submit" class="btn btn-primary" value="{{ _('save') }}" />
186− <a href="{{ url_for('index') }}"><div class="btn btn-default">{{ _('back') }}</div></a>
187− <a href="{{ url_for('clear_cookies') }}"><div class="btn btn-default">{{ _('Reset defaults') }}</div></a>
211+ <input type="submit" class="btn btn-primary" value="{{ _('save') }}" />
212+ <a href="{{ url_for('index') }}"><div class="btn btn-default">{{ _('back') }}</div></a>
213+ <a href="{{ url_for('clear_cookies') }}"><div class="btn btn-default">{{ _('Reset defaults') }}</div></a>
188214 </form>
189215</div>
190216{% endblock %}