preferences.html 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. {% 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 %}
  2. {% extends "oscar/base.html" %}
  3. {%- macro engine_about(search_engine, id) -%}
  4. {% if search_engine.about is defined or stats[search_engine.name]['result_count'] > 0 %}
  5. {% set about = search_engine.about %}
  6. <div class="engine-tooltip" role="tooltip" id="{{ id }}">{{- "" -}}
  7. <p class="description"></p>
  8. {% if search_engine.about is defined %}
  9. <h5><a href="{{about.website}}" rel="noreferrer">{{about.website}}</a></h5>
  10. {%- 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 -%}
  11. {% endif %}
  12. {%- if search_engine.enable_http %}<p>{{ icon('exclamation-sign', 'No HTTPS') }}{{ _('No HTTPS')}}</p>{% endif -%}
  13. {%- if stats[search_engine.name]['result_count'] -%}
  14. <p>{{ _('Number of results') }}: {{ stats[search_engine.name]['result_count'] }} ( {{ _('Avg.') }} )</p>{{- "" -}}
  15. {%- endif -%}
  16. {%- if reliabilities.get(search_engine.name, {}).errors or reliabilities.get(search_engine.name, {}).checker -%}
  17. <a href="{{ url_for('stats', engine=search_engine.name|e) }}" title="{{ _('View error logs and submit a bug report') }}">
  18. {{ _('View error logs and submit a bug report') }}
  19. </a>
  20. {%- endif -%}
  21. </div>
  22. {%- endif -%}
  23. {%- endmacro %}
  24. {%- macro engine_time(engine_name, css_align_class) -%}
  25. <td class="{{ label }}">{{- "" -}}
  26. {%- if stats[engine_name].time != None -%}
  27. <span class="stacked-bar-chart-value">{{- stats[engine_name].time -}}</span>{{- "" -}}
  28. <span class="stacked-bar-chart" aria-labelledby="{{engine_name}}_chart" aria-hidden="true">
  29. {%- if max_rate95 is not none and max_rate95 > 0 -%}
  30. <div class="stacked-bar-chart-median bar{{ (100 * (stats[engine_name].time / max_rate95))|round }}"></div>{{- "" -}}
  31. <div class="stacked-bar-chart-rate80 bar{{ (100 * ((stats[engine_name].rate80 - stats[engine_name].time) / max_rate95))|round }}"></div>{{- "" -}}
  32. <div class="stacked-bar-chart-rate95 bar{{ (100 * ((stats[engine_name].rate95 - stats[engine_name].rate80) / max_rate95))|round }}"></div>{{- "" -}}
  33. <span class="stacked-bar-chart-rate100"></span>
  34. {%- endif -%}
  35. </span>{{- "" -}}
  36. <div class="engine-tooltip text-left" role="tooltip" id="{{engine_name}}_graph">{{- "" -}}
  37. <p>{{ _('Median') }}: {{ stats[engine_name].time }}</p>{{- "" -}}
  38. <p>{{ _('P80') }}: {{ stats[engine_name].rate80 }}</p>{{- "" -}}
  39. <p>{{ _('P95') }}: {{ stats[engine_name].rate95 }}</p>{{- "" -}}
  40. </div>
  41. {%- endif -%}
  42. </td>
  43. {%- endmacro -%}
  44. {%- macro engine_reliability(engine_name, css_align_class) -%}
  45. {% set r = reliabilities.get(engine_name, {}).get('reliablity', None) %}
  46. {% set checker_result = reliabilities.get(engine_name, {}).get('checker', []) %}
  47. {% set errors = reliabilities.get(engine_name, {}).get('errors', []) %}
  48. {% if r != None %}
  49. {% if r <= 50 %}{% set label = 'danger' %}
  50. {% elif r < 80 %}{% set label = 'warning' %}
  51. {% elif r < 90 %}{% set label = 'default' %}
  52. {% else %}{% set label = 'success' %}
  53. {% endif %}
  54. {% else %}
  55. {% set r = '' %}
  56. {% endif %}
  57. {% if checker_result or errors %}
  58. <td class="{{ css_align_class }} {{ label }}">{{- "" -}}
  59. <a href="{{ url_for('stats', engine=engine_name|e) }}">{{- "" -}}
  60. <span aria-labelledby="{{engine_name}}_reliability">
  61. {{ icon('exclamation-sign', 'The engine is not reliabled') }} {{ r -}}
  62. </span>{{- "" -}}
  63. </a>{{- "" -}}
  64. <div class="engine-tooltip text-left" role="tooltip" id="{{engine_name}}_reliability">
  65. {%- if checker_result -%}
  66. <p>{{ _("Failed checker test(s): ") }} {{ ', '.join(checker_result) }}</p>
  67. {%- endif -%}
  68. {%- for error in errors -%}
  69. <p>{{ error }} </p>{{- "" -}}
  70. {%- endfor -%}
  71. </div>{{- "" -}}
  72. </td>
  73. {%- else -%}
  74. <td class="{{ css_align_class }} {{ label }}"><span>{{ r }}</span></td>
  75. {%- endif -%}
  76. {%- endmacro -%}
  77. {%- macro plugin_of_category(plugin_category) -%}
  78. {%- for plugin in plugins -%}
  79. {%- if plugin.preference_section == plugin_category -%}
  80. {{- preferences_item_header(_(plugin.description), _(plugin.name), rtl, 'plugin_' + plugin.id) -}}
  81. {{- checkbox_toggle('plugin_' + plugin.id, plugin.id not in allowed_plugins) -}}
  82. {{- preferences_item_footer(_(plugin.description), _(plugin.name), rtl) -}}
  83. {%- endif -%}
  84. {%- endfor -%}
  85. {% endmacro %}
  86. {%- block title %}{{ _('preferences') }} - {% endblock -%}
  87. {% block content %}
  88. <div>
  89. <h1>{{ _('Preferences') }}</h1>
  90. <form method="post" action="{{ url_for('preferences') }}" id="search_form">
  91. <!-- Nav tabs -->
  92. <ul class="nav nav-tabs nav-justified hide_if_nojs" role="tablist">
  93. <li class="active"><a href="#tab_general" role="tab" data-toggle="tab">{{ _('General') }}</a></li>
  94. <li><a href="#tab_ui" role="tab" data-toggle="tab">{{ _('User Interface') }}</a></li>
  95. <li><a href="#tab_privacy" role="tab" data-toggle="tab">{{ _('Privacy') }}</a></li>
  96. <li><a href="#tab_engine" role="tab" data-toggle="tab">{{ _('Engines') }}</a></li>
  97. <li><a href="#tab_query" role="tab" data-toggle="tab">{{ _('Special Queries') }}</a></li>
  98. <li><a href="#tab_cookies" role="tab" data-toggle="tab">{{ _('Cookies') }}</a></li>
  99. </ul>
  100. <!-- Tab panes -->
  101. <noscript>
  102. <h3>{{ _('General') }}</h3>
  103. </noscript>
  104. <div class="tab-content">
  105. <div class="tab-pane active" id="tab_general">
  106. <fieldset>
  107. <div class="container-fluid">
  108. {% if 'categories' not in locked_preferences %}
  109. <div class="row form-group">
  110. {% if rtl %}
  111. <div class="col-sm-11 col-md-10">
  112. {% include 'oscar/categories.html' %}
  113. </div>
  114. <label class="col-sm-3 col-md-2" for="categories">{{ _('Default categories') }}</label>
  115. {% else %}
  116. <label class="col-sm-3 col-md-2" for="categories">{{ _('Default categories') }}</label>
  117. <div class="col-sm-11 col-md-10 search-categories">
  118. {% include 'oscar/categories.html' %}
  119. </div>
  120. {% endif %}
  121. </div>
  122. {% endif %}
  123. {% if 'language' not in locked_preferences %}
  124. {% set language_label = _('Search language') %}
  125. {% set language_info = _('What language do you prefer for search?') %}
  126. {{ preferences_item_header(language_info, language_label, rtl, 'language') }}
  127. {% include 'oscar/languages.html' %}
  128. {{ preferences_item_footer(language_info, language_label, rtl) }}
  129. {% endif %}
  130. {% if 'safesearch' not in locked_preferences %}
  131. {% set safesearch_label = _('SafeSearch') %}
  132. {% set safesearch_info = _('Filter content') %}
  133. {{ preferences_item_header(safesearch_info, safesearch_label, rtl, 'safesearch') }}
  134. <select class="form-control {{ custom_select_class(rtl) }}" name="safesearch" id="safesearch">
  135. <option value="2" {% if safesearch == '2' %}selected="selected"{% endif %}>{{ _('Strict') }}</option>
  136. <option value="1" {% if safesearch == '1' %}selected="selected"{% endif %}>{{ _('Moderate') }}</option>
  137. <option value="0" {% if safesearch == '0' %}selected="selected"{% endif %}>{{ _('None') }}</option>
  138. </select>
  139. {{ preferences_item_footer(safesearch_info, safesearch_label, rtl) }}
  140. {% endif %}
  141. {% if 'autocomplete' not in locked_preferences %}
  142. {% set autocomplete_label = _('Autocomplete') %}
  143. {% set autocomplete_info = _('Find stuff as you type') %}
  144. {{ preferences_item_header(autocomplete_info, autocomplete_label, rtl, 'autocomplete') }}
  145. <select class="form-control {{ custom_select_class(rtl) }}" name="autocomplete" id="autocomplete">
  146. <option value=""> - </option>
  147. {% for backend in autocomplete_backends %}
  148. <option value="{{ backend }}" {% if backend == autocomplete %}selected="selected"{% endif %}>{{ backend }}</option>
  149. {% endfor %}
  150. </select>
  151. {{ preferences_item_footer(autocomplete_info, autocomplete_label, rtl) }}
  152. {% endif %}
  153. {{ plugin_of_category('general' )}}
  154. {% if 'doi_resolver' not in locked_preferences %}
  155. {% set label = _('Open Access DOI resolver') %}
  156. {% set info = _('Redirect to open-access versions of publications when available (plugin required)') %}
  157. {{ preferences_item_header(info, label, rtl, 'doi_resolver') }}
  158. <select class="form-control {{ custom_select_class(rtl) }}" name="doi_resolver" id="doi_resolver">
  159. {% for doi_resolver_name,doi_resolver_url in doi_resolvers.items() %}
  160. <option value="{{ doi_resolver_name }}" {% if doi_resolver_url == current_doi_resolver %}selected="selected"{% endif %}>
  161. {{ doi_resolver_name }} - {{ doi_resolver_url }}
  162. </option>
  163. {% endfor %}
  164. </select>
  165. {{ preferences_item_footer(info, label, rtl) }}
  166. {% endif %}
  167. {{ plugin_of_category('onion' )}}
  168. {% set label = _('Engine tokens') %}
  169. {% set info = _('Access tokens for private engines') %}
  170. {{ preferences_item_header(info, label, rtl, 'tokens') }}
  171. <input class="form-control" id="tokens" name="tokens" value='{{ preferences.tokens.get_value() }}' autocomplete="off" spellcheck="false" autocorrect="off" />
  172. {{ preferences_item_footer(info, label, rtl) }}
  173. </div>
  174. </fieldset>
  175. </div>
  176. <div class="tab-pane active_if_nojs" id="tab_ui">
  177. <noscript>
  178. <h3>{{ _('User Interface') }}</h3>
  179. </noscript>
  180. <fieldset>
  181. <div class="container-fluid">
  182. {% if 'locale' not in locked_preferences %}
  183. {% set locale_label = _('Interface language') %}
  184. {% set locale_info = _('Change the language of the layout') %}
  185. {{ preferences_item_header(locale_info, locale_label, rtl, 'locale') }}
  186. <select class="form-control {{ custom_select_class(rtl)}}" name="locale" id="locale">
  187. {% for locale_id,locale_name in locales.items() | sort %}
  188. <option value="{{ locale_id }}" {% if locale_id == current_locale %}selected="selected"{% endif %}>{{ locale_name }}</option>
  189. {% endfor %}
  190. </select>
  191. {{ preferences_item_footer(locale_info, locale_label, rtl) }}
  192. {% endif %}
  193. {% if 'theme' not in locked_preferences %}
  194. {% set theme_label = _('Theme') %}
  195. {% set theme_info = _('Change SearXNG layout') %}
  196. {{ preferences_item_header(theme_info, theme_label, rtl, 'theme') }}
  197. <select class="form-control {{ custom_select_class(rtl) }}" name="theme" id="theme">
  198. {% for name in themes %}
  199. <option value="{{ name }}" {% if name == theme %}selected="selected"{% endif %}>{{ name }}</option>
  200. {% endfor %}
  201. </select>
  202. {{ preferences_item_footer(theme_info, theme_label, rtl) }}
  203. {% endif %}
  204. {% if 'oscar-style' not in locked_preferences %}
  205. {{ preferences_item_header(_('Choose style for this theme'), _('Style'), rtl, 'oscar_style') }}
  206. <select class="form-control {{ custom_select_class(rtl) }}" name="oscar-style" id="oscar_style">
  207. <option value="logicodev" >Logicodev</option>
  208. <option value="pointhi" {% if preferences.get_value('oscar-style') == 'pointhi' %}selected="selected"{% endif %}>Pointhi</option>
  209. <option value="logicodev-dark" {% if preferences.get_value('oscar-style') == 'logicodev-dark' %}selected="selected"{% endif %}>Logicodev dark</option>
  210. </select>
  211. {{ preferences_item_footer(_('Choose style for this theme'), _('Style'), rtl) }}
  212. {% endif %}
  213. {% set label = _('Show advanced settings') %}
  214. {% set info = _('Show advanced settings panel in the home page by default') %}
  215. {{ preferences_item_header(info, label, rtl, 'advanced_search') }}
  216. <select class="form-control {{ custom_select_class(rtl) }}" name="advanced_search" id="advanced_search">
  217. <option value="1" {% if preferences.get_value('advanced_search')%}selected="selected"{% endif %}>{{ _('On') }}</option>
  218. <option value="0" {% if not preferences.get_value('advanced_search')%}selected="selected"{% endif %}>{{ _('Off')}}</option>
  219. </select>
  220. {{ preferences_item_footer(info, label, rtl) }}
  221. {% if 'results_on_new_tab' not in locked_preferences %}
  222. {% set label = _('Results on new tabs') %}
  223. {% set info = _('Open result links on new browser tabs') %}
  224. {{ preferences_item_header(info, label, rtl, 'results_on_new_tab') }}
  225. <select class="form-control {{ custom_select_class(rtl) }}" name="results_on_new_tab" id="results_on_new_tab">
  226. <option value="1" {% if results_on_new_tab %}selected="selected"{% endif %}>{{ _('On') }}</option>
  227. <option value="0" {% if not results_on_new_tab %}selected="selected"{% endif %}>{{ _('Off')}}</option>
  228. </select>
  229. {{ preferences_item_footer(info, label, rtl) }}
  230. {% endif %}
  231. {{ plugin_of_category('ui' )}}
  232. </div>
  233. </fieldset>
  234. </div>
  235. <div class="tab-pane active_if_nojs" id="tab_privacy">
  236. <noscript>
  237. <h3>{{ _('Privacy') }}</h3>
  238. </noscript>
  239. <fieldset>
  240. <div class="container-fluid">
  241. {% if 'method' not in locked_preferences %}
  242. {% set method_label = _('Method') %}
  243. {% 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>') %}
  244. {{ preferences_item_header(method_info, method_label, rtl, 'method') }}
  245. <select class="form-control {{ custom_select_class(rtl) }}" name="method" id="method">
  246. <option value="POST" {% if method == 'POST' %}selected="selected"{% endif %}>POST</option>
  247. <option value="GET" {% if method == 'GET' %}selected="selected"{% endif %}>GET</option>
  248. </select>
  249. {{ preferences_item_footer(method_info, method_label, rtl) }}
  250. {% endif %}
  251. {% if 'image_proxy' not in locked_preferences %}
  252. {% set image_proxy_label = _('Image proxy') %}
  253. {% set image_proxy_info = _('Proxying image results through SearXNG') %}
  254. {{ preferences_item_header(image_proxy_info, image_proxy_label, rtl, 'image_proxy') }}
  255. <select class="form-control {{ custom_select_class(rtl) }}" name="image_proxy" id="image_proxy">
  256. <option value="1" {% if image_proxy %}selected="selected"{% endif %}>{{ _('Enabled') }}</option>
  257. <option value="" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled')}}</option>
  258. </select>
  259. {{ preferences_item_footer(image_proxy_info, image_proxy_label, rtl) }}
  260. {% endif %}
  261. {% if 'query_in_title' not in locked_preferences %}
  262. {% set query_in_title_label = _("Query in the page's title") %}
  263. {% set query_in_title_info = _("When enabled, the result page's title contains your query. Your browser can record this title") %}
  264. {{ preferences_item_header(query_in_title_info, query_in_title_label, rtl, 'query_in_title') }}
  265. <select class="form-control {{ custom_select_class(rtl) }}" name="query_in_title" id="query_in_title">
  266. <option value="1" {% if query_in_title %}selected="selected"{% endif %}>{{ _('Enabled') }}</option>
  267. <option value="" {% if not query_in_title %}selected="selected"{% endif %}>{{ _('Disabled')}}</option>
  268. </select>
  269. {{ preferences_item_footer(query_in_title_info, query_in_title_label, rtl) }}
  270. {% endif %}
  271. {{ plugin_of_category('privacy' )}}
  272. </div>
  273. </fieldset>
  274. </div>
  275. <div class="tab-pane active_if_nojs" id="tab_engine">
  276. <!-- Nav tabs -->
  277. <ul class="nav nav-tabs nav-justified hide_if_nojs" role="tablist">
  278. {% for categ in categories_as_tabs %}
  279. <li{% if loop.first %} class="active"{% endif %}><a href="#tab_engine_{{ categ|replace(' ', '_') }}" role="tab" data-toggle="tab">{{ _(categ) }}</a></li>
  280. {% endfor %}
  281. </ul>
  282. <noscript>
  283. <h3>{{ _('Engines') }}</h3>
  284. </noscript>
  285. <!-- Tab panes -->
  286. <div class="tab-content">
  287. <div class="hide_if_nojs">
  288. <p class="text-{% if rtl %}left{% else %}right{% endif %}">
  289. <button type="button" class="btn btn-default btn-success" id="allow-all-engines">{{ _("Allow all") }}</button>
  290. <button type="button" class="btn btn-default btn-danger" id="disable-all-engines">{{ _("Disable all") }}</button>
  291. </p>
  292. </div>
  293. {% for categ in categories_as_tabs %}
  294. <noscript><label>{{ _(categ) }}</label>
  295. </noscript>
  296. <div class="tab-pane{% if loop.first %} active{% endif %} active_if_nojs" id="tab_engine_{{ categ|replace(' ', '_') }}">
  297. <div class="container-fluid">
  298. <fieldset>
  299. <div class="table-responsive">
  300. <table class="table table-hover table-condensed table-striped">
  301. <tr>
  302. {% if not rtl %}
  303. <th scope="col">{{ _("Allow") }}</th>
  304. <th scope="col">{{ _("Engine name") }}</th>
  305. <th scope="col">{{ _("Shortcut") }}</th>
  306. <th scope="col" class="col-stat">{{ _("Selected language") }}</th>
  307. <th scope="col" class="col-stat">{{ _("SafeSearch") }}</th>
  308. <th scope="col" class="col-stat">{{ _("Time range") }}</th>
  309. <th scope="col">{{ _("Response time") }}</th>
  310. <th scope="col" class="col-stat text-right">{{ _("Max time") }}</th>
  311. <th scope="col" class="col-stat text-right">{{ _("Reliability") }}</th>
  312. {% else %}
  313. <th scope="col" class="col-stat">{{ _("Reliability") }}</th>
  314. <th scope="col" class="col-stat">{{ _("Max time") }}</th>
  315. <th scope="col" class="text-right">{{ _("Response time") }}</th>
  316. <th scope="col" class="text-right">{{ _("Time range") }}</th>
  317. <th scope="col" class="text-right">{{ _("SafeSearch") }}</th>
  318. <th scope="col" class="text-right">{{ _("Selected language") }}</th>
  319. <th scope="col" class="text-right">{{ _("Shortcut") }}</th>
  320. <th scope="col" class="text-right">{{ _("Engine name") }}</th>
  321. <th scope="col" class="text-right">{{ _("Allow") }}</th>
  322. {% endif %}
  323. </tr>
  324. {% for search_engine in engines_by_category[categ] %}
  325. {% if not search_engine.private %}
  326. <tr>
  327. {% if not rtl %}
  328. <td class="onoff-checkbox">
  329. {{- checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) -}}
  330. </td>
  331. <th scope="row" data-engine-name="{{ search_engine.name }}"><span aria-labelledby="{{ 'tooltip_' + categ + '_' + search_engine.name }}">
  332. {%- if search_engine.enable_http %}{{ icon('exclamation-sign', 'No HTTPS') }}{% endif -%}
  333. {{- search_engine.name -}}</span>
  334. {{- engine_about(search_engine, 'tooltip_' + categ + '_' + search_engine.name) -}}
  335. </th>
  336. <td class="name">{{ shortcuts[search_engine.name] }}</td>
  337. <td>{{ support_toggle(supports[search_engine.name]['supports_selected_language']) }}</td>
  338. <td>{{ support_toggle(supports[search_engine.name]['safesearch']) }}</td>
  339. <td>{{ support_toggle(supports[search_engine.name]['time_range_support']) }}</td>
  340. {{ engine_time(search_engine.name, 'text-right') }}
  341. <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>
  342. {{ engine_reliability(search_engine.name, 'text-right ') }}
  343. {% else %}
  344. {{ engine_reliability(search_engine.name, 'text-left') }}
  345. <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>
  346. {{ engine_time(search_engine.name, 'text-left') }}
  347. <td>{{ support_toggle(supports[search_engine.name]['time_range_support']) }}</td>
  348. <td>{{ support_toggle(supports[search_engine.name]['safesearch']) }}</td>
  349. <td>{{ support_toggle(supports[search_engine.name]['supports_selected_language']) }}</td>
  350. <td>{{ shortcuts[search_engine.name] }}</td>
  351. <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>
  352. <td class="onoff-checkbox">
  353. {{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }}
  354. </td>
  355. {% endif %}
  356. </tr>
  357. {% endif %}
  358. {% endfor %}
  359. </table>
  360. </div>
  361. </fieldset>
  362. </div>
  363. </div>
  364. {% endfor %}
  365. </div>
  366. </div>
  367. <div class="tab-pane active_if_nojs" id="tab_query">
  368. <noscript>
  369. <h3>{{ _('Query') }}</h3>
  370. </noscript>
  371. {% if answerers %}
  372. <table class="table table-striped">
  373. <thead>
  374. <tr>
  375. <th{% if rtl %} class="text-right"{% endif %}>{{ _('Allow') }}</th>
  376. <th{% if rtl %} class="text-right"{% endif %}>{{ _('Keywords') }}</th>
  377. <th{% if rtl %} class="text-right"{% endif %}>{{ _('Name') }}</th>
  378. <th{% if rtl %} class="text-right"{% endif %}>{{ _('Description') }}</th>
  379. <th{% if rtl %} class="text-right"{% endif %}>{{ _('Examples') }}</th>
  380. </tr>
  381. </thead>
  382. <tbody>
  383. <td></td>
  384. <th scope="colgroup" colspan="4">{{ _("This is the list of SearXNG's instant answering modules.") }}</th>
  385. {% for answerer in answerers %}
  386. <tr>
  387. <td></td>
  388. <td>{{ answerer.keywords|join(', ') }}</td>
  389. <td>{{ answerer.info.name }}</td>
  390. <td>{{ answerer.info.description }}</td>
  391. <td>{{ answerer.info.examples|join(', ') }}</td>
  392. </tr>
  393. {% endfor %}
  394. </tbody>
  395. <tbody>
  396. <td></td>
  397. <th scope="colgroup" colspan="4">{{ _('This is the list of plugins.') }}</th>
  398. {%- for plugin in plugins -%}
  399. {%- if plugin.preference_section == 'query' -%}
  400. <tr>
  401. <td>{{- checkbox_toggle('plugin_' + plugin.id, plugin.id not in allowed_plugins) -}}</td>
  402. <td>{{ plugin.query_keywords|join(', ') }}</td>
  403. <td>{{ _(plugin.name) }}</td>
  404. <td>{{ _(plugin.description) }}</td>
  405. <td>{{ plugin.query_examples }}</td>
  406. </tr>
  407. {%- endif -%}
  408. {%- endfor -%}
  409. </tbody>
  410. </table>
  411. {% endif %}
  412. </div>
  413. <div class="tab-pane active_if_nojs" id="tab_cookies">
  414. <noscript>
  415. <h3>{{ _('Cookies') }}</h3>
  416. </noscript>
  417. <p class="text-muted">
  418. {{ _('This is the list of cookies and their values SearXNG is storing on your computer.') }}<br />
  419. {{ _('With that list, you can assess SearXNG transparency.') }}<br />
  420. </p>
  421. {% if cookies %}
  422. <table class="table table-striped">
  423. <tr>
  424. <th class="text-muted{% if rtl %} text-right{% endif %}">{{ _('Cookie name') }}</th>
  425. <th class="text-muted{% if rtl %} text-right{% endif %}">{{ _('Value') }}</th>
  426. </tr>
  427. {% for cookie in cookies %}
  428. <tr>
  429. <td class="text-muted">{{ cookie }}</td>
  430. <td class="text-muted">{{ cookies[cookie] }}</td>
  431. </tr>
  432. {% endfor %}
  433. </table>
  434. {% else %}
  435. {% include 'oscar/messages/no_cookies.html' %}
  436. {% endif %}
  437. </div>
  438. </div>
  439. <p class="text-muted">
  440. {{ _('These settings are stored in your cookies, this allows us not to store this data about you.') }}
  441. {{ _("These cookies serve your sole convenience, we don't use these cookies to track you.") }}
  442. </p>
  443. <p>
  444. {{ _('Search URL of the currently saved preferences') }}
  445. <small class="text-muted">({{ _('Note: specifying custom settings in the search URL can reduce privacy by leaking data to the clicked result sites.') }})</small>:
  446. </p>
  447. <div class="tab-pane">
  448. <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 %}">
  449. <input type="submit" class="btn btn-primary" value="{{ _('save') }}" />
  450. <a href="{{ url_for('index') }}"><div class="btn btn-default">{{ _('back') }}</div></a>
  451. <a href="{{ url_for('clear_cookies') }}"><div class="btn btn-default">{{ _('Reset defaults') }}</div></a>
  452. </div>
  453. </form>
  454. </div>
  455. {% endblock %}