diff options
author | mrpaulblack <paul@paulgo.io> | 2021-11-21 21:38:00 +0100 |
---|---|---|
committer | mrpaulblack <paul@paulgo.io> | 2021-11-21 21:38:00 +0100 |
commit | f3aff26086dda1c2610c9aa845db119ad413006f (patch) | |
tree | 7e312aafdb1831b46a709089fd3f7875d1b7cd6b /searx/templates | |
parent | 02cccdf876f2e0b07ef488e6033a858113dc3f1c (diff) | |
download | searxng-f3aff26086dda1c2610c9aa845db119ad413006f.tar.gz searxng-f3aff26086dda1c2610c9aa845db119ad413006f.zip |
[simple theme] rework select; add safesearch to search and replace / with › in article url
* rework selection UI in pref (fix based on: https://github.com/twelsby/searx/commit/78643e9f43a103c523f112e9f3ce26a5c7bb3a0f)
* 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
Diffstat (limited to 'searx/templates')
-rw-r--r-- | searx/templates/simple/categories.html | 2 | ||||
-rw-r--r-- | searx/templates/simple/filters/languages.html (renamed from searx/templates/simple/languages.html) | 2 | ||||
-rw-r--r-- | searx/templates/simple/filters/safesearch.html | 5 | ||||
-rw-r--r-- | searx/templates/simple/filters/time_range.html (renamed from searx/templates/simple/time-range.html) | 2 | ||||
-rw-r--r-- | searx/templates/simple/macros.html | 6 | ||||
-rw-r--r-- | searx/templates/simple/search.html | 28 | ||||
-rw-r--r-- | searx/templates/simple/simple_search.html | 6 |
7 files changed, 30 insertions, 21 deletions
diff --git a/searx/templates/simple/categories.html b/searx/templates/simple/categories.html index 29616f127..ae8b2ec09 100644 --- a/searx/templates/simple/categories.html +++ b/searx/templates/simple/categories.html @@ -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> diff --git a/searx/templates/simple/languages.html b/searx/templates/simple/filters/languages.html index dd928ff68..710c18c92 100644 --- a/searx/templates/simple/languages.html +++ b/searx/templates/simple/filters/languages.html @@ -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 %}> diff --git a/searx/templates/simple/filters/safesearch.html b/searx/templates/simple/filters/safesearch.html new file mode 100644 index 000000000..a146e6710 --- /dev/null +++ b/searx/templates/simple/filters/safesearch.html @@ -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> diff --git a/searx/templates/simple/time-range.html b/searx/templates/simple/filters/time_range.html index a9fc9f165..2c85edf92 100644 --- a/searx/templates/simple/time-range.html +++ b/searx/templates/simple/filters/time_range.html @@ -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>{{- '' -}} diff --git a/searx/templates/simple/macros.html b/searx/templates/simple/macros.html index 26aa71891..7a3a4ff9f 100644 --- a/searx/templates/simple/macros.html +++ b/searx/templates/simple/macros.html @@ -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> diff --git a/searx/templates/simple/search.html b/searx/templates/simple/search.html index c231d7b35..1df55e782 100644 --- a/searx/templates/simple/search.html +++ b/searx/templates/simple/search.html @@ -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> diff --git a/searx/templates/simple/simple_search.html b/searx/templates/simple/simple_search.html index 8612ceca6..6a5cdd9e7 100644 --- a/searx/templates/simple/simple_search.html +++ b/searx/templates/simple/simple_search.html @@ -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> |