diff options
Diffstat (limited to 'searx/templates')
| -rw-r--r-- | searx/templates/simple/macros.html | 4 | ||||
| -rw-r--r-- | searx/templates/simple/preferences.html | 10 | ||||
| -rw-r--r-- | searx/templates/simple/results.html | 26 | ||||
| -rw-r--r-- | searx/templates/simple/search.html | 10 | ||||
| -rw-r--r-- | searx/templates/simple/simple_search.html | 18 |
5 files changed, 45 insertions, 23 deletions
diff --git a/searx/templates/simple/macros.html b/searx/templates/simple/macros.html index 637966715..7d9b9f4ae 100644 --- a/searx/templates/simple/macros.html +++ b/searx/templates/simple/macros.html @@ -55,8 +55,8 @@ <div class="tabs" role="tablist"> {%- endmacro -%} -{%- macro tab_header(name, id, label) -%} -<input type="radio" name="{{ name }}" id="tab-{{ id }}"/> +{%- macro tab_header(name, id, label, checked) -%} +<input type="radio" name="{{ name }}" id="tab-{{ id }}" {% if checked is sameas true %}checked="checked"{% endif %} /> <label id="tab-label-{{ label }}" for="tab-{{ id }}" role="tab" aria-controls="tab-content-{{ id }}">{{ label }}</label> <section id="tab-content-{{ id }}" role="tabpanel" aria-labelledby="tab-label-{{ label }}" aria-hidden="false"> {%- endmacro -%} diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html index ca48af74e..fef003d5e 100644 --- a/searx/templates/simple/preferences.html +++ b/searx/templates/simple/preferences.html @@ -102,7 +102,7 @@ {{ tabs_open() }} - {{ tab_header('maintab', 'general', _('General')) }} + {{ tab_header('maintab', 'general', _('General'), True) }} {% if 'categories' not in locked_preferences %} <fieldset> <legend>{{ _('Default categories') }}</legend> @@ -284,9 +284,11 @@ {{ tab_header('maintab', 'engines', _('Engines')) }} <p>{{ _('Currently used search engines') }}</p> {{ tabs_open() }} - {% for categ in categories_as_tabs + [OTHER_CATEGORY] %} - {{ tab_header('enginetab', 'category' + categ, _(categ)) }} - {% if categ == OTHER_CATEGORY %} + {% set ns = namespace(checked=true) %} + {% for categ in categories_as_tabs + [OTHER_CATEGORY] %} + {{ tab_header('enginetab', 'category' + categ, _(categ), ns.checked )}} + {% set ns.checked = false %} + {% if categ == OTHER_CATEGORY %} <p>{{_('This tab does not show up for search results, but you can search the engines listed here via bangs.')}}</p> {% endif %} <div class="scrollx"> diff --git a/searx/templates/simple/results.html b/searx/templates/simple/results.html index eb45ac742..b05841bbb 100644 --- a/searx/templates/simple/results.html +++ b/searx/templates/simple/results.html @@ -70,8 +70,11 @@ {% for suggestion in suggestions %} <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}"> <input type="hidden" name="q" value="{{ suggestion.url }}"> - <input type="hidden" name="time_range" value="{{ time_range }}"> + {% for category in selected_categories %} + <input type="hidden" name="category_{{ category }}" value="1"> + {% endfor %} <input type="hidden" name="language" value="{{ current_language }}"> + <input type="hidden" name="time_range" value="{{ time_range }}"> <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 %} @@ -82,10 +85,12 @@ </div> {% endif %} + {% if method == 'POST' %} <div id="search_url" role="complementary" aria-labelledby="search_url-title"> <h4 class="title" id="search_url-title">{{ _('Search URL') }} :</h4> <div class="selectable_url"><pre>{{ url_for('search', _external=True) }}?q={{ q|urlencode }}&language={{ current_language }}&time_range={{ time_range }}&safesearch={{ safesearch }}{% if pageno > 1 %}&pageno={{ pageno }}{% endif %}{% if selected_categories %}&categories={{ selected_categories|join(",") | replace(' ','+') }}{% endif %}{% if timeout_limit %}&timeout_limit={{ timeout_limit|urlencode }}{% endif %}</pre></div> </div> + {% endif %} <div id="apis" role="complementary" aria-labelledby="apis-title"> {% if search_formats %} <h4 class="title" id="apis-title">{{ _('Download results') }}</h4> @@ -97,8 +102,8 @@ <input type="hidden" name="category_{{ category }}" value="1"> {% endfor %} <input type="hidden" name="pageno" value="{{ pageno }}"> - <input type="hidden" name="time_range" value="{{ time_range }}"> <input type="hidden" name="language" value="{{ current_language }}"> + <input type="hidden" name="time_range" value="{{ time_range }}"> <input type="hidden" name="safesearch" value="{{ safesearch }}"> <input type="hidden" name="format" value="{{ output_type }}"> {% if timeout_limit %}<input type="hidden" name="timeout_limit" value="{{ timeout_limit|e }}" >{% endif %} @@ -115,15 +120,18 @@ <h4 id="corrections-title">{{ _('Try searching for:') }}</h4> {% for correction in corrections %} <div class="left"> - <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" role="navigation"> + <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" role="navigation"> + {% for category in selected_categories %} + <input type="hidden" name="category_{{ category }}" value="1"> + {% endfor %} <input type="hidden" name="q" value="{{ correction.url }}"> - <input type="hidden" name="time_range" value="{{ time_range }}"> <input type="hidden" name="language" value="{{ current_language }}"> + <input type="hidden" name="time_range" value="{{ time_range }}"> <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 }}" >{% endif %} <input type="submit" role="link" value="{{ correction.title }}"> - </form> + </form> </div> {% endfor %} </div> @@ -149,16 +157,16 @@ <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" class="previous_page"> <div class="{% if rtl %}right{% else %}left{% endif %}"> <input type="hidden" name="q" value="{{ q|e }}" > - {{- engine_data_form(engine_data) -}} {% for category in selected_categories %} <input type="hidden" name="category_{{ category }}" value="1" > {% endfor %} <input type="hidden" name="pageno" value="{{ pageno-1 }}" > - <input type="hidden" name="time_range" value="{{ time_range }}" > <input type="hidden" name="language" value="{{ current_language }}" > + <input type="hidden" name="time_range" value="{{ time_range }}" > <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 %} + {{- engine_data_form(engine_data) -}} <button role="link" type="submit">{{ icon_small('chevron-left') }} {{ _('Previous page') }}</button> </div> </form> @@ -166,16 +174,16 @@ <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" class="next_page"> <div class="{% if rtl %}left{% else %}right{% endif %}"> <input type="hidden" name="q" value="{{ q|e }}" > - {{- engine_data_form(engine_data) -}} {% for category in selected_categories %} <input type="hidden" name="category_{{ category }}" value="1" > {% endfor %} <input type="hidden" name="pageno" value="{{ pageno+1 }}" > - <input type="hidden" name="time_range" value="{{ time_range }}" > <input type="hidden" name="language" value="{{ current_language }}" > + <input type="hidden" name="time_range" value="{{ time_range }}" > <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 %} + {{- engine_data_form(engine_data) -}} <button role="link" type="submit">{{ _('Next page') }} {{ icon_small('chevron-right') }}</button> </div> </form> diff --git a/searx/templates/simple/search.html b/searx/templates/simple/search.html index 8c64211e5..90a296aeb 100644 --- a/searx/templates/simple/search.html +++ b/searx/templates/simple/search.html @@ -4,10 +4,12 @@ <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...') }}" autocomplete="off" spellcheck="false" dir="auto" value="{{ q or '' }}"> - <button id="clear_search" type="reset" aria-label="{{ _('clear') }}"><span class="hide_if_nojs">{{ icon_big('close') }}</span><span class="show_if_nojs">{{ _('clear') }}</span></button> - <button id="send_search" type="submit" aria-label="{{ _('search') }}"><span class="hide_if_nojs">{{ icon_big('search-outline') }}</span><span class="show_if_nojs">{{ _('search') }}</span></button> + <div id="search_view"> + <div class="search_box"> + <input id="q" name="q" type="text" placeholder="{{ _('Search for...') }}" autocomplete="off" autocapitalize="none" spellcheck="false" autocorrect="off" dir="auto" value="{{ q or '' }}"> + <button id="clear_search" type="reset" aria-label="{{ _('clear') }}" class="hide_if_nojs"><span>{{ icon_big('close') }}</span><span class="show_if_nojs">{{ _('clear') }}</span></button> + <button id="send_search" type="submit" aria-label="{{ _('search') }}"><span class="hide_if_nojs">{{ icon_big('search-outline') }}</span><span class="show_if_nojs">{{ _('search') }}</span></button> + </div> </div> {% set display_tooltip = true %} {% include 'simple/categories.html' %} diff --git a/searx/templates/simple/simple_search.html b/searx/templates/simple/simple_search.html index 218f70496..30a6c2add 100644 --- a/searx/templates/simple/simple_search.html +++ b/searx/templates/simple/simple_search.html @@ -1,9 +1,19 @@ <form id="search" method="{{ method or 'POST' }}" action="{{ url_for('search') }}" role="search"> <div id="search_header"> - <div class="search_box"> - <input id="q" autofocus name="q" type="text" placeholder="{{ _('Search for...') }}" autocomplete="off" spellcheck="false" dir="auto" value="{{ q or '' }}"> - <button id="clear_search" type="reset" aria-label="{{ _('clear') }}"><span class="hide_if_nojs">{{ icon_big('close') }}</span><span class="show_if_nojs">{{ _('clear') }}</span></button> - <button id="send_search" type="submit" aria-label="{{ _('search') }}"><span class="hide_if_nojs">{{ icon_big('search-outline') }}</span><span class="show_if_nojs">{{ _('search') }}</span></button> + <div id="search_view"> + <div class="search_box"> + <input id="q" name="q" type="text" placeholder="{{ _('Search for...') }}" autocomplete="off" autocapitalize="none" spellcheck="false" autocorrect="off" dir="auto" value="{{ q or '' }}"> + <button id="clear_search" type="reset" aria-label="{{ _('clear') }}"><span class="hide_if_nojs">{{ icon_big('close') }}</span><span class="show_if_nojs">{{ _('clear') }}</span></button> + <button id="send_search" type="submit" aria-label="{{ _('search') }}"><span class="hide_if_nojs">{{ icon_big('search-outline') }}</span><span class="show_if_nojs">{{ _('search') }}</span></button> + </div> </div> </div> + {% for category in selected_categories %} + <input type="hidden" name="category_{{ category }}" value="1" > + {% endfor %} + <input type="hidden" name="language" value="{{ current_language }}" > + <input type="hidden" name="time_range" value="{{ time_range }}" > + <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> |