simple message/error display
authorPaul Hänsch <paul@plutz.net>
Tue, 14 May 2019 15:08:15 +0000 (17:08 +0200)
committerPaul Hänsch <paul@plutz.net>
Tue, 14 May 2019 15:08:15 +0000 (17:08 +0200)
index.cgi
style.css

index 3008c7d..f187439 100755 (executable)
--- 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"
index e466cb7..e8d385a 100644 (file)
--- 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; }