mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
[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.
This commit is contained in:
parent
02e9bdf755
commit
8e9ad1ccc2
12 changed files with 82 additions and 29 deletions
|
|
@ -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 %}
|
||||
|
|
|
|||
|
|
@ -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(' ', '_') }}">
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<div id="categories" class="search_categories">{{- '' -}}
|
||||
<div id="categories_container">
|
||||
{%- if display_tooltip %}<div class="help">{{ _('Click on the magnifier to perform search') }}</div>{% endif -%}
|
||||
{%- for category in categories -%}
|
||||
{%- for category in categories_as_tabs -%}
|
||||
<div class="category"><input type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}"{% if category in selected_categories %} checked="checked"{% endif %}/>
|
||||
<label for="checkbox_{{ category|replace(' ', '_') }}" class="tooltips">
|
||||
{{- icon_big(category_icons[category]) if category in category_icons else icon_big('globe-outline') -}}
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@
|
|||
{{ tab_header('maintab', 'engines', _('Engines')) }}
|
||||
<p>{{ _('Currently used search engines') }}</p>
|
||||
{{ tabs_open() }}
|
||||
{% for categ in all_categories %}
|
||||
{% for categ in categories_as_tabs %}
|
||||
{{ tab_header('enginetab', 'category' + categ, _(categ)) }}
|
||||
<div class="scrollx">
|
||||
<table class="striped">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue