Consolidate Item Types, Users, and Settings into one Settings section

The navbar previously listed Item Types, Users, and Settings as three
separate top-level links. They now live under a single "Settings" entry
in the navbar, backed by one unified section with a left sub-nav (General,
Item Types, Users) shared across all three areas so it reads as one
settings panel rather than three disconnected admin pages.

- New templates/partials/settings_nav.html shared sub-nav, included by
  settings.html, itemtypes_list/form.html, and users_list/form.html.
- Routes moved under /settings/: /item-types* -> /settings/item-types*,
  /users* -> /settings/users*. All redirects, form actions, and the
  item-type custom-field JS base action updated to match.
This commit is contained in:
Owen
2026-08-17 15:30:50 -05:00
parent 4ceb1cbc03
commit 62bdcb2428
10 changed files with 186 additions and 135 deletions
+4 -4
View File
@@ -50,7 +50,7 @@ func (a *App) handleUserCreate(w http.ResponseWriter, r *http.Request) {
a.Render(w, http.StatusBadRequest, "users_form", userFormData{User: currentUser(r), EditUser: u, Error: err.Error()})
return
}
http.Redirect(w, r, "/users", http.StatusSeeOther)
http.Redirect(w, r, "/settings/users", http.StatusSeeOther)
}
func (a *App) handleUserEditForm(w http.ResponseWriter, r *http.Request) {
@@ -92,7 +92,7 @@ func (a *App) handleUserUpdate(w http.ResponseWriter, r *http.Request) {
a.Render(w, http.StatusBadRequest, "users_form", userFormData{User: currentUser(r), EditUser: u, Error: err.Error()})
return
}
http.Redirect(w, r, "/users", http.StatusSeeOther)
http.Redirect(w, r, "/settings/users", http.StatusSeeOther)
}
func (a *App) handleUserPassword(w http.ResponseWriter, r *http.Request) {
@@ -111,7 +111,7 @@ func (a *App) handleUserPassword(w http.ResponseWriter, r *http.Request) {
a.Log.Warn("set password failed", "error", err)
}
}
http.Redirect(w, r, "/users/"+strconv.FormatInt(id, 10)+"/edit", http.StatusSeeOther)
http.Redirect(w, r, "/settings/users/"+strconv.FormatInt(id, 10)+"/edit", http.StatusSeeOther)
}
func (a *App) handleUserDelete(w http.ResponseWriter, r *http.Request) {
@@ -123,5 +123,5 @@ func (a *App) handleUserDelete(w http.ResponseWriter, r *http.Request) {
if err := a.Users.Delete(r.Context(), id); err != nil {
a.Log.Warn("delete user failed", "error", err)
}
http.Redirect(w, r, "/users", http.StatusSeeOther)
http.Redirect(w, r, "/settings/users", http.StatusSeeOther)
}