From ad105acdefe3a76de9abdfd3376527d1960bddc2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Tue, 14 May 2019 17:08:15 +0200 Subject: [PATCH] simple message/error display --- index.cgi | 4 ++++ style.css | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/index.cgi b/index.cgi index 3008c7d..f187439 100755 --- a/index.cgi +++ b/index.cgi @@ -15,6 +15,9 @@ esac; done _PATH="$(PATH "/${PATH_INFO}")" ACTION="$(GET a)" +message="$(COOKIE message)" +[ "$message" ] && SET_COOKIE 0 message='' + yield_page() { local class="$1" style="$2" printf 'Content-Type: text/html; charset=utf-8\r\n\r\n' @@ -30,6 +33,7 @@ yield_page() { ] [body class="%s" ' "$class" cat + [ "$message" ] && printf '[p #message\n%s\n]' $(l10n "$message") printf '] ]' } \ | "${_EXEC}/cgilite/html-sh.sed" diff --git a/style.css b/style.css index e466cb7..e8d385a 100644 --- a/style.css +++ b/style.css @@ -77,6 +77,17 @@ body { background: #FCC; } +#message { + display: block; + position: fixed; + top: 0; width: 100%; + margin: 0; padding: 1em; + text-align: center; + font-weight: bold; + background-color: #FAA; + border: 1px solid #000; + border-style: none none solid none; +} .trailbtn { display: none; } .trailbtn + .trailbox { display: none; } -- 2.39.2