preferences.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. {% extends "legacy/base.html" %}
  2. {% block head %} {% endblock %}
  3. {% block content %}
  4. <div class="row">
  5. <h2>{{ _('Preferences') }}</h2>
  6. <form method="post" action="{{ url_for('preferences') }}" id="search_form">
  7. <fieldset>
  8. <legend>{{ _('Default categories') }}</legend>
  9. {% set display_tooltip = false %}
  10. {% include 'legacy/categories.html' %}
  11. </fieldset>
  12. {% if 'language' not in locked_preferences %}
  13. <fieldset>
  14. <legend>{{ _('Search language') }}</legend>
  15. <p>
  16. <select name='language'>
  17. <option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Default language') }}</option>
  18. {% for lang_id,lang_name,country_name,english_name in language_codes | sort(attribute=1) %}
  19. <option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>{{ lang_name }} {% if country_name %}({{ country_name }}) {% endif %}- {{ lang_id }}</option>
  20. {% endfor %}
  21. </select>
  22. </p>
  23. </fieldset>
  24. {% endif %}
  25. {% if 'locale' not in locked_preferences %}
  26. <fieldset>
  27. <legend>{{ _('Interface language') }}</legend>
  28. <p>
  29. <select name='locale'>
  30. {% for locale_id,locale_name in locales.items() | sort %}
  31. <option value="{{ locale_id }}" {% if locale_id == current_locale %}selected="selected"{% endif %}>{{ locale_name }}</option>
  32. {% endfor %}
  33. </select>
  34. </p>
  35. </fieldset>
  36. {% endif %}
  37. {% if 'autocomplete' not in locked_preferences %}
  38. <fieldset>
  39. <legend>{{ _('Autocomplete') }}</legend>
  40. <p>
  41. <select name="autocomplete">
  42. <option value=""> - </option>
  43. {% for backend in autocomplete_backends %}
  44. <option value="{{ backend }}" {% if backend == autocomplete %}selected="selected"{% endif %}>{{ backend }}</option>
  45. {% endfor %}
  46. </select>
  47. </p>
  48. </fieldset>
  49. {% endif %}
  50. {% if 'image_proxy' not in locked_preferences %}
  51. <fieldset>
  52. <legend>{{ _('Image proxy') }}</legend>
  53. <p>
  54. <select name='image_proxy'>
  55. <option value="1" {% if image_proxy %}selected="selected"{% endif %}>{{ _('Enabled') }}</option>
  56. <option value="" {% if not image_proxy %}selected="selected"{% endif %}>{{ _('Disabled') }}</option>
  57. </select>
  58. </p>
  59. </fieldset>
  60. {% endif %}
  61. {% if 'method' not in locked_preferences %}
  62. <fieldset>
  63. <legend>{{ _('Method') }}</legend>
  64. <p>
  65. <select name='method'>
  66. <option value="POST" {% if method == 'POST' %}selected="selected"{% endif %}>POST</option>
  67. <option value="GET" {% if method == 'GET' %}selected="selected"{% endif %}>GET</option>
  68. </select>
  69. </p>
  70. </fieldset>
  71. {% endif %}
  72. {% if 'safesearch' not in locked_preferences %}
  73. <fieldset>
  74. <legend>{{ _('SafeSearch') }}</legend>
  75. <p>
  76. <select name='safesearch'>
  77. <option value="2" {% if safesearch == '2' %}selected="selected"{% endif %}>{{ _('Strict') }}</option>
  78. <option value="1" {% if safesearch == '1' %}selected="selected"{% endif %}>{{ _('Moderate') }}</option>
  79. <option value="0" {% if safesearch == '0' %}selected="selected"{% endif %}>{{ _('None') }}</option>
  80. </select>
  81. </p>
  82. </fieldset>
  83. {% endif %}
  84. {% if 'theme' not in locked_preferences %}
  85. <fieldset>
  86. <legend>{{ _('Themes') }}</legend>
  87. <p>
  88. <select name="theme">
  89. {% for name in themes %}
  90. <option value="{{ name }}" {% if name == theme %}selected="selected"{% endif %}>{{ name }}</option>
  91. {% endfor %}
  92. </select>
  93. </p>
  94. </fieldset>
  95. {% endif %}
  96. {% if 'results_on_new_tab' not in locked_preferences %}
  97. <fieldset>
  98. <legend>{{ _('Results on new tabs') }}</legend>
  99. <p>
  100. <select name='results_on_new_tab'>
  101. <option value="1" {% if results_on_new_tab %}selected="selected"{% endif %}>{{ _('On') }}</option>
  102. <option value="0" {% if not results_on_new_tab %}selected="selected"{% endif %}>{{ _('Off')}}</option>
  103. </select>
  104. </p>
  105. </fieldset>
  106. {% endif %}
  107. <fieldset>
  108. <legend>{{ _('Currently used search engines') }}</legend>
  109. <table>
  110. <tr>
  111. <th>{{ _('Engine name') }}</th>
  112. <th>{{ _('Shortcut') }}</th>
  113. <th>{{ _('Category') }}</th>
  114. <th>{{ _('Allow') }} / {{ _('Block') }}</th>
  115. </tr>
  116. {% for categ in all_categories %}
  117. {% for search_engine in engines_by_category[categ] %}
  118. {% if not search_engine.private %}
  119. <tr>
  120. <td>{{ search_engine.name }}</td>
  121. <td>{{ shortcuts[search_engine.name] }}</td>
  122. <td>{{ _(categ) }}</td>
  123. <td class="engine_checkbox">
  124. <input type="checkbox" id="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}" name="engine_{{ search_engine.name }}__{{ categ }}"{% if (search_engine.name, categ) in disabled_engines %} checked="checked"{% endif %} />
  125. <label class="allow" for="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}">{{ _('Allow') }}</label>
  126. <label class="deny" for="engine_{{ categ|replace(' ', '_') }}_{{ search_engine.name|replace(' ', '_') }}">{{ _('Block') }}</label>
  127. </td>
  128. </tr>
  129. {% endif %}
  130. {% endfor %}
  131. {% endfor %}
  132. </table>
  133. </fieldset>
  134. <p class="small_font">{{ _('These settings are stored in your cookies, this allows us not to store this data about you.') }}
  135. <br />
  136. {{ _("These cookies serve your sole convenience, we don't use these cookies to track you.") }}
  137. </p>
  138. <input type="submit" value="{{ _('save') }}" />
  139. <div class="{% if rtl %}left{% else %}right{% endif %} preferences_back"><a href="{{ url_for('clear_cookies') }}">{{ _('Reset defaults') }}</a></div>
  140. <div class="{% if rtl %}left{% else %}right{% endif %} preferences_back"><a href="{{ url_for('index') }}">{{ _('back') }}</a></div>
  141. </form>
  142. </div>
  143. {% endblock %}