]> git.plutz.net Git - shellwiki/blobdiff - handlers/60_move_rename_delete.sh
list locations in move form
[shellwiki] / handlers / 60_move_rename_delete.sh
index 49651a29d9510255d26ae8662ed5492beb85b39e..eefd9b41b6d77bfcafe9b32d0bb58d983b7d917f 100755 (executable)
@@ -52,7 +52,7 @@ l10n_movepage >/dev/null 2>&1 \
   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>
@@ -68,7 +68,7 @@ l10n_renamepage >/dev/null 2>&1 \
   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>
@@ -125,6 +125,13 @@ else case "${PATH_INFO}" in
       theme_page - <<-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