logo

searx

My custom branche(s) on searx, a meta-search engine git clone https://hacktivis.me/git/searx.git

preferences.html (18489B)


  1. {% from 'oscar/macros.html' import preferences_item_header, preferences_item_header_rtl, preferences_item_footer, preferences_item_footer_rtl, checkbox_toggle, support_toggle %}
  2. {% extends "oscar/base.html" %}
  3. {% block title %}{{ _('preferences') }} - {% endblock %}
  4. {% block content %}
  5. <div>
  6. <h1>{{ _('Preferences') }}</h1>
  7. <form method="post" action="{{ url_for('preferences') }}" id="search_form">
  8. <!-- Nav tabs -->
  9. <ul class="nav nav-tabs nav-justified hide_if_nojs" role="tablist" style="margin-bottom:20px;">
  10. <li class="active"><a href="#tab_general" role="tab" data-toggle="tab">{{ _('General') }}</a></li>
  11. <li><a href="#tab_engine" role="tab" data-toggle="tab">{{ _('Engines') }}</a></li>
  12. <li><a href="#tab_plugins" role="tab" data-toggle="tab">{{ _('Plugins') }}</a></li>
  13. {% if answerers %}<li><a href="#tab_answerers" role="tab" data-toggle="tab">{{ _('Answerers') }}</a></li>{% endif %}
  14. <li><a href="#tab_cookies" role="tab" data-toggle="tab">{{ _('Cookies') }}</a></li>
  15. </ul>
  16. <!-- Tab panes -->
  17. <noscript>
  18. <h3>{{ _('General') }}</h3>
  19. </noscript>
  20. <div class="tab-content">
  21. <div class="tab-pane active" id="tab_general">
  22. <fieldset>
  23. <div class="container-fluid">
  24. <div class="row form-group">
  25. {% if rtl %}
  26. <div class="col-sm-11 col-md-10">
  27. {% include 'oscar/categories.html' %}
  28. </div>
  29. <label class="col-sm-3 col-md-2">{{ _('Default categories') }}</label>
  30. {% else %}
  31. <label class="col-sm-3 col-md-2">{{ _('Default categories') }}</label>
  32. <div class="col-sm-11 col-md-10 search-categories">
  33. {% include 'oscar/categories.html' %}
  34. </div>
  35. {% endif %}
  36. </div>
  37. {% set language_label = _('Search language') %}
  38. {% set language_info = _('What language do you prefer for search?') %}
  39. {{ preferences_item_header(language_info, language_label, rtl) }}
  40. {% include 'oscar/languages.html' %}
  41. {{ preferences_item_footer(language_info, language_label, rtl) }}
  42. {% set locale_label = _('Interface language') %}
  43. {% set locale_info = _('Change the language of the layout') %}
  44. {{ preferences_item_header(locale_info, locale_label, rtl) }}
  45. <select class="form-control" name='locale'>
  46. {% for locale_id,locale_name in locales.items() | sort %}
  47. <option value="{{ locale_id }}" {% if locale_id == current_locale %}selected="selected"{% endif %}>{{ locale_name }}</option>
  48. {% endfor %}
  49. </select>
  50. {{ preferences_item_footer(locale_info, locale_label, rtl) }}
  51. {% set autocomplete_label = _('Autocomplete') %}
  52. {% set autocomplete_info = _('Find stuff as you type') %}
  53. {{ preferences_item_header(autocomplete_info, autocomplete_label, rtl) }}
  54. <select class="form-control" name="autocomplete">
  55. <option value=""> - </option>
  56. {% for backend in autocomplete_backends %}
  57. <option value="{{ backend }}" {% if backend == autocomplete %}selected="selected"{% endif %}>{{ backend }}</option>
  58. {% endfor %}
  59. </select>
  60. {{ preferences_item_footer(autocomplete_info, autocomplete_label, rtl) }}
  61. {% set image_proxy_label = _('Image proxy') %}
  62. {% set image_proxy_info = _('Proxying image results through searx') %}
  63. {{ preferences_item_header(image_proxy_info, image_proxy_label, rtl) }}
  64. <select class="form-control" name='image_proxy'>
  65. <option value="1" {% if image_proxy %}selected="selected"{% endif %}>{{ _('Enabled') }}</option>
  66. <option value="" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled')}}</option>
  67. </select>
  68. {{ preferences_item_footer(image_proxy_info, image_proxy_label, rtl) }}
  69. {% set method_label = _('Method') %}
  70. {% 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>') %}
  71. {{ preferences_item_header(method_info, method_label, rtl) }}
  72. <select class="form-control" name='method'>
  73. <option value="POST" {% if method == 'POST' %}selected="selected"{% endif %}>POST</option>
  74. <option value="GET" {% if method == 'GET' %}selected="selected"{% endif %}>GET</option>
  75. </select>
  76. {{ preferences_item_footer(method_info, method_label, rtl) }}
  77. {% set safesearch_label = _('SafeSearch') %}
  78. {% set safesearch_info = _('Filter content') %}
  79. {{ preferences_item_header(safesearch_info, safesearch_label, rtl) }}
  80. <select class="form-control" name='safesearch'>
  81. <option value="2" {% if safesearch == '2' %}selected="selected"{% endif %}>{{ _('Strict') }}</option>
  82. <option value="1" {% if safesearch == '1' %}selected="selected"{% endif %}>{{ _('Moderate') }}</option>
  83. <option value="0" {% if safesearch == '0' %}selected="selected"{% endif %}>{{ _('None') }}</option>
  84. </select>
  85. {{ preferences_item_footer(safesearch_info, safesearch_label, rtl) }}
  86. {% set theme_label = _('Themes') %}
  87. {% set theme_info = _('Change searx layout') %}
  88. {{ preferences_item_header(theme_info, theme_label, rtl) }}
  89. <select class="form-control" name="theme">
  90. {% for name in themes %}
  91. <option value="{{ name }}" {% if name == theme %}selected="selected"{% endif %}>{{ name }}</option>
  92. {% endfor %}
  93. </select>
  94. {{ preferences_item_footer(theme_info, theme_label, rtl) }}
  95. {{ preferences_item_header(_('Choose style for this theme'), _('Style'), rtl) }}
  96. <select class="form-control" name='oscar-style'>
  97. <option value="logicodev" >Logicodev</option>
  98. <option value="pointhi" {% if preferences.get_value('oscar-style') == 'pointhi' %}selected="selected"{% endif %}>Pointhi</option>
  99. <option value="logicodev-dark" {% if preferences.get_value('oscar-style') == 'logicodev-dark' %}selected="selected"{% endif %}>Logicodev dark</option>
  100. </select>
  101. {{ preferences_item_footer(_('Choose style for this theme'), _('Style'), rtl) }}
  102. {% set label = _('Results on new tabs') %}
  103. {% set info = _('Open result links on new browser tabs') %}
  104. {{ preferences_item_header(info, label, rtl) }}
  105. <select class="form-control" name='results_on_new_tab'>
  106. <option value="1" {% if results_on_new_tab %}selected="selected"{% endif %}>{{ _('On') }}</option>
  107. <option value="0" {% if not results_on_new_tab %}selected="selected"{% endif %}>{{ _('Off')}}</option>
  108. </select>
  109. {{ preferences_item_footer(info, label, rtl) }}
  110. {% set label = _('Open Access DOI resolver') %}
  111. {% set info = _('Redirect to open-access versions of publications when available (plugin required)') %}
  112. {{ preferences_item_header(info, label, rtl) }}
  113. <select class="form-control" id='doi_resolver' name='doi_resolver'>
  114. {% for doi_resolver_name,doi_resolver_url in doi_resolvers.items() %}
  115. <option value="{{ doi_resolver_name }}" {% if doi_resolver_name == current_doi_resolver %}selected="selected"{% endif %}>
  116. {{ doi_resolver_name }} - {{ doi_resolver_url }}
  117. </option>
  118. {% endfor %}
  119. </select>
  120. {{ preferences_item_footer(info, label, rtl) }}
  121. </div>
  122. </fieldset>
  123. </div>
  124. <div class="tab-pane active_if_nojs" id="tab_engine">
  125. <!-- Nav tabs -->
  126. <ul class="nav nav-tabs nav-justified hide_if_nojs" role="tablist" style="margin-bottom:20px;">
  127. {% for categ in all_categories %}
  128. <li{% if loop.first %} class="active"{% endif %}><a href="#tab_engine_{{ categ|replace(' ', '_') }}" role="tab" data-toggle="tab">{{ _(categ) }}</a></li>
  129. {% endfor %}
  130. </ul>
  131. <noscript>
  132. <h3>{{ _('Engines') }}</h3>
  133. </noscript>
  134. <!-- Tab panes -->
  135. <div class="tab-content">
  136. {% for categ in all_categories %}
  137. <noscript><label>{{ _(categ) }}</label>
  138. </noscript>
  139. <div class="tab-pane{% if loop.first %} active{% endif %} active_if_nojs" id="tab_engine_{{ categ|replace(' ', '_') }}">
  140. <div class="container-fluid">
  141. <fieldset>
  142. <div class="table-responsive">
  143. <table class="table table-hover table-condensed table-striped">
  144. <tr>
  145. {% if not rtl %}
  146. <th>{{ _("Allow") }}</th>
  147. <th>{{ _("Engine name") }}</th>
  148. <th>{{ _("Shortcut") }}</th>
  149. <th>{{ _("Selected language") }}</th>
  150. <th>{{ _("SafeSearch") }}</th>
  151. <th>{{ _("Time range") }}</th>
  152. <th>{{ _("Avg. time") }}</th>
  153. <th>{{ _("Max time") }}</th>
  154. {% else %}
  155. <th>{{ _("Max time") }}</th>
  156. <th>{{ _("Avg. time") }}</th>
  157. <th>{{ _("Time range") }}</th>
  158. <th>{{ _("SafeSearch") }}</th>
  159. <th>{{ _("Selected language") }}</th>
  160. <th>{{ _("Shortcut") }}</th>
  161. <th>{{ _("Engine name") }}</th>
  162. <th>{{ _("Allow") }}</th>
  163. {% endif %}
  164. </tr>
  165. {% for search_engine in engines_by_category[categ] %}
  166. {% if not search_engine.private %}
  167. <tr>
  168. {% if not rtl %}
  169. <td class="onoff-checkbox">
  170. {{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }}
  171. </td>
  172. <th>{{ search_engine.name }}</th>
  173. <td class="name">{{ shortcuts[search_engine.name] }}</td>
  174. <td>{{ support_toggle(stats[search_engine.name].supports_selected_language) }}</td>
  175. <td>{{ support_toggle(search_engine.safesearch==True) }}</td>
  176. <td>{{ support_toggle(search_engine.time_range_support==True) }}</td>
  177. <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>
  178. <td class="{{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}">{{ search_engine.timeout }}</td>
  179. {% else %}
  180. <td class="{{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}">{{ search_engine.timeout }}</td>
  181. <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>
  182. <td>{{ support_toggle(search_engine.time_range_support==True) }}</td>
  183. <td>{{ support_toggle(search_engine.safesearch==True) }}</td>
  184. <td>{{ support_toggle(stats[search_engine.name].supports_selected_language) }}</td>
  185. <td>{{ shortcuts[search_engine.name] }}</td>
  186. <th>{{ search_engine.name }}</th>
  187. <td class="onoff-checkbox">
  188. {{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }}
  189. </td>
  190. {% endif %}
  191. </tr>
  192. {% endif %}
  193. {% endfor %}
  194. </table>
  195. </div>
  196. </fieldset>
  197. </div>
  198. </div>
  199. {% endfor %}
  200. </div>
  201. </div>
  202. <div class="tab-pane active_if_nojs" id="tab_plugins">
  203. <noscript>
  204. <h3>{{ _('Plugins') }}</h3>
  205. </noscript>
  206. <fieldset>
  207. <div class="container-fluid">
  208. {% for plugin in plugins %}
  209. <div class="panel panel-default">
  210. <div class="panel-heading">
  211. <h3 class="panel-title">{{ _(plugin.name) }}</h3>
  212. </div>
  213. <div class="panel-body">
  214. <div class="col-xs-6 col-sm-4 col-md-6">{{ _(plugin.description) }}</div>
  215. <div class="col-xs-6 col-sm-4 col-md-6">
  216. <div class="onoff-checkbox">
  217. {{ checkbox_toggle('plugin_' + plugin.id, plugin.id not in allowed_plugins) }}
  218. </div>
  219. </div>
  220. </div>
  221. </div>
  222. {% endfor %}
  223. </div>
  224. </fieldset>
  225. </div>
  226. {% if answerers %}
  227. <div class="tab-pane active_if_nojs" id="tab_answerers">
  228. <noscript>
  229. <h3>{{ _('Answerers') }}</h3>
  230. </noscript>
  231. <p class="text-muted" style="margin:20px 0;">
  232. {{ _('This is the list of searx\'s instant answering modules.') }}
  233. </p>
  234. <table class="table table-striped">
  235. <tr>
  236. <th class="text-muted">{{ _('Name') }}</th>
  237. <th class="text-muted">{{ _('Keywords') }}</th>
  238. <th class="text-muted">{{ _('Description') }}</th>
  239. <th class="text-muted">{{ _('Examples') }}</th>
  240. </tr>
  241. {% for answerer in answerers %}
  242. <tr>
  243. <td class="text-muted">{{ answerer.info.name }}</td>
  244. <td class="text-muted">{{ answerer.keywords|join(', ') }}</td>
  245. <td class="text-muted">{{ answerer.info.description }}</td>
  246. <td class="text-muted">{{ answerer.info.examples|join(', ') }}</td>
  247. </tr>
  248. {% endfor %}
  249. </table>
  250. </div>
  251. {% endif %}
  252. <div class="tab-pane active_if_nojs" id="tab_cookies">
  253. <noscript>
  254. <h3>{{ _('Cookies') }}</h3>
  255. </noscript>
  256. <p class="text-muted" style="margin:20px 0;">
  257. {{ _('This is the list of cookies and their values searx is storing on your computer.') }}<br />
  258. {{ _('With that list, you can assess searx transparency.') }}<br />
  259. </p>
  260. {% if cookies %}
  261. <table class="table table-striped">
  262. <tr>
  263. <th class="text-muted" style="padding-right:40px;">{{ _('Cookie name') }}</th>
  264. <th class="text-muted">{{ _('Value') }}</th>
  265. </tr>
  266. {% for cookie in cookies %}
  267. <tr>
  268. <td class="text-muted" style="padding-right:40px;">{{ cookie }}</td>
  269. <td class="text-muted">{{ cookies[cookie] }}</td>
  270. </tr>
  271. {% endfor %}
  272. </table>
  273. {% else %}
  274. {% include 'oscar/messages/no_cookies.html' %}
  275. {% endif %}
  276. </div>
  277. </div>
  278. <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.') }}
  279. <br />
  280. {{ _("These cookies serve your sole convenience, we don't use these cookies to track you.") }}
  281. </p>
  282. <p style="margin:20px 0;">{{ _('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>:<br/>
  283. <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 %}">
  284. </p>
  285. <input type="submit" class="btn btn-primary" value="{{ _('save') }}" />
  286. <a href="{{ url_for('index') }}"><div class="btn btn-default">{{ _('back') }}</div></a>
  287. <a href="{{ url_for('clear_cookies') }}"><div class="btn btn-default">{{ _('Reset defaults') }}</div></a>
  288. </form>
  289. </div>
  290. {% endblock %}