forked from Icycoide/searxng
[simple theme] rework select; add safesearch to search and replace / with › in article url
* rework selection UI in pref (fix based on: 78643e9f43
)
* moved search filters underneath categories
* cut params from url and replace / with ›
* make h3 and url in article bigger
* add safe search select to search filter (this will not override settings and only be valid while on result page in a session)
* make search form button not overlap each other when js is disabled
* 1rem padding around preview image and thumbnail in default article template
This commit is contained in:
parent
02cccdf876
commit
f3aff26086
15 changed files with 153 additions and 81 deletions
|
@ -13,6 +13,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 -%}
|
||||
<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">
|
||||
|
@ -21,6 +22,5 @@
|
|||
</label>
|
||||
</div>
|
||||
{%- endfor -%}
|
||||
{%- if display_tooltip %}<div class="help">{{ _('Click on the magnifier to perform search') }}</div>{% endif -%}
|
||||
</div>{{- '' -}}
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<select class="language" id="language" name="language" tabindex="2">{{- '' -}}
|
||||
<select class="language" id="language" name="language" tabindex="1">{{- '' -}}
|
||||
<option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Default language') }}</option>
|
||||
{%- for lang_id,lang_name,country_name,english_name in language_codes | sort(attribute=1) -%}
|
||||
<option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>
|
5
searx/templates/simple/filters/safesearch.html
Normal file
5
searx/templates/simple/filters/safesearch.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
<select name="safesearch" id="safesearch" class="safesearch" tabindex="3">
|
||||
<option value="2" {% if safesearch == '2' %}selected="selected"{% endif %}>{{ _("SafeSearch") + ": " + _('Strict') }}</option>
|
||||
<option value="1" {% if safesearch == '1' %}selected="selected"{% endif %}>{{ _("SafeSearch") + ": " + _('Moderate') }}</option>
|
||||
<option value="0" {% if safesearch == '0' %}selected="selected"{% endif %}>{{ _("SafeSearch") + ": " + _('None') }}</option>
|
||||
</select>
|
|
@ -1,4 +1,4 @@
|
|||
<select name="time_range" id="time_range" class="time_range" tabindex="3">{{- '' -}}
|
||||
<select name="time_range" id="time_range" class="time_range" tabindex="2">{{- '' -}}
|
||||
<option id="time-range-anytime" value="" {{ "selected" if time_range=="" or not time_range else ""}}>
|
||||
{{- _('Anytime') -}}
|
||||
</option>{{- '' -}}
|
|
@ -18,7 +18,11 @@
|
|||
<!-- Draw result header -->
|
||||
{% macro result_header(result, favicons, image_proxify) -%}
|
||||
<article class="result {% if result['template'] %}result-{{ result.template|replace('.html', '') }}{% else %}result-default{% endif %} {% if result['category'] %}category-{{ result['category'] }}{% endif %}{% for e in result.engines %} {{ e }}{% endfor %}">
|
||||
<p class="url">{{ result_link(result.url, result.pretty_url, 'url') }}</p>
|
||||
{{- result_open_link(result.url, "url_wrapper") -}}
|
||||
{%- for part in get_pretty_url(result.parsed_url) -%}
|
||||
<span class="url_o{{loop.index}}"><span class="url_i{{loop.index}}">{{- part -}}</span></span>
|
||||
{%- endfor %}
|
||||
{{- result_close_link() -}}
|
||||
{%- if result.img_src %}{{ result_open_link(result.url) }}<img class="image" src="{{ image_proxify(result.img_src) }}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" class="image" />{{ result_close_link() }}{% endif -%}
|
||||
{%- if result.thumbnail %}{{ result_open_link(result.url) }}<img class="thumbnail" src="{{ image_proxify(result.thumbnail) }}" title="{{ result.title|striptags }}" alt="{{ result.title|striptags }}"/>{{ result_close_link() }}{% endif -%}
|
||||
<h3>{{ result_link(result.url, result.title|safe) }}</h3>
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
<form id="search" method="{{ method or 'POST' }}" action="{{ url_for('search') }}">
|
||||
<a id="search_logo" href="{{ url_for('index') }}">
|
||||
<span hidden>SearXNG</span>
|
||||
{% include '__common__/searxng-wordmark.min.svg' without context %}
|
||||
</a>
|
||||
<div id="search_wrapper">
|
||||
<div id="search_header">
|
||||
<a id="search_logo" href="{{ url_for('index') }}">
|
||||
<span hidden>SearXNG</span>
|
||||
{% include '__common__/searxng-wordmark.min.svg' without context %}
|
||||
</a>
|
||||
<div class="search_box">
|
||||
<input id="q" autofocus name="q" type="text" placeholder="{{ _('Search for...') }}" tabindex="1" autocomplete="off" spellcheck="false" dir="auto" {% if q %}value="{{ q }}"{% endif %} >
|
||||
<button id="clear_search" type="button" tabindex="-1"><span class="hide_if_nojs">{{ icon_big('close') }}</span><span class="show_if_nojs">{{ _('Clear search') }}</span></button>
|
||||
<button id="send_search" type="submit" tabindex="-1"><span class="hide_if_nojs">{{ icon_big('search-outline') }}</span><span class="show_if_nojs">{{ _('Start search') }}</span></button>
|
||||
</div>
|
||||
<div class="search_filters">
|
||||
{% include 'simple/languages.html' %}
|
||||
{% include 'simple/time-range.html' %}
|
||||
<button id="clear_search" type="button" tabindex="-1"><span class="hide_if_nojs">{{ icon_big('close') }}</span><span class="show_if_nojs">{{ _('clear') }}</span></button>
|
||||
<button id="send_search" type="submit" tabindex="-1"><span class="hide_if_nojs">{{ icon_big('search-outline') }}</span><span class="show_if_nojs">{{ _('search') }}</span></button>
|
||||
</div>
|
||||
{% set display_tooltip = true %}
|
||||
{% include 'simple/categories.html' %}
|
||||
</div>
|
||||
<div class="search_filters">
|
||||
{% include 'simple/filters/languages.html' %}
|
||||
{% include 'simple/filters/time_range.html' %}
|
||||
{% include 'simple/filters/safesearch.html' %}
|
||||
</div>
|
||||
{% set display_tooltip = true %}
|
||||
{% include 'simple/categories.html' %}
|
||||
<input type="hidden" name="safesearch" value="{{ safesearch }}" >
|
||||
<input type="hidden" name="theme" value="{{ theme }}" >
|
||||
{% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %}
|
||||
</form>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<form id="search" method="{{ method or 'POST' }}" action="{{ url_for('search') }}">
|
||||
<div id="search_wrapper">
|
||||
<div id="search_header">
|
||||
<div class="search_box">
|
||||
<input id="q" autofocus name="q" type="text" placeholder="{{ _('Search for...') }}" tabindex="1" autocomplete="off" spellcheck="false" dir="auto" {% if q %}value="{{ q }}"{% endif %} >
|
||||
<button id="clear_search" type="button" tabindex="-1"><span class="hide_if_nojs">{{ icon_big('close') }}</span><span class="show_if_nojs">{{ _('Clear search') }}</span></button>
|
||||
<button id="send_search" type="submit" tabindex="-1"><span class="hide_if_nojs">{{ icon_big('search-outline') }}</span><span class="show_if_nojs">{{ _('Start search') }}</span></button>
|
||||
<button id="clear_search" type="button" tabindex="-1"><span class="hide_if_nojs">{{ icon_big('close') }}</span><span class="show_if_nojs">{{ _('clear') }}</span></button>
|
||||
<button id="send_search" type="submit" tabindex="-1"><span class="hide_if_nojs">{{ icon_big('search-outline') }}</span><span class="show_if_nojs">{{ _('search') }}</span></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue