From dabd1e749abc0fc1fc446e337c3d2a3e8de22c25 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Tue, 6 Feb 2024 15:55:05 +0100 Subject: [PATCH] Page titles for special function pages --- handlers/40_revision.sh | 4 ++-- handlers/60_move_rename_delete.sh | 6 +++--- themes/default.sh | 14 ++++++-------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/handlers/40_revision.sh b/handlers/40_revision.sh index af39df3..0c70a24 100755 --- a/handlers/40_revision.sh +++ b/handlers/40_revision.sh @@ -24,7 +24,7 @@ case "${PATH_INFO}" in theme_error 403 else "$_EXEC/macros/revisions" --list --diff "${page}" \ - | theme_revisions - + | theme_revisions - "$(_ Revisions): ${PAGE_TITLE:-"${page##*/}"}" fi return 0 ;; @@ -41,7 +41,7 @@ case "${PATH_INFO}" in cd "${_DATA}/pages${page}" || cd "${_DATA}/pages/" git -C "${_DATA}" show "${rev}:pages${PATH_INFO}#page.md" \ | { printf '
'; md; printf '
'; } \ - | theme_page - "${page##*/}" + | theme_page - "${PAGE_TITLE:-"${page##*/}"} (${rev})" ) fi return 0 diff --git a/handlers/60_move_rename_delete.sh b/handlers/60_move_rename_delete.sh index eefd9b4..f399e03 100755 --- a/handlers/60_move_rename_delete.sh +++ b/handlers/60_move_rename_delete.sh @@ -122,7 +122,7 @@ if [ "$REQUEST_METHOD" = POST ]; then else case "${PATH_INFO}" in */\[move\]) location="${page%/}" location="${location%/*}/" - theme_page - <<-EOF + theme_page - "$(_ Move): ${PAGE_TITLE}"<<-EOF
@@ -139,7 +139,7 @@ else case "${PATH_INFO}" in ;; */\[rename\]) name="${page%/}" name="${name##*/}" - theme_page - <<-EOF + theme_page - "$(_ Rename): ${PAGE_TITLE}"<<-EOF $(l10n_renamepage) @@ -148,7 +148,7 @@ else case "${PATH_INFO}" in return 0 ;; */\[delete\]) - theme_page - <<-EOF + theme_page - "$(_ Delete): ${PAGE_TITLE}"<<-EOF $(l10n_deletepage) diff --git a/themes/default.sh b/themes/default.sh index 5979f20..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 @@ -139,7 +138,7 @@ theme_search(){ local words="$*" # STDIN: read result pages line by line - theme_page - <<-EOF + theme_page - "$(_ Search results): ${words}" <<-EOF

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

@@ -155,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)

@@ -204,7 +202,7 @@ theme_attachments(){ EOF else - theme_page - "$(_ Attachments): $title" <<-EOF + theme_page - "$(_ Attachments): ${PAGE_TITLE:-"${page}"}" <<-EOF
    $(for file in "$_EXEC/pages/$page/#attachments"/* "$_DATA/pages/$page/#attachments"/*; do [ "$file" = "$_EXEC/pages/$page/#attachments/${file##*/}" \ -- 2.39.2