X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;ds=sidebyside;f=themes%2Fdefault.sh;h=3c5a87fcb57a1ce56a0f4061070a1f8ab4e9bc2e;hb=a26c541b845f86aa37b872d06ab3bf51e8206be8;hp=d82764bc7bde6b3361b07e4ea3a3af972efa6e6f;hpb=1293c214db032ca473b2b2ff54acd8e3f7e83d0a;p=shellwiki
diff --git a/themes/default.sh b/themes/default.sh
index d82764b..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,47 +99,44 @@ 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
}
-theme_revisions(){
- local page="$1" title
- title="${page%/}"; title="${title##*/}"
-
- "$_EXEC/macros/revisions" "$page" \
- | theme_page - "Revisions: $title"
-}
+theme_revisions(){ theme_page "$@"; }
theme_attachments(){
local page="$1" title
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##*/}" \