From 6f0ec7e58f9c7c9d188561296546ec139e1f9118 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Sun, 30 Jan 2022 09:39:21 +0100 Subject: [PATCH 1/2] [simple] introduce page_with_header.html template Previously the preferences & stats templates contained the markup:

SearXNG

There are many things wrong with this: 1. the markup was duplicated 2. the CSS needed to be changed whenever a new page wanted to use this header (since the CSS used page-specific selectors) 3. h1 should be reserved for the actual page title (e.g. Preferences or Engine stats) 4. the image was set via CSS which also set: span { visibility: hidden; } which however removes the alternative text from the accessibility tree (meaning screen readers will ignore it). This commit fixes all these problems. --- .../static/themes/simple/src/less/style.less | 20 ++++--------------- searx/templates/simple/about.html | 2 +- searx/templates/simple/base.html | 4 +++- searx/templates/simple/page_with_header.html | 5 +++++ searx/templates/simple/preferences.html | 7 ++----- searx/templates/simple/stats.html | 7 ++----- 6 files changed, 17 insertions(+), 28 deletions(-) create mode 100644 searx/templates/simple/page_with_header.html diff --git a/searx/static/themes/simple/src/less/style.less b/searx/static/themes/simple/src/less/style.less index 657e0d3ac..4011dddb5 100644 --- a/searx/static/themes/simple/src/less/style.less +++ b/searx/static/themes/simple/src/less/style.less @@ -79,9 +79,7 @@ main { flex: 1; } -#main_preferences, -#main_about, -#main_stats { +.page_with_header { margin: 2em auto; width: 85em; } @@ -101,16 +99,8 @@ footer { } } -#main_preferences h1, -#main_stats h1 { - background: url('../img/searxng.png') no-repeat; - background-size: contain; - min-height: 40px; - margin: 0 auto; - - span { - visibility: hidden; - } +.page_with_header .logo { + height: 40px; } input[type="submit"], @@ -647,9 +637,7 @@ article[data-vim-selected].category-social { } @media screen and (max-width: @tablet) { - #main_preferences, - #main_about, - #main_stats { + .page_with_header { margin: 2rem 0.5rem; width: auto; } diff --git a/searx/templates/simple/about.html b/searx/templates/simple/about.html index 9f6a10ced..f6a0a96a9 100644 --- a/searx/templates/simple/about.html +++ b/searx/templates/simple/about.html @@ -1,4 +1,4 @@ -{% extends 'simple/base.html' %} +{% extends 'simple/page_with_header.html' %} {% block content %} {{ help.about | safe }} {% include "__common__/aboutextend.html" ignore missing %} diff --git a/searx/templates/simple/base.html b/searx/templates/simple/base.html index bb1f51cad..548710310 100644 --- a/searx/templates/simple/base.html +++ b/searx/templates/simple/base.html @@ -35,7 +35,7 @@ -
+
{% if errors %} {% endif %} + {% block header %} + {% endblock %} {% block content %} {% endblock %}
diff --git a/searx/templates/simple/page_with_header.html b/searx/templates/simple/page_with_header.html new file mode 100644 index 000000000..d4466b612 --- /dev/null +++ b/searx/templates/simple/page_with_header.html @@ -0,0 +1,5 @@ +{% set body_class = "page_with_header" %} +{% extends "simple/base.html" %} +{% block header %} + +{% endblock %} diff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.html index 898221166..6b21afee4 100644 --- a/searx/templates/simple/preferences.html +++ b/searx/templates/simple/preferences.html @@ -1,7 +1,7 @@ {% from 'simple/macros.html' import tabs_open, tabs_close, tab_header, tab_footer, checkbox_onoff, checkbox %} {% from 'simple/icons.html' import icon_big %} -{% extends "simple/base.html" %} +{% extends "simple/page_with_header.html" %} {%- macro plugin_preferences(section) -%} {%- for plugin in plugins -%} @@ -95,10 +95,7 @@ {% block head %} {% endblock %} {% block content %} - -

SearXNG

- -

{{ _('Preferences') }}

+

{{ _('Preferences') }}

diff --git a/searx/templates/simple/stats.html b/searx/templates/simple/stats.html index 1e905790a..f45f5b260 100644 --- a/searx/templates/simple/stats.html +++ b/searx/templates/simple/stats.html @@ -1,7 +1,7 @@ {% from 'simple/icons.html' import icon_big %} {% from '__common__/new_issue.html' import new_issue with context %} -{% extends "simple/base.html" %} +{% extends "simple/page_with_header.html" %} {%- macro th_sort(column_order, column_name) -%} {% if selected_engine_name %} @@ -15,10 +15,7 @@ {% block head %} {% endblock %} {% block content %} - -

SearXNG

- -

{% if selected_engine_name %}{% endif %}{{ _('Engine stats') }}{% if selected_engine_name %} - {{ selected_engine_name }}{% endif %}

+

{% if selected_engine_name %}{% endif %}{{ _('Engine stats') }}{% if selected_engine_name %} - {{ selected_engine_name }}{% endif %}

{% if not engine_stats.get('time') %} {{ _('There is currently no data available. ') }} From 79dbbd4d99dcb28e709c7bca703ee97b6d55f906 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Sun, 30 Jan 2022 09:41:27 +0100 Subject: [PATCH 2/2] [build] /static --- .../themes/simple/css/searxng-rtl.min.css | Bin 58210 -> 57999 bytes .../themes/simple/css/searxng-rtl.min.css.map | Bin 95126 -> 94814 bytes .../static/themes/simple/css/searxng.min.css | Bin 57183 -> 56972 bytes .../themes/simple/css/searxng.min.css.map | Bin 93519 -> 93207 bytes searx/static/themes/simple/js/searxng.min.js | Bin 26292 -> 26292 bytes 5 files changed, 0 insertions(+), 0 deletions(-) diff --git a/searx/static/themes/simple/css/searxng-rtl.min.css b/searx/static/themes/simple/css/searxng-rtl.min.css index 3bc54082ceee8d1bd2c809ba7b1232e26bef9c17..a3922584677474f9b0a513beacf1fddc08bdb807 100644 GIT binary patch delta 95 zcmaEKjJf|P^M(oA1@#IN(^KQiGfOh!Gg1>%Qi~?<-2O=!LsUU8CqF&EIwLhRJ)^|R V#Gs&JbKy=ySxoJlPhXqP0|1%IC)of1 delta 223 zcmeA_%KYdU^M(oAHI;J{GxOpTlk!VTbRg`4qSUn1qSU&(Gt)CltV|3FDy(x8 zi_$amtPB(qOH1-6Uz{PVn_;L>T#%TDY`Owethy|-I5R0TC$pr|DkC!`B{gsJwjGAD M#5;5IkE_#p03{Y!@c;k- diff --git a/searx/static/themes/simple/css/searxng-rtl.min.css.map b/searx/static/themes/simple/css/searxng-rtl.min.css.map index 6b80099b3bc3e3f3ae8cdd5ed2f32a345ca2b44e..3c7f557ac8a3f4ff496f34d80f5bb6e19080d23a 100644 GIT binary patch delta 1117 zcmZWo&ubGw6lM$6OH(RRy;uoCL2&FZw>43r%xrg)&AOT0q)APhriPmC=GSJEwn-Wh zya>gM=zzU>=|3RNp$Gp2{{ltSgXmGgntD=+_^k@4suK zF$L5R`K=vJbP<$n1TcgUX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AKazsbUUDnO)v19(ONp2=?;~%(f0$omd>ObgQzq532Sqscusrs?A|Ty gi-l!XzT5X6czuuVc_9~(PQNH>{HXIS@!zyJUM diff --git a/searx/static/themes/simple/css/searxng.min.css b/searx/static/themes/simple/css/searxng.min.css index cd4eb87cc2e4bad896b064026907b849adbf4466..bbda942a178140c0c739b42e3270c2b233078474 100644 GIT binary patch delta 95 zcmcb=kGW?r^M8bJMnI#$V8L5dWsYR1FZ~vr>A*!I4lb@bnospWEo>5|D VVo*@AIeVvpET;C&N3PB00050#C#e7c delta 237 zcmeC#%Y1(y^M` z781-bL>5-aFr2JCP0utbF*!TED8Do>MYlM!D%C1EKd%I6vUP4|o^D2JW_m`6m5D(? zg>`OXQF>;cm4QNHX-WR%jWdLGGYl1q3lj6t3HV%6jv$*gw#~61cIpwph^gie&LpwNJw{%lRCz|bJC+WB^pHc7*P z7?4mmbVD~5#E!_&g?|B9Q7Z;E#(Ruh?Yvz&|r6Dq3bZ1T)1 zR3O86dNR=9WilMhVM!a>s~cm5xz!bqq>js26MkfXlcF46WT@8#Pw6&pz(kA*Lb}+G zJ-CRi5I?p~Z<}vJPRi%rOVOceh6biOQfASlQ>lkHm(p=iVyogvnr2e}UN2?i zo;O3Xs@Ijq$uOB%r{oc{yRj->W_EWH8W}Lu9f5`=hL#b8RRpXURG4rX9;riJ0UbmZ zGNKI&VJRb2w3zzd_~`fa#=Su%>6O#*GIMD$s|rdyi$>%NTa%h=(|6iA=n>NKK6|=^ zRMKEiZzphT_u_% zZKR1g5!qt6n_tBiJ$(LgVyS|}0_r$Yq0!u#)UGo~=d?|{&)=?u?w+`cdb^X7Ys@4z zx=gq8g)2&1;V1AdudOW9Ss}v}5KDDrjKmxbL?`VgTJ;5JG7m2mX>eRnJZRFw#+M1l zL1MTD?l{Bg%?||r7Rr}1w&WOG-XC|CJODPoS^@o28!IP<3r)ZV7d*wZQ z+b$JfmfFX6 zyNR7vzzK<;hiW8z4(4U^Hv_!aSo#{!6rs^@z|bL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