diff options
author | Johannes Schauer Marin Rodrigues <josch@debian.org> | 2022-09-25 08:04:59 +0200 |
---|---|---|
committer | Johannes Schauer Marin Rodrigues <josch@debian.org> | 2022-09-25 08:04:59 +0200 |
commit | fd6764405d464159c648526bc73bf11714a41633 (patch) | |
tree | 5ec2466cff9a796e3b5428c41b53d2a8db80e8b6 /searx/templates/oscar | |
parent | 32d4b6a638456caf50a5f99f2a0b57d60d418c5f (diff) |
New upstream version 1.1.0+dfsg1
Diffstat (limited to 'searx/templates/oscar')
-rw-r--r-- | searx/templates/oscar/base.html | 2 | ||||
-rw-r--r-- | searx/templates/oscar/categories.html | 4 | ||||
-rw-r--r-- | searx/templates/oscar/macros.html | 6 | ||||
-rw-r--r-- | searx/templates/oscar/preferences.html | 26 | ||||
-rw-r--r-- | searx/templates/oscar/result_templates/default.html | 4 | ||||
-rw-r--r-- | searx/templates/oscar/result_templates/key-value.html | 4 | ||||
-rw-r--r-- | searx/templates/oscar/result_templates/map.html | 100 | ||||
-rw-r--r-- | searx/templates/oscar/result_templates/products.html | 3 | ||||
-rw-r--r-- | searx/templates/oscar/search.html | 2 |
9 files changed, 94 insertions, 57 deletions
diff --git a/searx/templates/oscar/base.html b/searx/templates/oscar/base.html index b5c6ed2..6134bd7 100644 --- a/searx/templates/oscar/base.html +++ b/searx/templates/oscar/base.html @@ -1,6 +1,6 @@ {% from 'oscar/macros.html' import icon %} <!DOCTYPE html> -<html lang="{{ preferences.get_value('locale') }}" xml:lang="{{ preferences.get_value('locale') }}"{% if rtl %} dir="rtl"{% endif %}> +<html lang="{{ preferences.get_value('locale') }}" xml:lang="{{ preferences.get_value('locale') }}"{% if rtl %} dir="rtl"{% endif %} class="nojs"> <head> <meta charset="UTF-8" /> <meta name="description" content="searx - a privacy-respecting, hackable metasearch engine" /> diff --git a/searx/templates/oscar/categories.html b/searx/templates/oscar/categories.html index a5c5f61..afb3893 100644 --- a/searx/templates/oscar/categories.html +++ b/searx/templates/oscar/categories.html @@ -1,13 +1,17 @@ <div id="categories"> {%- if rtl -%} {% for category in categories | reverse -%} + <a> <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> + </a> {%- endfor %} {%- else -%} {% for category in categories -%} + <a> <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> + </a> {%- endfor %} {%- endif -%} </div> diff --git a/searx/templates/oscar/macros.html b/searx/templates/oscar/macros.html index 1cf4607..06e7d40 100644 --- a/searx/templates/oscar/macros.html +++ b/searx/templates/oscar/macros.html @@ -36,6 +36,9 @@ <small>{{ result_link(result.cached_url, icon('link') + _('cached'), "text-info", id) }}</small> {%- elif not result.is_onion -%} <small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info", id) }}</small> + {% if archive_today %} + <small>{{ result_link("https://archive.today/" + result.url, icon('link') + _('archive'), "text-info", id) }}</small> + {% endif %} {%- endif -%} {%- endif -%} {%- if proxify -%} @@ -72,6 +75,9 @@ <small>{{ result_link(result.cached_url, icon('link') + _('cached'), "text-info", id) }}</small> {%- elif not result.is_onion -%} <small>{{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info", id) }}</small> + {% if archive_today %} + <small>{{ result_link("https://archive.today/" + result.url, icon('link') + _('archive'), "text-info", id) }}</small> + {% endif %} {%- endif -%} {%- endif -%} {%- if proxify -%} diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html index 6d59384..45cd12a 100644 --- a/searx/templates/oscar/preferences.html +++ b/searx/templates/oscar/preferences.html @@ -150,6 +150,28 @@ {{ preferences_item_footer(info, label, rtl) }} {% endif %} + {% if 'autofocus' not in locked_preferences %} + {% set label = _('Autofocus search field') %} + {% set info = _('Turn off if you use your keyboard to scroll') %} + {{ preferences_item_header(info, label, rtl, 'autofocus') }} + <select class="form-control {{ custom_select_class(rtl) }}" name="autofocus" id="autofocus"> + <option value="1" {% if autofocus %}selected="selected"{% endif %}>{{ _('On') }}</option> + <option value="0" {% if not autofocus %}selected="selected"{% endif %}>{{ _('Off')}}</option> + </select> + {{ preferences_item_footer(info, label, rtl) }} + {% endif %} + + {% if 'archive_today' not in locked_preferences %} + {% set label = _('Show archive.today links') %} + {% set info = _('Alternative link cache service') %} + {{ preferences_item_header(info, label, rtl, 'archive_today') }} + <select class="form-control {{ custom_select_class(rtl) }}" name="archive_today" id="archive_today"> + <option value="1" {% if archive_today %}selected="selected"{% endif %}>{{ _('On') }}</option> + <option value="0" {% if not archive_today %}selected="selected"{% endif %}>{{ _('Off')}}</option> + </select> + {{ preferences_item_footer(info, label, rtl) }} + {% endif %} + {% set label = _('Show advanced settings') %} {% set info = _('Show advanced settings panel in the home page by default') %} {{ preferences_item_header(info, label, rtl, 'advanced_search') }} @@ -165,7 +187,7 @@ {{ preferences_item_header(info, label, rtl, 'doi_resolver') }} <select class="form-control {{ custom_select_class(rtl) }}" name="doi_resolver" id="doi_resolver"> {% for doi_resolver_name,doi_resolver_url in doi_resolvers.items() %} - <option value="{{ doi_resolver_name }}" {% if doi_resolver_name == current_doi_resolver %}selected="selected"{% endif %}> + <option value="{{ doi_resolver_name }}" {% if doi_resolver_url == current_doi_resolver %}selected="selected"{% endif %}> {{ doi_resolver_name }} - {{ doi_resolver_url }} </option> {% endfor %} @@ -368,7 +390,7 @@ </p> <div class="tab-pane"> - <input readonly="" class="form-control select-all-on-click cursor-text" type="url" value="{{ base_url }}?preferences={{ preferences_url_params|e }}{% raw %}&q=%s{% endraw %}"> + <input readonly="" class="form-control select-all-on-click cursor-text" type="url" value="{{ url_for('index', _external=True) }}?preferences={{ preferences_url_params|e }}{% raw %}&q=%s{% endraw %}"> <input type="submit" class="btn btn-primary" value="{{ _('save') }}" /> <a href="{{ url_for('index') }}"><div class="btn btn-default">{{ _('back') }}</div></a> <a href="{{ url_for('clear_cookies') }}"><div class="btn btn-default">{{ _('Reset defaults') }}</div></a> diff --git a/searx/templates/oscar/result_templates/default.html b/searx/templates/oscar/result_templates/default.html index d743f92..53cfee5 100644 --- a/searx/templates/oscar/result_templates/default.html +++ b/searx/templates/oscar/result_templates/default.html @@ -13,10 +13,10 @@ </div> {%- endif -%} -{%- if result.img_src -%} +{%- if result.img_src or result.thumbnail -%} <div class="container-fluid">{{- "" -}} <div class="row">{{- "" -}} - <img src="{{ image_proxify(result.img_src) }}" title="{{ result.title|striptags }}" style="width: auto; max-height: 60px; min-height: 60px;" class="col-xs-2 col-sm-4 col-md-4 result-content"> + <img src="{{ image_proxify(result.img_src or result.thumbnail) }}" title="{{ result.title|striptags }}" style="width: auto; max-height: 60px; min-height: 60px;" class="col-xs-2 col-sm-4 col-md-4 result-content"> {%- if result.content %}<p class="result-content col-xs-8 col-sm-8 col-md-8">{{ result.content|safe }}</p>{% endif -%} </div>{{- "" -}} </div> diff --git a/searx/templates/oscar/result_templates/key-value.html b/searx/templates/oscar/result_templates/key-value.html index d5c56a1..9d75682 100644 --- a/searx/templates/oscar/result_templates/key-value.html +++ b/searx/templates/oscar/result_templates/key-value.html @@ -1,8 +1,8 @@ {% from 'oscar/macros.html' import result_footer, result_footer_rtl with context %} -<div class="panel panel-default"> +<div class="result result-default"> <table class="table table-responsive table-bordered table-condensed"> {% for key, value in result.items() %} - {% if key in ['engine', 'engines', 'template', 'score', 'category', 'positions'] %} + {% if key in ['engine', 'engines', 'template', 'score', 'category', 'positions', 'pretty_url', 'parsed_url'] %} {% continue %} {% endif %} <tr> diff --git a/searx/templates/oscar/result_templates/map.html b/searx/templates/oscar/result_templates/map.html index 9713452..eb3fccf 100644 --- a/searx/templates/oscar/result_templates/map.html +++ b/searx/templates/oscar/result_templates/map.html @@ -3,61 +3,64 @@ {{- result_header(result, favicons, loop.index) -}} {{- result_sub_header(result, loop.index) -}} -{%- if (result.latitude and result.longitude) or result.boundingbox -%} - <small> • <a class="text-info btn-collapse collapsed searx_init_map cursor-pointer disabled_if_nojs" data-toggle="collapse" data-target="#result-map-{{ index }}" data-leaflet-target="osm-map-{{ index }}" data-map-lon="{{ result.longitude }}" data-map-lat="{{ result.latitude }}" {% if result.boundingbox %}data-map-boundingbox='{{ result.boundingbox|tojson|safe }}'{% endif %} {% if result.geojson %}data-map-geojson='{{ result.geojson|tojson|safe }}'{% endif %} data-btn-text-collapsed="{{ _('show map') }}" data-btn-text-not-collapsed="{{ _('hide map') }}">{{ icon('globe') }} {{ _('show map') }}</a></small> -{%- endif -%} - -{%- if result.osm and (result.osm.type and result.osm.id) -%} - <small> • <a class="text-info btn-collapse collapsed cursor-pointer searx_overpass_request disabled_if_nojs" data-toggle="collapse" data-target="#result-overpass-{{ index }}" data-osm-type="{{ result.osm.type }}" data-osm-id="{{ result.osm.id }}" data-result-table="result-overpass-table-{{ index }}" data-result-table-loadicon="result-overpass-table-loading-{{ index }}" data-btn-text-collapsed="{{ _('show details') }}" data-btn-text-not-collapsed="{{ _('hide details') }}">{{ icon('map-marker') }} {{ _('show details') }}</a></small> -{%- endif -%} +<div class="container-fluid"> -{# {% if (result.latitude and result.longitude) %} - <small> • <a class="text-info btn-collapse collapsed cursor-pointer disabled_if_nojs" data-toggle="collapse" data-target="#result-geodata-{{ index }}" data-btn-text-collapsed="{{ _('show geodata') }}" data-btn-text-not-collapsed="{{ _('hide geodata') }}">{{ icon('map-marker') }} {{ _('show geodata') }}</a></small> -{% endif %} #} + <div class="row"> + {%- if result.img_src -%}<img src="{{ image_proxify(result.img_src) }}" title="{{ result.title|striptags }}" class="img-thumbnail">{%- endif -%} -<div class="container-fluid"> + {%- if result.type_icon or result.type -%} + <p class="result-content"> + {%- if result.type_icon -%} + <img src="{{ image_proxify(result.type_icon) }}" title="{{ result.type|striptags }}" class="img-type"> + {%- endif -%} + {{ result.type if result.type is not none else '' }} + </p> + {%- endif -%} -{%- if result.address -%} -<p class="row result-content result-adress col-xs-12 col-sm-5 col-md-4" itemscope itemtype="http://schema.org/PostalAddress"> - {%- if result.address.name -%} - <strong itemprop="name">{{ result.address.name }}</strong><br/> - {%- endif -%} - {%- if result.address.road -%} - <span itemprop="streetAddress"> - {%- if result.address.house_number %}{{ result.address.house_number }}, {% endif -%} - {{- result.address.road -}} - </span><br/> - {%- endif -%} - {%- if result.address.locality -%} - <span itemprop="addressLocality">{{ result.address.locality }}</span> - {%- if result.address.postcode %}, <span itemprop="postalCode">{{ result.address.postcode }}</span>{% endif -%} - <br/> - {%- endif -%} - {%- if result.address.country -%} - <span itemprop="addressCountry">{{ result.address.country }}</span> - {%- endif -%} -</p> -{%- endif %} + {%- if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif -%} -{%- if result.osm and (result.osm.type and result.osm.id) -%} - <div class="row result-content collapse col-xs-12 col-sm-7 col-md-8" id="result-overpass-{{ index }}"{% if rtl %} dir="ltr"{% endif %}> - <div class="text-center" id="result-overpass-table-loading-{{ index }}"><img src="{{ url_for('static', filename='img/loader.gif') }}" alt="Loading ..."/></div> - <table class="table table-striped table-condensed hidden" id="result-overpass-table-{{ index }}"> - <tr><th>key</th><th>value</th></tr> + <table class="result-content result-map-details"> + {%- if result.address -%} + <tr> + <th scope="row"> + {{ result.address_label or _('address') }} + </th> + <td class="result-content result-adress" itemscope itemtype="http://schema.org/PostalAddress"> + {%- if result.address.name -%} + <strong itemprop="name" class="hidden">{{ result.address.name }}</strong> + {%- endif -%} + {%- if result.address.road -%} + <span itemprop="streetAddress"> + {%- if result.address.house_number %}{{ result.address.house_number }}, {% endif -%} + {{- result.address.road -}} + </span><br/> + {%- endif -%} + {%- if result.address.locality -%} + <span itemprop="addressLocality">{{ result.address.locality }}</span> + {%- if result.address.postcode %}, <span itemprop="postalCode">{{ result.address.postcode }}</span>{% endif -%} + <br/> + {%- endif -%} + {%- if result.address.country -%} + <span itemprop="addressCountry">{{ result.address.country }}</span> + {%- endif -%} + </td> + </tr> + {%- endif %} + {%- for info in result.data -%} + <tr><th scope="row">{{ info.label }}</th><td>{{ info.value|safe }}</td></tr> + {%- endfor -%} + {%- for link in result.links -%} + <tr><th scope="row">{{ link.label }}</th><td><a class="text-info cursor-pointer" href="{{ link.url }}">{{ link.url_label|safe }}</a></td></tr> + {%- endfor -%} </table> - </div> -{%- endif -%} - -{# {% if (result.latitude and result.longitude) %} - <div class="row collapse col-xs-12 col-sm-5 col-md-4" id="result-geodata-{{ index }}"> - <strong>Longitude:</strong> {{ result.longitude }} <br/> - <strong>Latitude:</strong> {{ result.latitude }} - </div> -{% endif %} #} -{%- if result.content %}<p class="row result-content col-xs-12 col-sm-12 col-md-12">{{ result.content|safe }}</p>{% endif -%} + <p class="result-content"> + {%- if (result.latitude and result.longitude) or result.boundingbox -%} + <span><a class="text-info btn-collapse collapsed searx_init_map cursor-pointer disabled_if_nojs" data-toggle="collapse" data-target="#result-map-{{ index }}" data-leaflet-target="osm-map-{{ index }}" data-map-lon="{{ result.longitude }}" data-map-lat="{{ result.latitude }}" {% if result.boundingbox %}data-map-boundingbox='{{ result.boundingbox|tojson|safe }}'{% endif %} {% if result.geojson %}data-map-geojson='{{ result.geojson|tojson|safe }}'{% endif %} data-btn-text-collapsed="{{ _('show map') }}" data-btn-text-not-collapsed="{{ _('hide map') }}">{{ icon('globe') }} {{ _('show map') }}</a></span> + {%- endif -%} + </p> -</div> + </div> {%- if (result.latitude and result.longitude) or result.boundingbox -%} <div class="collapse" id="result-map-{{ index }}"> @@ -65,6 +68,7 @@ </div> {%- endif -%} +</div> {%- if rtl -%} {{- result_footer_rtl(result, loop.index) -}} {% else %} diff --git a/searx/templates/oscar/result_templates/products.html b/searx/templates/oscar/result_templates/products.html index 590db0e..149e3c9 100644 --- a/searx/templates/oscar/result_templates/products.html +++ b/searx/templates/oscar/result_templates/products.html @@ -1,4 +1,4 @@ -{% from 'oscar/macros.html' import draw_favicon, result_header, result_sub_header, result_footer_rtl, result_footer %} +{% from 'oscar/macros.html' import draw_favicon, icon, result_header, result_sub_header, result_footer_rtl, result_footer %} {{ result_header(result, favicons) }} {{ result_sub_header(result) }} @@ -11,6 +11,7 @@ {% if result.shipping %}<small>{{ result.shipping|safe }}</small></br>{% endif %} {% if result.source_country %}<small>{{ result.source_country|safe }}</small></br>{% endif %} {% if result.content %}{{ result.content|safe }}{% endif %} + {% if result.has_stock is defined %}<br>{% if result.has_stock %}{{ icon('check', _('Has stock')) }}{% else %}{{ icon('alert', _('Out of stock')) }}{% endif %}{% endif %} </p> </div> </div> diff --git a/searx/templates/oscar/search.html b/searx/templates/oscar/search.html index 2b3758e..841e48e 100644 --- a/searx/templates/oscar/search.html +++ b/searx/templates/oscar/search.html @@ -3,7 +3,7 @@ <div class="row"> <div class="col-xs-12 col-md-8"> <div class="input-group search-margin"> - <input type="search" autofocus name="q" class="form-control" id="q" placeholder="{{ _('Search for...') }}" aria-label="{{ _('Search for...') }}" autocomplete="off" value="{{ q }}" accesskey="s"> + <input type="search" {% if autofocus %}autofocus{% endif %} name="q" class="form-control" id="q" placeholder="{{ _('Search for...') }}" aria-label="{{ _('Search for...') }}" autocomplete="off" value="{{ q }}" accesskey="s"> <span class="input-group-btn"> <button type="submit" class="btn btn-default" aria-label="{{ _('Start search') }}"><span class="hide_if_nojs">{{ icon('search') }}</span><span class="hidden active_if_nojs">{{ _('Start search') }}</span></button> <button type="button" id="clear_search" class="btn btn-default hide_if_nojs" aria-label="{{ _('Clear search') }}">{{ icon('remove') }}</button> |