From b7e315563d2401e6fb659fcfcb361e6d5bb915d5 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sun, 23 Apr 2023 13:19:21 +0200 Subject: [PATCH] [mod] simple theme: collaps/expand elements in the sidebar Make elements in the sidebar collapse able. Except infoboxes all elements in the sidebar are collapsed by default. By folding out the sidebar elements, the UI looks less cluttered. Especially on small devices like smartphones, where the sidebar is above the results list, the UX should be improved [1]. [1] https://github.com/searxng/searxng/issues/2140 Signed-off-by: Markus Heiser --- .../static/themes/simple/src/less/style.less | 23 ++--- searx/templates/simple/elements/apis.html | 24 +++++ .../simple/elements/engines_msg.html | 25 +++++ searx/templates/simple/elements/infobox.html | 48 +++++++++ .../templates/simple/elements/search_url.html | 18 ++++ .../simple/elements/suggestions.html | 23 +++++ searx/templates/simple/infobox.html | 50 ---------- searx/templates/simple/results.html | 99 +++++-------------- 8 files changed, 174 insertions(+), 136 deletions(-) create mode 100644 searx/templates/simple/elements/apis.html create mode 100644 searx/templates/simple/elements/engines_msg.html create mode 100644 searx/templates/simple/elements/infobox.html create mode 100644 searx/templates/simple/elements/search_url.html create mode 100644 searx/templates/simple/elements/suggestions.html delete mode 100644 searx/templates/simple/infobox.html diff --git a/searx/static/themes/simple/src/less/style.less b/searx/static/themes/simple/src/less/style.less index 962dbeba0..4e2f71015 100644 --- a/searx/static/themes/simple/src/less/style.less +++ b/searx/static/themes/simple/src/less/style.less @@ -589,8 +589,10 @@ article[data-vim-selected].category-social { } } +#infoboxes .title, #suggestions .title, #search_url .title, +#engines_msg .title, #apis .title { margin: 2em 0 0.5em 0; color: var(--color-base-font); @@ -684,6 +686,14 @@ article[data-vim-selected].category-social { } } +#apis { + input { + font-size: 0.9em; + margin: 0 10px 0 0; + .show-content-button; + } +} + #search_url { margin-top: 8px; @@ -754,11 +764,6 @@ article[data-vim-selected].category-social { border: none; } -#apis { - margin-top: 8px; - clear: both; -} - #backToTop { border: 1px solid var(--color-backtotop-border); margin: 0; @@ -836,14 +841,6 @@ article[data-vim-selected].category-social { } } - #apis { - display: none; - } - - #search_url { - display: none; - } - .result { .thumbnail { max-width: 98%; diff --git a/searx/templates/simple/elements/apis.html b/searx/templates/simple/elements/apis.html new file mode 100644 index 000000000..c3bc76726 --- /dev/null +++ b/searx/templates/simple/elements/apis.html @@ -0,0 +1,24 @@ + diff --git a/searx/templates/simple/elements/engines_msg.html b/searx/templates/simple/elements/engines_msg.html new file mode 100644 index 000000000..9b8028b7e --- /dev/null +++ b/searx/templates/simple/elements/engines_msg.html @@ -0,0 +1,25 @@ +
+
+ {{ _('Messages from the search engines') }} + +
+
+ + diff --git a/searx/templates/simple/elements/infobox.html b/searx/templates/simple/elements/infobox.html new file mode 100644 index 000000000..68fd32559 --- /dev/null +++ b/searx/templates/simple/elements/infobox.html @@ -0,0 +1,48 @@ + diff --git a/searx/templates/simple/elements/search_url.html b/searx/templates/simple/elements/search_url.html new file mode 100644 index 000000000..b3994fd94 --- /dev/null +++ b/searx/templates/simple/elements/search_url.html @@ -0,0 +1,18 @@ + diff --git a/searx/templates/simple/elements/suggestions.html b/searx/templates/simple/elements/suggestions.html new file mode 100644 index 000000000..52d9666bf --- /dev/null +++ b/searx/templates/simple/elements/suggestions.html @@ -0,0 +1,23 @@ + diff --git a/searx/templates/simple/infobox.html b/searx/templates/simple/infobox.html deleted file mode 100644 index bb9dc8524..000000000 --- a/searx/templates/simple/infobox.html +++ /dev/null @@ -1,50 +0,0 @@ - diff --git a/searx/templates/simple/results.html b/searx/templates/simple/results.html index f73a25d09..f29361ac7 100644 --- a/searx/templates/simple/results.html +++ b/searx/templates/simple/results.html @@ -35,84 +35,37 @@ {% if corrections %}