Move contacts templates in their own directory

This is what directories are for: namespacing; no need for cumbersome
file name prefixes.
This commit is contained in:
jordi fita mas 2023-02-04 10:48:03 +01:00
parent 2799fdb8db
commit f611162b0e
4 changed files with 3 additions and 3 deletions

View File

@ -25,7 +25,7 @@ func IndexContacts(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
page := &ContactsIndexPage{
Contacts: mustGetContactEntries(r.Context(), conn, company),
}
mustRenderAppTemplate(w, r, "contacts-index.gohtml", page)
mustRenderAppTemplate(w, r, "contacts/index.gohtml", page)
}
func GetContactForm(w http.ResponseWriter, r *http.Request, params httprouter.Params) {
@ -52,11 +52,11 @@ func GetContactForm(w http.ResponseWriter, r *http.Request, params httprouter.Pa
}
func mustRenderNewContactForm(w http.ResponseWriter, r *http.Request, form *contactForm) {
mustRenderAppTemplate(w, r, "contacts-new.gohtml", form)
mustRenderAppTemplate(w, r, "contacts/new.gohtml", form)
}
func mustRenderEditContactForm(w http.ResponseWriter, r *http.Request, form *contactForm) {
mustRenderAppTemplate(w, r, "contacts-edit.gohtml", form)
mustRenderAppTemplate(w, r, "contacts/edit.gohtml", form)
}
func HandleAddContact(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {