4 Commits

Author SHA1 Message Date
Mehmet Sait Cubukcu
613c1aa8eb docs: remove unsupported --replace flag from Docker command (#5288) 2025-10-10 20:31:48 +02:00
Bnyro
899cf7e08a [build] /static 2025-10-10 18:08:33 +02:00
Bnyro
362cc13aeb [feat] preferences hash: show applied settings in pref page when searching with 'search url of the currently saved preferences'
Previously, when using a search url copied from the cookies tab, clicking
at the settings icon at the top right would show the browser preferences
and not the preferences that were set and used with the search url.
Please see https://github.com/searxng/searxng/issues/5227 for more information.

To test:
- change some preferences
- copy the preferences search url in the settings' cookies tab
- reset the preferences or clear cookies
- paste the copied search url into the search bar to search for something
- press the settings icon
- you can now see/preview the actual settings that were used for the search
- by pressing 'save', you can keep these preferences

closes #5227
2025-10-10 18:08:33 +02:00
Bnyro
d28a1c434f [fix] no results error dialog: link to preferences doesn't work if searxng is hosted as subdirectory 2025-10-10 18:05:54 +02:00
8 changed files with 33 additions and 7 deletions

View File

@@ -193,6 +193,15 @@ div.selectable_url {
border-color: var(--color-warning);
}
.dialog-warning-block {
.dialog();
display: block;
color: var(--color-warning);
background: var(--color-warning-background);
border-color: var(--color-warning);
}
.dialog-modal {
.dialog();

View File

@@ -100,7 +100,7 @@ Basic container instancing example:
$ cd ./searxng/
# Run the container
$ docker run --name searxng --replace -d \
$ docker run --name searxng -d \
-p 8888:8080 \
-v "./config/:/etc/searxng/" \
-v "./data/:/var/cache/searxng/" \

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -51,7 +51,11 @@
{%- endif -%}
{%- endblock -%}
{%- block linkto_preferences -%}
<a href="{{ url_for('preferences') }}" class="link_on_top_preferences">{{ icon_big('settings') }}<span>{{ _('Preferences') }}</span></a>
{%- if request.args.get('preferences') -%}
<a href="{{ url_for('preferences') }}?preferences={{ request.args.get('preferences') }}&preferences_preview_only=true" class="link_on_top_preferences">{{ icon_big('settings') }}<span>{{ _('Preferences') }}</span></a>
{%- else -%}
<a href="{{ url_for('preferences') }}" class="link_on_top_preferences">{{ icon_big('settings') }}<span>{{ _('Preferences') }}</span></a>
{%- endif -%}
{%- endblock -%}
</nav>
{% block header %}

View File

@@ -18,7 +18,7 @@
{%- 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>{{ _("Change the search engine used in the preferences:") }} <a href="{{ url_for('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>{{- '' -}}

View File

@@ -155,6 +155,16 @@
<h1>{{ _('Preferences') }}</h1>
{%- if request.args.get('preferences_preview_only') == 'true' -%}
<div class="dialog-warning-block">
<p>{{ _("This is a preview of the settings used by the 'Search URL' you used to get here.") }}</p>
<ul>
<li>{{ _('Press save to copy these preferences to your browser.') }}</li>
<li>{{ _('Click here to view your browser preferences instead:') }} <a href="{{ url_for('preferences') }}">/preferences</a></li>
</ul>
</div>
{%- endif -%}
<form id="search_form" method="post" action="{{ url_for('preferences') }}" autocomplete="off">
{{- tabs_open() -}}

View File

@@ -861,8 +861,11 @@ def preferences():
# save preferences using the link the /preferences?preferences=...
if sxng_request.args.get('preferences') or sxng_request.form.get('preferences'):
resp = make_response(redirect(url_for('index', _external=True)))
return sxng_request.preferences.save(resp)
# if preferences_preview_only is 'true', the prefs from the 'preferences' query are
# shown in the settings page, but they're not applied unless the user presses 'save'
if sxng_request.args.get('preferences_preview_only') != 'true':
resp = make_response(redirect(url_for('index', _external=True)))
return sxng_request.preferences.save(resp)
# save preferences
if sxng_request.method == 'POST':