preferences.html 7.2 KB

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