]> git.plutz.net Git - rawnet/blobdiff - index.cgi
basic styling
[rawnet] / index.cgi
index fe324147c3ac60ce75dfd95067ec6ca7aece9862..1a8914de810937ad190990855392245b46bd86ba 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -20,22 +20,26 @@ yield_page(){
   printf '%s\r\n' 'Content-Type: text/html; charset=utf-8' \
                   "Content-Security-Policy: script-src 'none'" \
                   ''
-  { printf '[html
-    [head
-      [meta name="viewport" content="width=device-width"]
-      [link rel="stylesheet" type="text/css" href="%s/cgilite/common.css"]
-      [link rel="stylesheet" type="text/css" href="%s/rawnet.css"]
-      [title %s]
-    ] [body class="%s"
-  ' "$_BASE" "$_BASE" "$(HTML "$title")" "$page"
-  printf '
-      [header
-        [form method=POST action="%s/search/"
-          [input name=search placeholder="Search"]
-        ]
-      ]' "$_BASE"
+  { cat <<-EOF
+       [!DOCTYPE HTML]
+       [html [head
+         [meta name="viewport" content="width=device-width"]
+         [link rel="stylesheet" type="text/css" href="$_BASE/cgilite/common.css"]
+         [link rel="stylesheet" type="text/css" href="$_BASE/rawnet.css"]
+         [title . $(HTML "$title")]
+       ] [body class="$page"
+         [header
+           [form method=POST action="$_BASE/search/"
+             [input name=search placeholder="Search"]
+           ]
+           $( [ ! "$USER_ID" ] \
+               && printf '[div #user_login [a href="%s/login/" Login]]' "$_BASE" \
+               || w_user_login
+            )
+         ][main
+       EOF
   cat
-  printf '] ]'
+  printf ']]]'
   } |"$_EXEC/cgilite/html-sh.sed" -u
 }