X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=themes%2Fdefault.sh;h=0439f0d642421244c6049fa2ef9896389a5e21a5;hb=713a39f5e2b8f99d824273d49e64edb977333f69;hp=6807242cd2d6dd0445e419bd72ae62dfe5834f23;hpb=7213d4e9f90acaa688a17b110f1c17b1e7ca74d3;p=shellwiki
diff --git a/themes/default.sh b/themes/default.sh
index 6807242..0439f0d 100755
--- a/themes/default.sh
+++ b/themes/default.sh
@@ -5,9 +5,9 @@
theme_head(){
local IFS="$BR"
printf '
-
+
'
- for css in "$_BASE/[.]/cgilite/common.css" "$_BASE/[.]/themes/default.css" $PAGE_CSS; do
+ for css in "$_BASE/%5B.%5D/cgilite/common.css" "$_BASE/%5B.%5D/themes/default.css" $PAGE_CSS; do
printf '' \
"$(HTML "${css##*//}")"
done
@@ -27,13 +27,13 @@ theme_pagemenu(){
if acl_write "$page"; then
printf '
'
fi
}
@@ -47,7 +47,7 @@ theme_page(){
cat <<-EOF
-
+
$(theme_head)
${title}
@@ -112,7 +112,8 @@ theme_attachments(){
-
+
+
$(for file in "$_EXEC/pages/$page/#attachments"/* "$_DATA/pages/$page/#attachments"/*; do
[ "$file" = "$_EXEC/pages/$page/#attachments/${file##*/}" \
-a -f "$_DATA/pages/$page/#attachments/${file##*/}" ] && continue
@@ -128,13 +129,16 @@ theme_attachments(){
%s
' \
"$hfile" "$hfile" "$hfile" "$hfile" \
- "$hfile" "$hfile" "$hfile" "$hfile" \
+ "$(slopecode "${file##*/}")" "$hfile" "$hfile" "$hfile" \
"$(size_human "$size")" "$(date -d @"$date" +"%F %T")"
done)
-
-
-
-
+
+
+
+
+
+
+
EOF
else
@@ -167,7 +171,7 @@ theme_error(){
500) printf "%s\r\n" "Status: 500 Internal Server Error";;
esac
- if [ "$(mdfile "/[wiki]/$errno/")" ]; then
+ if mdfile "/[wiki]/$errno/" >&-; then
theme_page "/[wiki]/$errno/"
else
printf "Content-Length: 0\r\n\r\n"