mirror of https://github.com/searxng/searxng
[enh] add nojs support into oscar-template
parent
410dbc573b
commit
5bfaabeb6b
@ -1,9 +1,9 @@
|
|||||||
// Hide element if checkbox is checked
|
// Hide element if checkbox is checked
|
||||||
input[type=checkbox]:checked ~ .label_hide_if_checked {
|
input[type=checkbox]:checked + .label_hide_if_checked, input[type=checkbox]:checked + .label_hide_if_not_checked + .label_hide_if_checked {
|
||||||
display:none;
|
display:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hide element if checkbox is not checked
|
// Hide element if checkbox is not checked
|
||||||
input[type=checkbox]:not(:checked) ~ .label_hide_if_not_checked {
|
input[type=checkbox]:not(:checked) + .label_hide_if_not_checked, input[type=checkbox]:not(:checked) + .label_hide_if_checked + .label_hide_if_not_checked {
|
||||||
display:none;
|
display:none;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,22 @@
|
|||||||
<div id="categories" class="btn-group btn-toggle" data-toggle="buttons">
|
<!-- used if scripts are disabled -->
|
||||||
|
<noscript>
|
||||||
|
<div id="categories" class="btn-group btn-toggle">
|
||||||
|
{% for category in categories %}
|
||||||
|
<!--<div class="checkbox">-->
|
||||||
|
<input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}_nojs" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />
|
||||||
|
<label class="btn btn-sm btn-primary active label_hide_if_not_checked" for="checkbox_{{ category|replace(' ', '_') }}_nojs">{{ _(category) }}</label>
|
||||||
|
<label class="btn btn-sm btn-default label_hide_if_checked" for="checkbox_{{ category|replace(' ', '_') }}_nojs">{{ _(category) }}</label>
|
||||||
|
<!--</div>-->
|
||||||
|
{% if category in selected_categories %}<input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}_dis_activation" name="category_{{ category }}" value="off" checked="checked"/>{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</noscript>
|
||||||
|
|
||||||
|
<div id="categories" class="btn-group btn-toggle hide_if_nojs" data-toggle="buttons">
|
||||||
{% for category in categories %}
|
{% for category in categories %}
|
||||||
<label class="btn btn-sm {% if category in selected_categories %}btn-primary active{% else %}btn-default{% endif %}" data-btn-class="primary">
|
<label class="btn btn-sm {% if category in selected_categories %}btn-primary active{% else %}btn-default{% endif %}" data-btn-class="primary">
|
||||||
<input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />{{ _(category) }}</label>
|
<input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />{{ _(category) }}</label>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue