summaryrefslogtreecommitdiff
path: root/searx/templates/oscar
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-12-22 15:51:26 +0100
committerMartin Fischer <martin@push-f.com>2022-01-03 07:01:49 +0100
commit8e9ad1ccc296c220d61f12926c94d98baa83e3ca (patch)
tree5ba40ba51b65c5fae48c4b008ebe85d0563b7466 /searx/templates/oscar
parent02e9bdf7550b5f5545bd842b24b71680960dd7a7 (diff)
downloadsearxng-8e9ad1ccc296c220d61f12926c94d98baa83e3ca.tar.gz
searxng-8e9ad1ccc296c220d61f12926c94d98baa83e3ca.zip
[enh] introduce categories_as_tabs
Previously all categories were displayed as search engine tabs. This commit changes that so that only the categories listed under categories_as_tabs in settings.yml are displayed. This lets us introduce more categories without cluttering up the UI. Categories not displayed as tabs can still be searched with !bangs.
Diffstat (limited to 'searx/templates/oscar')
-rw-r--r--searx/templates/oscar/categories.html4
-rw-r--r--searx/templates/oscar/preferences.html4
2 files changed, 4 insertions, 4 deletions
diff --git a/searx/templates/oscar/categories.html b/searx/templates/oscar/categories.html
index a5c5f61c7..39d1e1d33 100644
--- a/searx/templates/oscar/categories.html
+++ b/searx/templates/oscar/categories.html
@@ -1,11 +1,11 @@
<div id="categories">
{%- if rtl -%}
- {% for category in categories | reverse -%}
+ {% for category in categories_as_tabs | reverse -%}
<input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />{{- '' -}}
<label for="checkbox_{{ category|replace(' ', '_') }}">{{ _(category) }}</label>
{%- endfor %}
{%- else -%}
- {% for category in categories -%}
+ {% for category in categories_as_tabs -%}
<input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />{{- '' -}}
<label for="checkbox_{{ category|replace(' ', '_') }}">{{ _(category) }}</label>
{%- endfor %}
diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html
index b76ee44a1..da88cd755 100644
--- a/searx/templates/oscar/preferences.html
+++ b/searx/templates/oscar/preferences.html
@@ -298,7 +298,7 @@
<div class="tab-pane active_if_nojs" id="tab_engine">
<!-- Nav tabs -->
<ul class="nav nav-tabs nav-justified hide_if_nojs" role="tablist">
- {% for categ in all_categories %}
+ {% for categ in categories_as_tabs %}
<li{% if loop.first %} class="active"{% endif %}><a href="#tab_engine_{{ categ|replace(' ', '_') }}" role="tab" data-toggle="tab">{{ _(categ) }}</a></li>
{% endfor %}
</ul>
@@ -317,7 +317,7 @@
</p>
</div>
- {% for categ in all_categories %}
+ {% for categ in categories_as_tabs %}
<noscript><label>{{ _(categ) }}</label>
</noscript>
<div class="tab-pane{% if loop.first %} active{% endif %} active_if_nojs" id="tab_engine_{{ categ|replace(' ', '_') }}">