preferences.html 12KB

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