summaryrefslogtreecommitdiff
path: root/searx/templates
diff options
context:
space:
mode:
authorNoemi Vanyi <sitbackandwait@gmail.com>2016-08-07 23:25:27 +0200
committerNoemi Vanyi <sitbackandwait@gmail.com>2016-08-07 23:25:27 +0200
commitc59ef83353bbfb1bc084833798a6b5ff8a1ff0f6 (patch)
treee30be4085b4dcfa9e4133a61771837a97e88d670 /searx/templates
parentc553523f5b1060eb3ad5e5ae185cfc4378c2fee4 (diff)
redesign toggle button of engines && plugins
Diffstat (limited to 'searx/templates')
-rw-r--r--searx/templates/oscar/macros.html10
-rw-r--r--searx/templates/oscar/preferences.html10
2 files changed, 14 insertions, 6 deletions
diff --git a/searx/templates/oscar/macros.html b/searx/templates/oscar/macros.html
index a826b0e1e..bf51d5940 100644
--- a/searx/templates/oscar/macros.html
+++ b/searx/templates/oscar/macros.html
@@ -68,9 +68,11 @@
{%- endmacro %}
{% macro checkbox_toggle(id, blocked) -%}
- <div class="checkbox">
- <input class="hidden" type="checkbox" id="{{ id }}" name="{{ id }}"{% if blocked %} checked="checked"{% endif %} />
- <label class="btn btn-success label_hide_if_checked" for="{{ id }}">{{ _('Block') }}</label>
- <label class="btn btn-danger label_hide_if_not_checked" for="{{ id }}">{{ _('Allow') }}</label>
+ <div class="onoffswitch">
+ <input type="checkbox" id="{{ id }}" name="{{ id }}"{% if blocked %} checked="checked"{% endif %} class="onoffswitch-checkbox">
+ <label class="onoffswitch-label" for="{{ id }}">
+ <span class="onoffswitch-inner"></span>
+ <span class="onoffswitch-switch"></span>
+ </label>
</div>
{%- endmacro %}
diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html
index 89e4f499a..0e3848b7c 100644
--- a/searx/templates/oscar/preferences.html
+++ b/searx/templates/oscar/preferences.html
@@ -164,7 +164,9 @@
{% if not search_engine.private %}
<tr>
{% if not rtl %}
- <td>{{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }}</td>
+ <td class="onoff-checkbox">
+ {{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }}
+ </td>
<th>{{ search_engine.name }}</th>
<td>{{ shortcuts[search_engine.name] }}</td>
<td><input type="checkbox" {{ "checked" if search_engine.safesearch==True else ""}} readonly="readonly" disabled="disabled"></td>
@@ -176,7 +178,9 @@
<td><input type="checkbox" {{ "checked" if search_engine.safesearch==True else ""}} readonly="readonly" disabled="disabled"></td>
<td>{{ shortcuts[search_engine.name] }}</td>
<th>{{ search_engine.name }}</th>
- <td>{{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }}</td>
+ <td class="onoff-checkbox">
+ {{ checkbox_toggle('engine_' + search_engine.name|replace(' ', '_') + '__' + categ|replace(' ', '_'), (search_engine.name, categ) in disabled_engines) }}
+ </td>
{% endif %}
</tr>
{% endif %}
@@ -203,7 +207,9 @@
<div class="panel-body">
<div class="col-xs-6 col-sm-4 col-md-6">{{ _(plugin.description) }}</div>
<div class="col-xs-6 col-sm-4 col-md-6">
+ <div class="onoff-checkbox">
{{ checkbox_toggle('plugin_' + plugin.id, plugin.id not in allowed_plugins) }}
+ </div>
</div>
</div>
</div>