logo

searx

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

preferences.html (9711B)


  1. {% from 'simple/macros.html' import tabs_open, tabs_close, tab_header, tab_footer, checkbox_onoff, checkbox %}
  2. {% extends "simple/base.html" %}
  3. {%- macro plugin_preferences(section) -%}
  4. {%- for plugin in plugins -%}
  5. {%- if plugin.preference_section == section -%}
  6. <fieldset>{{- '' -}}
  7. <legend>{{ _(plugin.name) }}</legend>{{- '' -}}
  8. <div class="value">
  9. {{- checkbox_onoff('plugin_' + plugin.id, plugin.id not in allowed_plugins) -}}
  10. </div>{{- '' -}}
  11. <div class="description">
  12. {{- _(plugin.description) -}}
  13. </div>{{- '' -}}
  14. </fieldset>
  15. {%- endif -%}
  16. {%- endfor -%}
  17. {%- endmacro -%}
  18. {% block head %} {% endblock %}
  19. {% block content %}
  20. <a href="{{ url_for('index') }}"><h1><span>searx</span></h1></a>
  21. <h2>{{ _('Preferences') }}</h2>
  22. <form id="search_form" method="post" action="{{ url_for('preferences') }}">
  23. {{ tabs_open() }}
  24. {{ tab_header('maintab', 'general', _('General')) }}
  25. <fieldset>
  26. <legend>{{ _('Default categories') }}</legend>
  27. {% set display_tooltip = false %}
  28. {% include 'simple/categories.html' %}
  29. </fieldset>
  30. <fieldset>
  31. <legend>{{ _('Search language') }}</legend>
  32. <p class="value">{{- '' -}}
  33. <select name='language'>{{- '' -}}
  34. <option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Default language') }}</option>
  35. {%- for lang_id,lang_name,country_name,english_name in language_codes | sort(attribute=1) -%}
  36. <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>{{ lang_name }} {% if country_name %}({{ country_name }}) {% endif %}- {{ lang_id }}</option>
  37. {%- endfor -%}
  38. </select>{{- '' -}}
  39. </p>
  40. <div class="description">{{ _('What language do you prefer for search?') }}</div>
  41. </fieldset>
  42. <fieldset>
  43. <legend>{{ _('Autocomplete') }}</legend>
  44. <p class="value">
  45. <select name="autocomplete">
  46. <option value=""> - </option>
  47. {%- for backend in autocomplete_backends -%}
  48. <option value="{{ backend }}" {% if backend == autocomplete %}selected="selected"{% endif %}>{{ backend }}</option>
  49. {%- endfor -%}
  50. </select>
  51. </p>
  52. <div class="description">{{ _('Find stuff as you type') }}</div>
  53. </fieldset>
  54. <fieldset>
  55. <legend>{{ _('SafeSearch') }}</legend>
  56. <p class="value">
  57. <select name='safesearch'>
  58. <option value="2" {% if safesearch == '2' %}selected="selected"{% endif %}>{{ _('Strict') }}</option>
  59. <option value="1" {% if safesearch == '1' %}selected="selected"{% endif %}>{{ _('Moderate') }}</option>
  60. <option value="0" {% if safesearch == '0' %}selected="selected"{% endif %}>{{ _('None') }}</option>
  61. </select>
  62. </p>
  63. <div class="description">{{ _('Filter content') }}</p>
  64. </fieldset>
  65. {{ plugin_preferences('general') }}
  66. <fieldset>
  67. <legend>{{ _('Open Access DOI resolver') }}</legend>
  68. <p class="value">
  69. <select id='doi_resolver' name='doi_resolver'>
  70. {%- for doi_resolver_name,doi_resolver_url in doi_resolvers.items() -%}
  71. <option value="{{ doi_resolver_name }}" {% if doi_resolver_name == current_doi_resolver %}selected="selected"{% endif %}>
  72. {{- doi_resolver_name }} - {{ doi_resolver_url -}}
  73. </option>
  74. {%- endfor -%}
  75. </select>
  76. </p>
  77. <div class="description"><!-- {{ _('Redirect to open-access versions of publications when available (plugin required)') }} --></div>
  78. </fieldset>
  79. {{ tab_footer() }}
  80. {{ tab_header('maintab', 'engines', _('Engines')) }}
  81. <p>{{ _('Currently used search engines') }}</p>
  82. {{ tabs_open() }}
  83. {% for categ in all_categories %}
  84. {{ tab_header('enginetab', 'category' + categ, _(categ)) }}
  85. <div class="scrollx">
  86. <table class="striped">
  87. <tr>
  88. <th class="engine_checkbox">{{ _("Allow") }}</th>
  89. <th class="name">{{ _("Engine name") }}</th>
  90. <th class="shortcut">{{ _("Shortcut") }}</th>
  91. <th>{{ _("Supports selected language") }}</th>
  92. <th>{{ _("SafeSearch") }}</th>
  93. <th>{{ _("Time range") }}</th>
  94. <th>{{ _("Avg. time") }}</th>
  95. <th>{{ _("Max time") }}</th>
  96. </tr>
  97. {% for search_engine in engines_by_category[categ] %}
  98. {% if not search_engine.private %}
  99. {% set engine_id = 'engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_') %}
  100. <tr>
  101. <td class="engine_checkbox">{{ checkbox_onoff(engine_id, (search_engine.name, categ) in disabled_engines) }}</td>
  102. <th class="name">{{ search_engine.name }}</th>
  103. <td class="shortcut">{{ shortcuts[search_engine.name] }}</td>
  104. <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>
  105. <td>{{ checkbox(engine_id + '_safesearch', search_engine.safesearch==True, true, true) }}</td>
  106. <td>{{ checkbox(engine_id + '_time_range_support', search_engine.time_range_support==True, true, true) }}</td>
  107. <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>
  108. <td class="{{ 'danger' if stats[search_engine.name]['warn_timeout'] else '' }}">{{ search_engine.timeout }}</td>
  109. </tr>
  110. {% endif %}
  111. {% endfor %}
  112. </table>
  113. <div>
  114. {{ tab_footer() }}
  115. {% endfor %}
  116. {{ tabs_close() }}
  117. {{ tab_footer() }}
  118. {{ tab_header('maintab', 'ui', _('User interface')) }}
  119. <fieldset>
  120. <legend>{{ _('Interface language') }}</legend>
  121. <p class="value">
  122. <select name='locale'>
  123. {% for locale_id,locale_name in locales.items() | sort %}
  124. <option value="{{ locale_id }}" {% if locale_id == current_locale %}selected="selected"{% endif %}>{{ locale_name }}</option>
  125. {% endfor %}
  126. </select>
  127. </p>
  128. <div class="description">{{ _('Change the language of the layout') }}</div>
  129. </fieldset>
  130. <fieldset>
  131. <legend>{{ _('Themes') }}</legend>
  132. <p class="value">
  133. <select name="theme">
  134. {%- for name in themes -%}
  135. <option value="{{ name }}" {% if name == theme %}selected="selected"{% endif %}>{{ name }}</option>
  136. {%- endfor -%}
  137. </select>
  138. </p>
  139. <div class="description">{{ _('Change searx layout') }}</div>
  140. </fieldset>
  141. <fieldset>
  142. <legend>{{ _('Results on new tabs') }}</legend>
  143. <p class="value">
  144. <select name='results_on_new_tab'>
  145. <option value="1" {% if results_on_new_tab %}selected="selected"{% endif %}>{{ _('On') }}</option>
  146. <option value="0" {% if not results_on_new_tab %}selected="selected"{% endif %}>{{ _('Off')}}</option>
  147. </select>
  148. </p>
  149. <div class="description">{{_('Open result links on new browser tabs') }}</div>
  150. </fieldset>
  151. {{ plugin_preferences('ui') }}
  152. {{ tab_footer() }}
  153. {{ tab_header('maintab', 'cookies', _('Cookies')) }}
  154. <p class="text-muted" style="margin:20px 0;">
  155. {{ _('This is the list of cookies and their values searx is storing on your computer.') }}<br />
  156. {{ _('With that list, you can assess searx transparency.') }}<br />
  157. </p>
  158. {% if cookies %}
  159. <table class="cookies">
  160. <tr>
  161. <th>{{ _('Cookie name') }}</th>
  162. <th>{{ _('Value') }}</th>
  163. </tr>
  164. {% for cookie in cookies %}
  165. <tr>
  166. <td>{{ cookie }}</td>
  167. <td>{{ cookies[cookie] }}</td>
  168. </tr>
  169. {% endfor %}
  170. </table>
  171. {% else %}
  172. {% include 'oscar/messages/no_cookies.html' %}
  173. {% endif %}
  174. <h4>{{ _('Search URL of the currently saved preferences') }} :</h4>
  175. <div class="selectable_url">
  176. <pre>{{ url_for('index', _external=True) }}?preferences={{ preferences_url_params|e }}{% raw %}&amp;q=%s{% endraw %}</pre>
  177. </div>
  178. <p class="small_font">{{ _('Note: specifying custom settings in the search URL can reduce privacy by leaking data to the clicked result sites.') }}</p>
  179. {{ tab_footer() }}
  180. {{ tab_header('maintab', 'privacy', _('Privacy')) }}
  181. <fieldset>
  182. <legend>{{ _('Method') }}</legend>
  183. <p class="value">
  184. <select name='method'>
  185. <option value="POST" {% if method == 'POST' %}selected="selected"{% endif %}>POST</option>
  186. <option value="GET" {% if method == 'GET' %}selected="selected"{% endif %}>GET</option>
  187. </select>
  188. </p>
  189. <div class="description">{{ _('Search language') }}</div>
  190. </fieldset>
  191. <fieldset>
  192. <legend>{{ _('Image proxy') }}</legend>
  193. <p class="value">
  194. <select name='image_proxy'>
  195. <option value="1" {% if image_proxy %}selected="selected"{% endif %}>{{ _('Enabled') }}</option>
  196. <option value="" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled') }}</option>
  197. </select>
  198. </p>
  199. <div class="description">{{ _('Proxying image results through searx') }}</div>
  200. </fieldset>
  201. {{ plugin_preferences('privacy') }}
  202. {{ tab_footer() }}
  203. {{ tabs_close() }}
  204. <p class="small_font">{{ _('These settings are stored in your cookies, this allows us not to store this data about you.') }}
  205. <br />
  206. {{ _("These cookies serve your sole convenience, we don't use these cookies to track you.") }}
  207. </p>
  208. <input type="submit" value="{{ _('save') }}" />
  209. <div class="{% if rtl %}left{% else %}right{% endif %} preferences_back"><a href="{{ url_for('clear_cookies') }}">{{ _('Reset defaults') }}</a></div>
  210. <div class="{% if rtl %}left{% else %}right{% endif %} preferences_back"><a href="{{ url_for('index') }}">{{ _('back') }}</a></div>
  211. </form>
  212. {% endblock %}