From 000a2e506e6f456a8c7b3adf6da4048828ef518a Mon Sep 17 00:00:00 2001 From: jordi fita mas Date: Wed, 16 Aug 2023 10:42:05 +0200 Subject: [PATCH] =?UTF-8?q?Add=20tabs=20to=20=E2=80=9Ccompany=20settings?= =?UTF-8?q?=E2=80=9D=20pages=20to=20link=20each=20other?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I realized that tax details, campsite types, and campsites pages are all part of the settings of the company, in the sense that all of them are set up by a company administrator, and should be under the same item in the user menu. The template for these tabs is in the same layout.gohtml file because i did not want to repeat the tabs everywhere it were used, or i would forget some of them when adding new tabs, and did not want to add a new file just for that. --- web/templates/admin/campsite/form.gohtml | 1 + web/templates/admin/campsite/index.gohtml | 1 + web/templates/admin/campsite/type/form.gohtml | 1 + web/templates/admin/campsite/type/index.gohtml | 1 + web/templates/admin/layout.gohtml | 16 ++++++++++++++++ web/templates/admin/taxDetails.gohtml | 1 + 6 files changed, 21 insertions(+) diff --git a/web/templates/admin/campsite/form.gohtml b/web/templates/admin/campsite/form.gohtml index 19ffde6..e85b515 100644 --- a/web/templates/admin/campsite/form.gohtml +++ b/web/templates/admin/campsite/form.gohtml @@ -13,6 +13,7 @@ {{ define "content" -}} {{- /*gotype: dev.tandem.ws/tandem/camper/pkg/campsite.campsiteForm*/ -}} + {{ template "settings-tabs" "campsites" }}
{{( pgettext "Add Campsite" "action" )}}

{{( pgettext "Campsites" "title" )}}

{{ if .Campsites -}} diff --git a/web/templates/admin/campsite/type/form.gohtml b/web/templates/admin/campsite/type/form.gohtml index 765acac..8758369 100644 --- a/web/templates/admin/campsite/type/form.gohtml +++ b/web/templates/admin/campsite/type/form.gohtml @@ -13,6 +13,7 @@ {{ define "content" -}} {{- /*gotype: dev.tandem.ws/tandem/camper/pkg/campsite/types.typeForm*/ -}} + {{ template "settings-tabs" "campsiteTypes" }} {{( pgettext "Add Type" "action" )}}

{{( pgettext "Campsite Types" "title" )}}

{{ if .Types -}} diff --git a/web/templates/admin/layout.gohtml b/web/templates/admin/layout.gohtml index 5920538..6d30610 100644 --- a/web/templates/admin/layout.gohtml +++ b/web/templates/admin/layout.gohtml @@ -56,3 +56,19 @@ + +{{ define "settings-tabs" -}} + +{{- end }} diff --git a/web/templates/admin/taxDetails.gohtml b/web/templates/admin/taxDetails.gohtml index 2405687..406d109 100644 --- a/web/templates/admin/taxDetails.gohtml +++ b/web/templates/admin/taxDetails.gohtml @@ -8,6 +8,7 @@ {{ define "content" -}} {{- /*gotype: dev.tandem.ws/tandem/camper/pkg/company.taxDetailsForm*/ -}} + {{ template "settings-tabs" "taxDetails" }}

{{( pgettext "Tax Details" "title" )}}

{{ CSRFInput }}