Browse Source

[mod] checkbox macro

Adam Tauber 10 years ago
parent
commit
359dfc5ebb
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      searx/templates/oscar/macros.html

+ 8
- 0
searx/templates/oscar/macros.html View File

@@ -59,3 +59,11 @@
59 59
     </div>
60 60
     {% endif %}
61 61
 {%- endmacro %}
62
+
63
+{% macro checkbox_toggle(id, blocked) -%}
64
+    <div class="checkbox">
65
+        <input class="hidden" type="checkbox" id="{{ id }}" name="{{ id }}"{% if blocked %} checked="checked"{% endif %} />
66
+        <label class="btn btn-success label_hide_if_checked" for="{{ id }}">{{ _('Block') }}</label>
67
+        <label class="btn btn-danger label_hide_if_not_checked" for="{{ id }}">{{ _('Allow') }}</label>
68
+    </div>
69
+{%- endmacro %}