]> git.plutz.net Git - shellwiki/commitdiff
Page titles for special function pages
authorPaul Hänsch <paul@plutz.net>
Tue, 6 Feb 2024 14:55:05 +0000 (15:55 +0100)
committerPaul Hänsch <paul@plutz.net>
Tue, 6 Feb 2024 14:55:05 +0000 (15:55 +0100)
handlers/40_revision.sh
handlers/60_move_rename_delete.sh
themes/default.sh

index af39df36adc8ea66a047b78e42e9d3d406030820..0c70a24dfba0a8f61f66a9707b2fc818df6e94ac 100755 (executable)
@@ -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 '<article class="revision">'; md; printf '</article>'; } \
-      | theme_page - "${page##*/}"
+      | theme_page - "${PAGE_TITLE:-"${page##*/}"} (${rev})"
     )
     fi
     return 0
index eefd9b41b6d77bfcafe9b32d0bb58d983b7d917f..f399e0388bf907cd9cc198d5f0ba6a0280b5c849 100755 (executable)
@@ -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
        <form method=POST id=movepage>
          <input type=hidden name=session_id value="$SESSION_KEY">
          <datalist id="locations">
@@ -139,7 +139,7 @@ else case "${PATH_INFO}" in
     ;;
   */\[rename\])
       name="${page%/}" name="${name##*/}"
-      theme_page - <<-EOF
+      theme_page - "$(_ Rename): ${PAGE_TITLE}"<<-EOF
        <form method=POST id=renamepage>
          <input type=hidden name=session_id value="$SESSION_KEY">
          $(l10n_renamepage)
@@ -148,7 +148,7 @@ else case "${PATH_INFO}" in
       return 0
     ;;
   */\[delete\])
-      theme_page - <<-EOF
+      theme_page - "$(_ Delete): ${PAGE_TITLE}"<<-EOF
        <form method=POST id=deletepage>
          <input type=hidden name=session_id value="$SESSION_KEY">
          $(l10n_deletepage)
index 5979f207895e2f9586abd29947902f160a93d0b9..5b2f1edd55a261ec566e37820c122af0d8a08313 100755 (executable)
@@ -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
        <input checked type=radio class=tab name=edithelp value=edtr id=editor><label for=editor>$(_ Editor)</label>
        <input         type=radio class=tab name=edithelp value=help id=syntax><label for=syntax>$(_ Syntax)</label>
        <input         type=radio class=tab name=edithelp value=att  id=attach><label for=attach>$(_ Attachments)</label>
@@ -139,7 +138,7 @@ theme_search(){
   local words="$*"
   # STDIN: read result pages line by line
 
-  theme_page - <<-EOF
+  theme_page - "$(_ Search results): ${words}" <<-EOF
        <article>
          <h1>$([ "$words" ] && _ "Search results" || _ "Search" )</h1>
          <form class="search" method="GET">
@@ -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
        <form class=upload method=POST enctype="multipart/form-data">
          <h2>$(_ Upload)</h2>
          <input type=hidden name=session_id value="$SESSION_ID">
@@ -204,7 +202,7 @@ theme_attachments(){
        </form>
        EOF
   else
-    theme_page - "$(_ Attachments): $title" <<-EOF
+    theme_page - "$(_ Attachments): ${PAGE_TITLE:-"${page}"}" <<-EOF
        <ul class="attachment list">
        $(for file in "$_EXEC/pages/$page/#attachments"/* "$_DATA/pages/$page/#attachments"/*; do
          [ "$file" = "$_EXEC/pages/$page/#attachments/${file##*/}" \