Merge pull request 'Update to match upstream on 2024.03.06' (#14) from 2024_03_06 into main

Reviewed-on: #14
Reviewed-by: muppeth <muppeth@no-reply@disroot.org>
This commit is contained in:
meaz 2024-03-12 19:39:39 +00:00
commit 3592b1c20a
14 changed files with 100 additions and 40 deletions

View File

@ -24,7 +24,7 @@ When changing static elements (css, images etc), edit files in `src/`. Once done
```
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile or ~/.bashrc
nvm install 18.16.0 # or whatever version you want
nvm install 18.19.0 # or whatever version you want
npm install -g npm
cd searx/static/themes/beetroot
npm install

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -49,8 +49,7 @@ article.result-images .detail {
.result-images-labels {
color: var(--color-result-detail-font);
max-height: 16rem;
min-height: 16rem;
height: 19rem;
hr {
border-top: 1px solid var(--color-result-detail-hr);
@ -62,11 +61,16 @@ article.result-images .detail {
overflow: hidden;
text-overflow: ellipsis;
font-size: 0.9rem;
margin-bottom: 0;
}
p {
color: var(--color-result-detail-label-font);
font-size: 0.9rem;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
margin: 0.8rem 0;
span {
display: inline-block;
@ -82,6 +86,7 @@ article.result-images .detail {
p.result-content {
height: 2rem;
line-height: unset;
overflow: hidden;
text-overflow: ellipsis;
}

View File

@ -307,7 +307,8 @@ article[data-vim-selected].category-social {
}
}
.result-paper {
.result-paper,
.result-packages {
.attributes {
display: table;
border-spacing: 0.125rem;
@ -350,6 +351,12 @@ article[data-vim-selected].category-social {
}
}
.result-packages {
.attributes {
margin-top: 0.3rem;
}
}
.template_group_images {
display: flex;
flex-wrap: wrap;
@ -458,6 +465,17 @@ article[data-vim-selected].category-social {
background: var(--color-result-image-background);
}
.image_resolution {
position: absolute;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 50%);
padding: 0.3rem 0.5rem;
font-size: 0.9rem;
color: #fff;
border-top-left-radius: 0.3rem;
}
span.title,
span.source {
display: block;
@ -1077,7 +1095,8 @@ summary.title {
display: none;
}
.result-paper {
.result-paper,
.result-packages {
.attributes {
display: block;

View File

@ -42,7 +42,7 @@
{%- macro result_sub_footer(result, proxify) -%}
<div class="engines">
{% for engine in result.engines %}<span>{{ engine }}</span>{% endfor %}
{{ result_link(cache_url + result.url, icon_small('ellipsis-vertical-outline') + _('cached'), "cache_link") }}&lrm; {% if proxify and proxify_results %} {{ result_link(proxify(result.url), icon('link') + _('proxied'), "proxyfied_link") }} {% endif %}
{{ icon_small('ellipsis-vertical-outline') + result_link(cache_url + result.url, _('cached'), "cache_link") }}&lrm; {% if proxify and proxify_results %} {{ result_link(proxify(result.url), _('proxied'), "proxyfied_link") }} {% endif %}
</div>{{- '' -}}
<div class="break"></div>{{- '' -}}
{%- endmacro -%}

View File

@ -1,11 +1,28 @@
{% from 'beetroot/icons.html' import icon_big %}
<div class="dialog-error-block" role="alert">
<p><strong>{{ _('Sorry!') }}</strong></p>
<p>{{ _("No results were found. You can try to:") }}</p>
<div class="dialog-error-block" role="alert">{{- '' -}}
<p>{{- '' -}}
<strong>
{%- if pageno == 1 -%}
{{ _('Sorry!') }}
{%- endif -%}
</strong>{{- '' -}}
</p>{{- '' -}}
<p>
{%- if pageno == 1 -%}
{{ _("No results were found. You can try to:") }}
{%- else -%}
{{ _("There are no more results. You can try to:") }}
{%- endif -%}
</p>{{- '' -}}
<ul>
<li>{{ _("Refresh the page.") }}</li>
<li>{{ _("Search for another query or select another category (above).") }}</li>
<li>{{ _("Change the search engine used in the preferences:") }} <a href="/preferences">/preferences</a></li>
<li>{{ _("Switch to another instance:") }} <a href="https://searx.space">https://searx.space</a></li>
{%- if pageno == 1 -%}
<li>{{ _("Refresh the page.") }}</li>{{- '' -}}
<li>{{ _("Search for another query or select another category (above).") }}</li>{{- '' -}}
<li>{{ _("Change the search engine used in the preferences:") }} <a href="/preferences">/preferences</a></li>{{- '' -}}
<li>{{ _("Switch to another instance:") }} <a href="https://searx.space">https://searx.space</a></li>{{- '' -}}
{%- else -%}
<li>{{ _("Search for another query or select another category.") }}</li>{{- '' -}}
<li>{{ _("Go back to the previous page using the previous page button.") }}</li>{{- '' -}}
{%- endif -%}
</ul>
</div>

View File

@ -15,7 +15,7 @@
{% if autocomplete %}
<Url rel="suggestions" type="application/x-suggestions+json" method="{{ opensearch_method }}" template="{{ url_for('autocompleter', _external=True) }}?q={searchTerms}"/>
{% endif %}
<Url rel="self" type="application/opensearchdescription+xml" method="{{ opensearch_method }}" template="{{ opensearch_url }}" />
<Url rel="self" type="application/opensearchdescription+xml" method="{{ opensearch_method }}" template="{{ url_for('opensearch', _external=True) }}" />
<Query role="example" searchTerms="SearXNG" />
<moz:SearchForm>{{ url_for('search', _external=True) }}</moz:SearchForm>
</OpenSearchDescription>

View File

@ -36,10 +36,24 @@
</h4>{{- '' -}}
<div class="selectable_url">{{- '' -}}
<pre>
{{- url_for('preferences', _external=True) -}}?preferences={{- preferences_url_params|e -}}
&amp;save=1{{- '' -}}
{{- url_for('preferences', _external=True) -}}?preferences={{- preferences_url_params|e -}}{{- '' -}}
</pre>{{- '' -}}
</div>{{- '' -}}
<p class="small_font">
{{- _('Specifying custom settings in the preferences URL can be used to sync preferences across devices.') -}}
</p>
<h4>
{{- _('Copy preferences hash') -}}:{{- '' -}}
</h4>{{- '' -}}
<div id="copy-hash-container">{{- '' -}}
<div class="selectable_url">{{- '' -}}
<pre>
{{- preferences_url_params|e }}
</pre>{{- '' -}}
</div>
<button id="copy-hash" class="button" data-hash="{{- preferences_url_params|e -}}" data-copied-text="{{- _('Copied') -}}">{{- _('Copy') -}}</button>
</div>
<h4>
{{- _('Insert copied preferences hash (without URL) to restore') -}}:{{- '' -}}
</h4>{{- '' -}}
<input type="text" id="pref-hash-input" name="preferences" placeholder="{{- _('Preferences hash') -}}">{{- '' -}}

View File

@ -5,7 +5,7 @@
{%- for name in themes -%}
<option value="{{ name }}"
{%- if name == theme %} selected="selected"{%- endif -%}>
{{- name -}}
{{- name | capitalize -}}
</option>
{%- endfor -%}
</select>{{- '' -}}
@ -22,7 +22,7 @@
{%- for name in ['auto', 'light', 'dark'] -%}
<option value="{{ name }}"
{%- if name == preferences.get_value('simple_style') %} selected="selected" {%- endif -%}>
{{- _(name) -}}
{{- _(name) | capitalize -}}
</option>
{%- endfor -%}
</select>{{- '' -}}

View File

@ -1,8 +1,9 @@
<article class="result result-images {% if result['category'] %}category-{{ result['category'] }}{% endif %}">{{- "" -}}
<a {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} href="{{ result.img_src }}">{{- "" -}}
<img class="image_thumbnail" {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" alt="{{ result.title|striptags }}" loading="lazy" width="200" height="200">{{- "" -}}
<span class="title">{{ result.title|striptags }}</span>{{- "" -}}
<span class="source">{{ result.parsed_url.netloc }}</span>{{- "" -}}
{%- if result.resolution %} <span class="image_resolution">{{ result.resolution }}</span> {%- endif -%}
<span class="title">{{ result.title|striptags }}</span>{{- "" -}}
<span class="source">{{- result.parsed_url.netloc -}}</span>{{- "" -}}
</a>{{- "" -}}
<div class="detail">{{- "" -}}
<a class="result-detail-close" href="#">{{ icon('close') }}</a>{{- "" -}}
@ -16,7 +17,9 @@
<p class="result-content">{%- if result.content %}{{ result.content|striptags }}{% else %}&nbsp;{% endif -%}</p>{{- "" -}}
<hr>{{- "" -}}
<p class="result-author">{%- if result.author %}<span>{{ _('Author') }}:</span>{{ result.author|striptags }}{% else %}&nbsp;{% endif -%}</p>{{- "" -}}
<p class="result-resolution">{%- if result.resolution %}<span>{{ _('Resolution') }}:</span>{{ result.resolution }}{% else %}&nbsp;{% endif -%}</p>{{- "" -}}
<p class="result-format">{%- if result.img_format %}<span>{{ _('Format') }}:</span>{{ result.img_format }}{% else %}&nbsp;{% endif -%}</p>{{- "" -}}
<p class="result-filesize">{%- if result.filesize %}<span>{{ _('Filesize') }}:</span>{{ result.filesize}}{% else %}&nbsp;{% endif -%}</p>{{- "" -}}
<p class="result-source">{%- if result.source %}<span>{{ _('Source') }}:</span>{{ result.source }}{% else %}&nbsp;{% endif -%}</p>{{- "" -}}
<p class="result-engine"><span>{{ _('Engine') }}:</span>{{ result.engine }}</p>{{- "" -}}{{- "" -}}
<p class="result-url"><span>{{ _('View source') }}:</span><a {% if results_on_new_tab %}target="_blank" rel="noopener noreferrer"{% else %}rel="noreferrer"{% endif %} href="{{ result.url }}">{{ result.url }}</a></p>{{- "" -}}

View File

@ -124,22 +124,24 @@
</div>
</form>
{% endif %}
<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 }}" >
{% 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="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>
{%- if results | count > 0 -%}
<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 }}" >
{% 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="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>
{%- endif -%}
{% set pstart = 1 %}
{% set pend = 11 %}
{% if pageno > 5 %}