From c6411db9c8a87e904fe8e0cc0fbfea4c1bdd664e Mon Sep 17 00:00:00 2001 From: juanatsap Date: Mon, 1 Dec 2025 14:18:11 +0000 Subject: [PATCH] chore: consolidate contact templates to single location Remove duplicate contact templates: - templates/partials/contact_success.html (old, 1.2KB) - templates/partials/contact_error.html (old, 1.1KB) The active templates remain in templates/partials/contact/: - contact-success.html - contact-error.html Updated contact.go to use the new template names to match cv_contact.go. The old templates had inline styles and were larger; the new ones use external CSS and are more maintainable. All contact form tests pass (7/7). --- internal/handlers/contact.go | 4 +-- templates/partials/contact_error.html | 31 --------------------- templates/partials/contact_success.html | 36 ------------------------- 3 files changed, 2 insertions(+), 69 deletions(-) delete mode 100644 templates/partials/contact_error.html delete mode 100644 templates/partials/contact_success.html diff --git a/internal/handlers/contact.go b/internal/handlers/contact.go index ed46191..89d2317 100644 --- a/internal/handlers/contact.go +++ b/internal/handlers/contact.go @@ -139,7 +139,7 @@ func (h *ContactHandler) renderSuccess(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/html; charset=utf-8") w.WriteHeader(http.StatusOK) - tmpl, err := h.templates.Render("contact_success.html") + tmpl, err := h.templates.Render("contact-success") if err != nil { log.Printf("ERROR loading success template: %v", err) // Fallback to simple HTML @@ -168,7 +168,7 @@ func (h *ContactHandler) renderError(w http.ResponseWriter, r *http.Request, mes "Message": message, } - tmpl, err := h.templates.Render("contact_error.html") + tmpl, err := h.templates.Render("contact-error") if err != nil { log.Printf("ERROR loading error template: %v", err) // Fallback to simple HTML diff --git a/templates/partials/contact_error.html b/templates/partials/contact_error.html deleted file mode 100644 index 24c38a1..0000000 --- a/templates/partials/contact_error.html +++ /dev/null @@ -1,31 +0,0 @@ - - - diff --git a/templates/partials/contact_success.html b/templates/partials/contact_success.html deleted file mode 100644 index 4ee2b60..0000000 --- a/templates/partials/contact_success.html +++ /dev/null @@ -1,36 +0,0 @@ - - -