X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=themes%2Fdefault.sh;h=3c5a87fcb57a1ce56a0f4061070a1f8ab4e9bc2e;hb=2ad6da3df5555069e13d2c5c6f39b5d3a4d8071d;hp=563ea3afdbd8676a428bbb3b3fec30a57bff680e;hpb=2c724512b2e744027ae0a43d571f2e0c9fd820f3;p=shellwiki
diff --git a/themes/default.sh b/themes/default.sh
index 563ea3a..3c5a87f 100755
--- a/themes/default.sh
+++ b/themes/default.sh
@@ -25,16 +25,17 @@ theme_pagemenu(){
local page="$1"
if acl_write "$page"; then
- printf '
-
'
+ cat <<-EOF
+
+ EOF
fi
}
@@ -74,19 +75,22 @@ theme_editor(){
[ "$template" ] && acl_read "$template" || template="$page"
theme_page - "Editor: $title" <<-EOF
-
+
$(for file in "$_EXEC/pages/${page%/:$LANGUAGE/}/#attachments"/* "$_DATA/pages/${page%/:$LANGUAGE/}/#attachments"/*; do
[ "$file" = "$_EXEC/pages/${page%/:$LANGUAGE/}/#attachments/${file##*/}" \
-a -f "$_DATA/pages/${page%/:$LANGUAGE/}/#attachments/${file##*/}" ] && continue
@@ -95,16 +99,19 @@ theme_editor(){
*.[pP][nN][gG]|*.[jJ][pP][gG]|*.[jJ][pP][eE][gG]|*.[gG][iI][fF])
[ "$page" != "${page%/:$LANGUAGE/}" ] && p=../ || p=''
att="$(HTML "${file##*/}")"
- printf '
![](%s)
- [%s]([attachment]/%s)
- [![%s](%s)]([attachment]/%s)
' \
+ printf '
![](%s)
- [%s]([attachment]/%s)
- [![%s](%s)]([attachment]/%s)
' \
"$p" "$att" "$att" "$att" "$att" "$att" "$att" "$att"
;;
*)
att="$(HTML "${file##*/}")"
- printf '
[%s](%s)
' "$att" "$att"
+ printf '
[%s](%s)
' "$att" "$att"
;;
esac
done)
+ $(if [ "$LANGUAGE_DEFAULT" -a "$LANGUAGE_DEFAULT" != "$LANGUAGE" ]; then
+ printf '
%s
' "$(LANGUAGE='' wiki_text "${page%/:$LANGUAGE/}" |HTML)"
+ fi)
EOF
}
@@ -115,21 +122,21 @@ theme_attachments(){
title="${page%/}"; title="${title##*/}"
if acl_write "$page"; then
- theme_page - "Attachments: $title" <<-EOF
+ theme_page - "$(_ Attachments): $title" <<-EOF
EOF
else
- theme_page - "Attachments: $title" <<-EOF
+ theme_page - "$(_ Attachments): $title" <<-EOF
$(for file in "$_EXEC/pages/$page/#attachments"/* "$_DATA/pages/$page/#attachments"/*; do
[ "$file" = "$_EXEC/pages/$page/#attachments/${file##*/}" \