X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=themes%2Fdefault.sh;h=5b2f1edd55a261ec566e37820c122af0d8a08313;hb=2506cfcd83b7247d669818e3cdf8d34b0b04404a;hp=eb3d537442c41f90e4202ad47029e186fb6f38da;hpb=08e02da11207d97b7c7d4db58619cdb0a59476e2;p=shellwiki diff --git a/themes/default.sh b/themes/default.sh index eb3d537..5b2f1ed 100755 --- a/themes/default.sh +++ b/themes/default.sh @@ -83,12 +83,11 @@ theme_page(){ } theme_editor(){ - local page="$1" template="$2" title file att - title="$(HTML "${PAGE_TITLE:-"${page}"}")" + local page="$1" template="$2" file att [ "$template" ] && acl_read "$template" || template="$page" - theme_page - "Editor: $title" <<-EOF + theme_page - "$(_ Editor): ${PAGE_TITLE:-"${page}"}" <<-EOF @@ -108,17 +107,21 @@ theme_editor(){ $(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 + att="$(HTML "${file##*/}")" + url="$(printf %s\\n "${file##*/}" |sed 's;[\\<>];\\&;g' |HTML)" + name="$(printf %s\\n "${file##*/}" |sed 's;[]\\[];\\&;g' |HTML)" case ${file##*/} in \*) continue;; *.[pP][nN][gG]|*.[jJ][pP][gG]|*.[jJ][pP][eE][gG]|*.[gG][iI][fF]) [ "$page" != "${page%/:$LANGUAGE/}" ] && p=../ || p='' - att="$(HTML "${file##*/}")" - printf '

![](%s)

' \ - "$p" "$att" "$att" "$att" "$att" "$att" "$att" "$att" + printf '

![](<%s>)

' \ + "$p" "$att" "$url" "$name" "$url" "$name" "$url" "$url" ;; *) - att="$(HTML "${file##*/}")" - printf '

[%s](%s)

' "$att" "$att" + printf '

[%s](<%s>)

' "$name" "$url" ;; esac done) @@ -135,11 +138,11 @@ theme_search(){ local words="$*" # STDIN: read result pages line by line - theme_page - <<-EOF + theme_page - "$(_ Search results): ${words}" <<-EOF

$([ "$words" ] && _ "Search results" || _ "Search" )

    $( while read p; do @@ -151,11 +154,10 @@ theme_search(){ } theme_attachments(){ - local page="$1" title - title="${page%/}"; title="${title##*/}" + local page="$1" if acl_write "$page"; then - theme_page - "$(_ Attachments): $title" <<-EOF + theme_page - "$(_ Attachments): ${PAGE_TITLE:-"${page}"}" <<-EOF

    $(_ Upload)

    @@ -200,7 +202,7 @@ theme_attachments(){
    EOF else - theme_page - "$(_ Attachments): $title" <<-EOF + theme_page - "$(_ Attachments): ${PAGE_TITLE:-"${page}"}" <<-EOF