diff options
| author | Thomas Pointhuber <thomas.pointhuber@gmx.at> | 2015-01-15 15:48:50 +0100 |
|---|---|---|
| committer | Thomas Pointhuber <thomas.pointhuber@gmx.at> | 2015-01-15 15:48:50 +0100 |
| commit | 5bfaabeb6bb50844fd7389770eb5c8a64e63f13e (patch) | |
| tree | ec45932ffb7ca7e3d746d94795e029a9e9bd4a20 /searx/templates | |
| parent | 410dbc573bbb873a447710e122faefd11075b6df (diff) | |
[enh] add nojs support into oscar-template
Diffstat (limited to 'searx/templates')
| -rw-r--r-- | searx/templates/oscar/base.html | 3 | ||||
| -rw-r--r-- | searx/templates/oscar/categories.html | 18 | ||||
| -rw-r--r-- | searx/templates/oscar/search_full.html | 4 |
3 files changed, 21 insertions, 4 deletions
diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.html index 466756b6f..c0393a66d 100644 --- a/searx/templates/oscar/base.html +++ b/searx/templates/oscar/base.html @@ -36,7 +36,8 @@ </script> <noscript> <style type="text/css"> - .tab-content > .active_if_nojs {display: block;} + .tab-content > .active_if_nojs, .active_if_nojs {display: block;} + .margin_top_if_nojs {margin-top: 20px;} .hide_if_nojs {display: none !important;overflow:none !important;} </style> </noscript> diff --git a/searx/templates/oscar/categories.html b/searx/templates/oscar/categories.html index 82ddcf686..f38cce5bd 100644 --- a/searx/templates/oscar/categories.html +++ b/searx/templates/oscar/categories.html @@ -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 %} <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> {% endfor %} </div> + + diff --git a/searx/templates/oscar/search_full.html b/searx/templates/oscar/search_full.html index 673f23969..5818286ec 100644 --- a/searx/templates/oscar/search_full.html +++ b/searx/templates/oscar/search_full.html @@ -8,8 +8,8 @@ </span>
</div>
- <button type="button" class="btn btn-link btn-collapse center-block collapsed" data-toggle="collapse" data-target="#search_categories" data-btn-text-collapsed="{{ _('Show search filters') }}" data-btn-text-not-collapsed="{{ _('Hide search filters') }}">{{ _('Show search filters') }}</button>
- <div class="row collapse" id="search_categories">
+ <button type="button" class="btn btn-link btn-collapse center-block collapsed hide_if_nojs" data-toggle="collapse" data-target="#search_categories" data-btn-text-collapsed="{{ _('Show search filters') }}" data-btn-text-not-collapsed="{{ _('Hide search filters') }}">{{ _('Show search filters') }}</button>
+ <div class="row collapse active_if_nojs margin_top_if_nojs" id="search_categories">
<div class="col-md-12 text-center">
{% include 'oscar/categories.html' %}
</div>
|