From 1b387eb8328aaf5a9ddf21cd71892d92444bbffa Mon Sep 17 00:00:00 2001 From: Tobias Gleiter Date: Sat, 22 Aug 2026 13:59:44 -0400 Subject: [PATCH 01/15] refactor: /equipment search uses equipment url directly. For this, I rm the fragment endpoint which is now handled inside the getEquipment handler. This is necessary to bookmark search urls and hyperlink them later in the dashboard #47 --- cmd/web/handlers:equipment.go | 70 ++++++------------- cmd/web/routes.go | 1 - internal/assets/dist/index.css | 4 ++ internal/templates/pages/equipment/index.tmpl | 10 +-- 4 files changed, 30 insertions(+), 55 deletions(-) diff --git a/cmd/web/handlers:equipment.go b/cmd/web/handlers:equipment.go index 539d88f..27dcf29 100644 --- a/cmd/web/handlers:equipment.go +++ b/cmd/web/handlers:equipment.go @@ -90,11 +90,6 @@ func (app *application) getEquipment(w http.ResponseWriter, r *http.Request) *ht return httperr.BadRequest(err) } - cats, err := app.services.equipmentcategories.List(ctx, id) - if err != nil { - return httperr.InternalServerError(err) - } - qs := r.URL.Query() query := qs.Get("q") category := qs.Get("category") @@ -105,16 +100,11 @@ func (app *application) getEquipment(w http.ResponseWriter, r *http.Request) *ht page = 1 } - f := pagination.Filters{ - Page: page, - PageSize: 25, - } - items, meta, err := app.services.equipment.List(ctx, equipment.ListParams{ OrgID: id, Query: query, Category: category, - Filters: f, + Filters: pagination.Filters{Page: page, PageSize: 25}, }) if err != nil { return httperr.InternalServerError(err) @@ -122,59 +112,39 @@ func (app *application) getEquipment(w http.ResponseWriter, r *http.Request) *ht app.resolveEquipmentURLs(items) - data := app.html.TemplateData(r) - data.Data = equipmentData{ - OrgID: id, - Categories: cats, - Inventories: items, - Filtered: query != "" || category != "", - Query: query, - Category: category, - Sort: sort, - PageBaseURL: template.URL(equipmentPageURL(id, query, category, sort)), // #nosec G203 - PrintURL: template.URL(equipmentPrintURL(id, query, category, sort)), // #nosec G203 - Pagination: meta, - } - return app.html.Render(w, r, http.StatusOK, pages.Equipment, data) -} - -func (app *application) getEquipmentSearchFragment(w http.ResponseWriter, r *http.Request) *httperr.Error { - ctx := r.Context() - id, err := uid.Parse(r.PathValue("org_id")) - if err != nil { - return httperr.BadRequest(err) - } - - qs := r.URL.Query() - query := qs.Get("q") - category := qs.Get("category") - - f := pagination.Filters{ - Page: 1, - PageSize: 25, + // HTMX live-search: return only the table rows fragment so the page URL + // update (hx-push-url) reflects the current filters without a full reload. + if htmx.IsRequest(r) { + data := app.html.TemplateData(r) + data.Data = equipmentData{ + OrgID: id, + Inventories: items, + Filtered: query != "" || category != "", + Query: query, + Category: category, + } + return app.html.RenderFragment(w, r, http.StatusOK, fragments.EquipmentSearch, data) } - items, _, err := app.services.equipment.List(ctx, equipment.ListParams{ - OrgID: id, - Query: query, - Category: category, - Filters: f, - }) + cats, err := app.services.equipmentcategories.List(ctx, id) if err != nil { return httperr.InternalServerError(err) } - app.resolveEquipmentURLs(items) - data := app.html.TemplateData(r) data.Data = equipmentData{ OrgID: id, + Categories: cats, Inventories: items, Filtered: query != "" || category != "", Query: query, Category: category, + Sort: sort, + PageBaseURL: template.URL(equipmentPageURL(id, query, category, sort)), // #nosec G203 + PrintURL: template.URL(equipmentPrintURL(id, query, category, sort)), // #nosec G203 + Pagination: meta, } - return app.html.RenderFragment(w, r, http.StatusOK, fragments.EquipmentSearch, data) + return app.html.Render(w, r, http.StatusOK, pages.Equipment, data) } type equipmentItemData struct { diff --git a/cmd/web/routes.go b/cmd/web/routes.go index ef4c708..cf630ed 100644 --- a/cmd/web/routes.go +++ b/cmd/web/routes.go @@ -106,7 +106,6 @@ func (app *application) routes() (http.Handler, error) { mux.Handle("GET /orgs/{org_id}/equipment/{id}/content", app.withLogin(app.withPermission(app.html.Handle(app.getEquipmentContent)))) mux.Handle("POST /orgs/{org_id}/equipment/{id}/content", app.withLogin(app.withPermission(app.html.Handle(app.postEquipmentAssignContent)))) mux.Handle("POST /orgs/{org_id}/equipment/{id}/content/{content_id}/delete", app.withLogin(app.withPermission(app.html.Handle(app.postEquipmentRemoveContent)))) - mux.Handle("GET /orgs/{org_id}/equipment/search", app.withLogin(app.withPermission(app.html.Handle(app.getEquipmentSearchFragment)))) mux.Handle("GET /orgs/{org_id}/equipment/{id}/part-of", app.withLogin(app.withPermission(app.html.Handle(app.getEquipmentPartOfFragment)))) mux.Handle("GET /orgs/{org_id}/currency", app.withLogin(app.withPermission(app.html.Handle(app.getOrgCurrencyFragment)))) mux.Handle("GET /orgs/{org_id}/equipment-categories", app.withLogin(app.withPermission(app.html.Handle(app.getEquipmentCategoriesFragment)))) diff --git a/internal/assets/dist/index.css b/internal/assets/dist/index.css index 0238ba9..0678586 100644 --- a/internal/assets/dist/index.css +++ b/internal/assets/dist/index.css @@ -20,6 +20,7 @@ --color-white: #fff; --spacing: 0.25rem; --container-xs: 20rem; + --container-sm: 24rem; --container-md: 28rem; --container-lg: 32rem; --container-xl: 36rem; @@ -6816,6 +6817,9 @@ .max-w-md { max-width: var(--container-md); } + .max-w-sm { + max-width: var(--container-sm); + } .max-w-xl { max-width: var(--container-xl); } diff --git a/internal/templates/pages/equipment/index.tmpl b/internal/templates/pages/equipment/index.tmpl index 1bd9ea1..8ebb0dc 100644 --- a/internal/templates/pages/equipment/index.tmpl +++ b/internal/templates/pages/equipment/index.tmpl @@ -73,30 +73,32 @@ name="q" placeholder="Search name or serial number…" {{ if $.Data.Query }}value="{{ $.Data.Query }}"{{ end }} - hx-get="/orgs/{{ .Data.OrgID }}/equipment/search" + hx-get="/orgs/{{ .Data.OrgID }}/equipment" hx-trigger="input changed delay:300ms" hx-target="#equipment-rows" hx-swap="innerHTML" hx-include="[name='category']" hx-indicator="#search-indicator" + hx-push-url="true" /> - + {{/* Table */}} @@ -107,7 +109,7 @@ Name Category - Stock +Stock Actions From 19edf0447fc8735b15ad9d88e657cb3dfb1fea07 Mon Sep 17 00:00:00 2001 From: Tobias Gleiter Date: Sat, 22 Aug 2026 14:01:43 -0400 Subject: [PATCH 02/15] style: remove equipment header and stats from equipment page #48 --- internal/assets/dist/index.css | 3 --- internal/templates/pages/equipment/index.tmpl | 9 --------- 2 files changed, 12 deletions(-) diff --git a/internal/assets/dist/index.css b/internal/assets/dist/index.css index 0678586..c926efc 100644 --- a/internal/assets/dist/index.css +++ b/internal/assets/dist/index.css @@ -6817,9 +6817,6 @@ .max-w-md { max-width: var(--container-md); } - .max-w-sm { - max-width: var(--container-sm); - } .max-w-xl { max-width: var(--container-xl); } diff --git a/internal/templates/pages/equipment/index.tmpl b/internal/templates/pages/equipment/index.tmpl index 8ebb0dc..16b7066 100644 --- a/internal/templates/pages/equipment/index.tmpl +++ b/internal/templates/pages/equipment/index.tmpl @@ -53,15 +53,6 @@ - {{/* Stats row */}} -
- - {{ .Data.Pagination.TotalRecords }}item{{ if gt .Data.Pagination.TotalRecords 1 }}s{{ end }} - - - {{ len .Data.Categories }}categor{{ if gt (len .Data.Categories) 1 }}ies{{ else }}y{{ end }} - -
{{/* Toolbar */}} From 343570ffbba666704a0581a066f8308c614e955d Mon Sep 17 00:00:00 2001 From: Tobias Gleiter Date: Sat, 22 Aug 2026 14:21:45 -0400 Subject: [PATCH 03/15] style: move search and filter bar into header box. Add FAB for mobile #48 --- internal/assets/dist/index.css | 19 ++- internal/templates/pages/equipment/index.tmpl | 108 ++++++++++-------- 2 files changed, 79 insertions(+), 48 deletions(-) diff --git a/internal/assets/dist/index.css b/internal/assets/dist/index.css index c926efc..8155f9b 100644 --- a/internal/assets/dist/index.css +++ b/internal/assets/dist/index.css @@ -20,7 +20,6 @@ --color-white: #fff; --spacing: 0.25rem; --container-xs: 20rem; - --container-sm: 24rem; --container-md: 28rem; --container-lg: 32rem; --container-xl: 36rem; @@ -7077,6 +7076,9 @@ .items-start { align-items: flex-start; } + .items-stretch { + align-items: stretch; + } .justify-between { justify-content: space-between; } @@ -10078,6 +10080,11 @@ line-height: var(--tw-leading, var(--text-3xl--line-height)); } } + .sm\:flex { + @media (width >= 40rem) { + display: flex; + } + } .sm\:hidden { @media (width >= 40rem) { display: none; @@ -10098,6 +10105,11 @@ width: auto; } } + .sm\:flex-none { + @media (width >= 40rem) { + flex: none; + } + } .sm\:alert-horizontal { @media (width >= 40rem) { @layer daisyui.l1.l2 { @@ -10127,6 +10139,11 @@ flex-direction: row; } } + .sm\:items-center { + @media (width >= 40rem) { + align-items: center; + } + } .sm\:items-start { @media (width >= 40rem) { align-items: flex-start; diff --git a/internal/templates/pages/equipment/index.tmpl b/internal/templates/pages/equipment/index.tmpl index 16b7066..5a46b7a 100644 --- a/internal/templates/pages/equipment/index.tmpl +++ b/internal/templates/pages/equipment/index.tmpl @@ -7,16 +7,47 @@
{{/* Header block */}} -
-
-
- Your Gear -

All Items

+
+
+
+ + +
-
+
- {{/* Toolbar */}} -
- - - -
- {{/* Table */}}
@@ -100,7 +94,7 @@ - + @@ -163,4 +157,24 @@ {{ template "photo-viewer-dialog" . }} + +{{/* FAB: Mobile only */}} +
+
+ {{ template "dot-menu-icon" . }} +
+ + {{ template "add-icon" . }} + + + {{ template "import-icon" . }} + + + + {{ template "print-icon" . }} + +
+ {{ end }} From e6a80396b77b52f9abdec7655b0fe33ba25f842d Mon Sep 17 00:00:00 2001 From: Tobias Gleiter Date: Sat, 22 Aug 2026 14:28:49 -0400 Subject: [PATCH 04/15] style: add quicklink for content tab when type kit for faster navigation and removed bulk / serialized label from name #45 --- internal/assets/dist/index.css | 13 ------------- internal/templates/fragments/equipment-search.tmpl | 8 +++++--- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/internal/assets/dist/index.css b/internal/assets/dist/index.css index 8155f9b..818811c 100644 --- a/internal/assets/dist/index.css +++ b/internal/assets/dist/index.css @@ -7076,9 +7076,6 @@ .items-start { align-items: flex-start; } - .items-stretch { - align-items: stretch; - } .justify-between { justify-content: space-between; } @@ -10090,11 +10087,6 @@ display: none; } } - .sm\:inline { - @media (width >= 40rem) { - display: inline; - } - } .sm\:w-64 { @media (width >= 40rem) { width: calc(var(--spacing) * 64); @@ -10105,11 +10097,6 @@ width: auto; } } - .sm\:flex-none { - @media (width >= 40rem) { - flex: none; - } - } .sm\:alert-horizontal { @media (width >= 40rem) { @layer daisyui.l1.l2 { diff --git a/internal/templates/fragments/equipment-search.tmpl b/internal/templates/fragments/equipment-search.tmpl index be421fb..ce7685f 100644 --- a/internal/templates/fragments/equipment-search.tmpl +++ b/internal/templates/fragments/equipment-search.tmpl @@ -13,9 +13,6 @@ - @@ -47,7 +46,6 @@ - {{ end }} From b16c27c9ab03c36be6b304d78628cb59007b5278 Mon Sep 17 00:00:00 2001 From: Tobias Gleiter Date: Sat, 22 Aug 2026 14:41:52 -0400 Subject: [PATCH 07/15] refactor: sort by name and category to group items visually without adding extra filter complexity #17 --- internal/database/queries/gen/equipment/equipment.sql.go | 2 +- internal/database/queries/sqlite/equipment.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/database/queries/gen/equipment/equipment.sql.go b/internal/database/queries/gen/equipment/equipment.sql.go index aceaeb8..cb8dd26 100644 --- a/internal/database/queries/gen/equipment/equipment.sql.go +++ b/internal/database/queries/gen/equipment/equipment.sql.go @@ -361,7 +361,7 @@ WHERE e.org_id = ?1 AND (?2 = '' OR e.name LIKE '%' || ?2 || '%' OR EXISTS (SELECT 1 FROM equipment_serialized_items esi WHERE esi.equipment_id = e.id AND esi.serial_number LIKE '%' || ?2 || '%')) AND (?3 = '' OR ec.name = ?3) AND (?4 = -1 OR e.is_archived = ?4) -ORDER BY e.name ASC +ORDER BY category_name ASC, e.name ASC LIMIT ?6 OFFSET ?5 ` diff --git a/internal/database/queries/sqlite/equipment.sql b/internal/database/queries/sqlite/equipment.sql index cccd9fc..c7d7543 100644 --- a/internal/database/queries/sqlite/equipment.sql +++ b/internal/database/queries/sqlite/equipment.sql @@ -43,7 +43,7 @@ WHERE e.org_id = sqlc.arg(org_id) AND (sqlc.arg(name_query) = '' OR e.name LIKE '%' || sqlc.arg(name_query) || '%' OR EXISTS (SELECT 1 FROM equipment_serialized_items esi WHERE esi.equipment_id = e.id AND esi.serial_number LIKE '%' || sqlc.arg(name_query) || '%')) AND (sqlc.arg(category) = '' OR ec.name = sqlc.arg(category)) AND (sqlc.arg(is_archived) = -1 OR e.is_archived = sqlc.arg(is_archived)) -ORDER BY e.name ASC +ORDER BY category_name ASC, e.name ASC LIMIT sqlc.arg(page_limit) OFFSET sqlc.arg(page_offset); -- name: ListBySerialNumber :many From 2c6871dbdd0ea4b0f531f4dec4a0d753f397b0ba Mon Sep 17 00:00:00 2001 From: Tobias Gleiter Date: Sat, 22 Aug 2026 14:59:09 -0400 Subject: [PATCH 08/15] style: added more dropdown to row with edit and delete equipment for faster deletion --- internal/assets/dist/index.css | 9 +++++ internal/assets/dist/index.js | 19 ++++++++++ .../templates/fragments/equipment-search.tmpl | 36 +++++++++++++++++-- 3 files changed, 61 insertions(+), 3 deletions(-) diff --git a/internal/assets/dist/index.css b/internal/assets/dist/index.css index ee75ceb..7f66763 100644 --- a/internal/assets/dist/index.css +++ b/internal/assets/dist/index.css @@ -6756,6 +6756,9 @@ .w-28 { width: calc(var(--spacing) * 28); } + .w-36 { + width: calc(var(--spacing) * 36); + } .w-40 { width: calc(var(--spacing) * 40); } @@ -7144,12 +7147,18 @@ .overflow-hidden { overflow: hidden; } + .overflow-visible { + overflow: visible; + } .overflow-x-auto { overflow-x: auto; } .overflow-y-auto { overflow-y: auto; } + .overflow-y-visible { + overflow-y: visible; + } .scroll-smooth { scroll-behavior: smooth; } diff --git a/internal/assets/dist/index.js b/internal/assets/dist/index.js index 91b4382..6b7dfb4 100644 --- a/internal/assets/dist/index.js +++ b/internal/assets/dist/index.js @@ -288,6 +288,25 @@ document.addEventListener("click", (e) => { }); })(); +// Reposition dropdown-content as position:fixed when opened so it escapes overflow:auto ancestors. +// Setting .style.* via JS is not subject to CSP style-src restrictions. +document.addEventListener("focusin", (e) => { + const btn = e.target.closest(".dropdown [tabindex][role='button']"); + if (!btn) return; + const menu = btn.parentElement?.querySelector(".dropdown-content"); + if (!menu) return; + const rect = btn.getBoundingClientRect(); + menu.style.position = "fixed"; + menu.style.top = rect.bottom + 4 + "px"; + if (btn.parentElement.classList.contains("dropdown-end")) { + menu.style.left = "auto"; + menu.style.right = window.innerWidth - rect.right + "px"; + } else { + menu.style.right = "auto"; + menu.style.left = rect.left + "px"; + } +}); + // Password show/hide toggle // Trigger: + + + + + + {{ end }} {{ else }} From f8379ce29c0c6bd9022b64062664c23de8b6e6a4 Mon Sep 17 00:00:00 2001 From: Tobias Gleiter Date: Sat, 22 Aug 2026 15:07:22 -0400 Subject: [PATCH 09/15] style: update header to use the same styling as the landing header --- internal/assets/dist/index.css | 6 -- internal/templates/partials/header.tmpl | 104 ++++++++++++------------ 2 files changed, 53 insertions(+), 57 deletions(-) diff --git a/internal/assets/dist/index.css b/internal/assets/dist/index.css index 7f66763..2703d7c 100644 --- a/internal/assets/dist/index.css +++ b/internal/assets/dist/index.css @@ -7147,18 +7147,12 @@ .overflow-hidden { overflow: hidden; } - .overflow-visible { - overflow: visible; - } .overflow-x-auto { overflow-x: auto; } .overflow-y-auto { overflow-y: auto; } - .overflow-y-visible { - overflow-y: visible; - } .scroll-smooth { scroll-behavior: smooth; } diff --git a/internal/templates/partials/header.tmpl b/internal/templates/partials/header.tmpl index b596bc7..c725ad3 100644 --- a/internal/templates/partials/header.tmpl +++ b/internal/templates/partials/header.tmpl @@ -1,58 +1,60 @@ {{ define "header" }} -
-
Name CategoryStockStock Actions
{{ .Name }} -
- {{ .TrackingType.Label }} -
{{ if .CategoryName }} @@ -29,6 +26,11 @@
- +
Name CategoryStock Rental Price
{{ .CategoryName }}
+ + + + + + + + + + {{ if .Data.Inventories }} {{ range .Data.Inventories }} @@ -87,5 +99,29 @@ +{{ end }} + +
NameCategoryStockActions
+
+{{ with .Data.Pagination }} +{{ if gt .LastPage 1 }} +
+ + Page {{ .CurrentPage }} of {{ .LastPage }} + +
+ « + » +
+
+{{ end }} {{ end }} {{ end }} diff --git a/internal/templates/pages/equipment/index.tmpl b/internal/templates/pages/equipment/index.tmpl index b99fe45..0021190 100644 --- a/internal/templates/pages/equipment/index.tmpl +++ b/internal/templates/pages/equipment/index.tmpl @@ -19,7 +19,7 @@ {{ if $.Data.Query }}value="{{ $.Data.Query }}"{{ end }} hx-get="/orgs/{{ .Data.OrgID }}/equipment" hx-trigger="input changed delay:300ms" - hx-target="#equipment-rows" + hx-target="#equipment-results" hx-swap="innerHTML" hx-include="[name='category']" hx-indicator="#search-indicator" @@ -31,7 +31,7 @@ class="select w-full sm:w-auto" hx-get="/orgs/{{ .Data.OrgID }}/equipment" hx-trigger="change" - hx-target="#equipment-rows" + hx-target="#equipment-results" hx-swap="innerHTML" hx-include="[name='q']" hx-indicator="#search-indicator" @@ -86,47 +86,11 @@
- {{/* Table */}} -
- - - - - - - - - - - - {{ template "equipment-search" . }} - -
NameCategoryStockActions
+ {{/* Table + Pagination */}} +
+ {{ template "equipment-search" . }}
- {{/* Pagination */}} - {{ with .Data.Pagination }} - {{ if gt .LastPage 1 }} -
- - Page {{ .CurrentPage }} of {{ .LastPage }} - -
- « - » -
-
- {{ end }} - {{ end }} -
{{/* end card */}}
From 1317084a0a439da642e861c27ebffeeba151c3a3 Mon Sep 17 00:00:00 2001 From: Tobias Gleiter Date: Sat, 22 Aug 2026 16:30:53 -0400 Subject: [PATCH 13/15] style: header menu should show user initials #42 --- cmd/web/handlers:settings:account.go | 41 +++++++++++++++++++ cmd/web/routes.go | 3 ++ internal/assets/dist/index.css | 6 +++ .../templates/fragments/account-header.tmpl | 17 ++++++++ internal/templates/fragments/fragments.go | 1 + internal/templates/partials/header.tmpl | 13 ++---- 6 files changed, 72 insertions(+), 9 deletions(-) create mode 100644 internal/templates/fragments/account-header.tmpl diff --git a/cmd/web/handlers:settings:account.go b/cmd/web/handlers:settings:account.go index 83bb1ee..5bf187e 100644 --- a/cmd/web/handlers:settings:account.go +++ b/cmd/web/handlers:settings:account.go @@ -16,12 +16,15 @@ package main import ( "context" + "fmt" "net/http" + "strings" "time" "github.com/bit8bytes/gearberg/internal/accounts" "github.com/bit8bytes/gearberg/internal/httperr" "github.com/bit8bytes/gearberg/internal/sessions" + "github.com/bit8bytes/gearberg/internal/templates/fragments" "github.com/bit8bytes/gearberg/internal/templates/pages" "github.com/bit8bytes/gearberg/pkg/htmx" ) @@ -50,6 +53,44 @@ func (app *application) getAccount(w http.ResponseWriter, r *http.Request) *http return app.html.Render(w, r, http.StatusOK, pages.SettingsAccount, tmplData) } +type accountHeaderData struct { + Email string + Initials string +} + +func accountInitials(email string) string { + local, _, _ := strings.Cut(email, "@") + runes := []rune(local) + switch len(runes) { + case 0: + return "?" + case 1: + return strings.ToUpper(string(runes[0])) + default: + return strings.ToUpper(string(runes[0]) + string(runes[1])) + } +} + +func (app *application) getAccountHeaderFragment(w http.ResponseWriter, r *http.Request) *httperr.Error { + if !htmx.IsRequest(r) { + http.Redirect(w, r, "/", http.StatusSeeOther) + return nil + } + + session := sessions.MustFromRequest(r) + record, err := app.services.accounts.Get(r.Context(), session.AccountID) + if err != nil { + return httperr.InternalServerError(fmt.Errorf("getAccountHeaderFragment: %w", err)) + } + + tmplData := app.html.TemplateData(r) + tmplData.Data = accountHeaderData{ + Email: record.Email, + Initials: accountInitials(record.Email), + } + return app.html.RenderFragment(w, r, http.StatusOK, fragments.AccountHeader, tmplData) +} + func (app *application) deleteAccount(w http.ResponseWriter, r *http.Request) *httperr.Error { ctx := r.Context() diff --git a/cmd/web/routes.go b/cmd/web/routes.go index cf630ed..70c3149 100644 --- a/cmd/web/routes.go +++ b/cmd/web/routes.go @@ -112,6 +112,9 @@ func (app *application) routes() (http.Handler, error) { mux.Handle("GET /orgs/{org_id}/equipment-manufacturers", app.withLogin(app.withPermission(app.html.Handle(app.getEquipmentManufacturersFragment)))) mux.Handle("GET /orgs/{org_id}/warehouse-locations", app.withLogin(app.withPermission(app.html.Handle(app.getEquipmentLocationsFragment)))) + // Account fragments + mux.Handle("GET /account/header", app.withLogin(app.html.Handle(app.getAccountHeaderFragment))) + // Account Settings mux.Handle("GET /settings/account", app.withLogin(app.html.Handle(app.getAccount))) mux.Handle("DELETE /settings/account", app.withLogin(app.html.Handle(app.deleteAccount))) diff --git a/internal/assets/dist/index.css b/internal/assets/dist/index.css index 2703d7c..3f6666e 100644 --- a/internal/assets/dist/index.css +++ b/internal/assets/dist/index.css @@ -6744,6 +6744,9 @@ .w-6 { width: calc(var(--spacing) * 6); } + .w-10 { + width: calc(var(--spacing) * 10); + } .w-14 { width: calc(var(--spacing) * 14); } @@ -6756,6 +6759,9 @@ .w-28 { width: calc(var(--spacing) * 28); } + .w-32 { + width: calc(var(--spacing) * 32); + } .w-36 { width: calc(var(--spacing) * 36); } diff --git a/internal/templates/fragments/account-header.tmpl b/internal/templates/fragments/account-header.tmpl new file mode 100644 index 0000000..a3ae284 --- /dev/null +++ b/internal/templates/fragments/account-header.tmpl @@ -0,0 +1,17 @@ +{{ define "account-header" }} +
+
+
+ {{ .Data.Initials }} +
+
+ {{ .Data.Email }} +
+{{ end }} + +{{ define "account-header-skeleton" }} +
+
+
+
+{{ end }} diff --git a/internal/templates/fragments/fragments.go b/internal/templates/fragments/fragments.go index b6f89dc..3c2512d 100644 --- a/internal/templates/fragments/fragments.go +++ b/internal/templates/fragments/fragments.go @@ -19,6 +19,7 @@ package fragments // Fragment name constants for the HTMX partial templates. const ( + AccountHeader = "account-header" EquipmentCategories = "equipment-categories" EquipmentManufacturers = "equipment-manufacturers" EquipmentPartOf = "equipment-part-of" diff --git a/internal/templates/partials/header.tmpl b/internal/templates/partials/header.tmpl index c725ad3..ddcbab0 100644 --- a/internal/templates/partials/header.tmpl +++ b/internal/templates/partials/header.tmpl @@ -17,15 +17,10 @@