#!/bin/sh
-# Copyright 2022 - 2023 Paul Hänsch
+# Copyright 2022 - 2024 Paul Hänsch
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
cat <<-EOF
<h1>Move Page</h1>
<p class="pageid">$(HTML "${page}")</p>
- <input name="newlocation" value="$(HTML "$location")" placeholder="New Location">
+ <input list="locations" autocomplete="off" name="newlocation" value="$(HTML "$location")" placeholder="New Location">
<ul>
<li>A page with the same name must not already exist at the new location.</li>
<li>You must have permission to create new pages at this location.</li>
cat <<-EOF
<h1>Rename Page</h1>
<p class="pageid">$(HTML "${page}")</p>
- <input name="newname" value="$(HTML "$name")" placeholder="New Name">
+ <input autocomplete="off" name="newname" value="$(HTML "$name")" placeholder="New Name">
<ul>
<li>A page with the new name must not already exist.</li>
<li>You must have permission to create new pages at this location.</li>
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">
+ $(page_glob / -1 |while read loc; do
+ [ "$loc" = "$page" ] && continue
+ acl_write "$loc" || continue
+ printf '\n <option>%s</option>' "$(HTML "$loc")"
+ done)
+ </datalist>
$(l10n_movepage)
</form>
EOF
;;
*/\[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)
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)