]> git.plutz.net Git - lobster/commitdiff
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 3008c7d06dd74edc222cef130c778ac555ad983a..f18743956e9607ce88fe019254b7fd67759c378a 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 e466cb71f9b780af65256da6916e6324595cc4a8..e8d385a8b13bfbe6aff469955b0150da824f7b1c 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; }