diff --git a/garden-app/server/templates.go b/garden-app/server/templates.go index 8145f129..b286b85c 100644 --- a/garden-app/server/templates.go +++ b/garden-app/server/templates.go @@ -156,6 +156,14 @@ func templateFuncs(r *http.Request) map[string]any { "NotRefresh": func() bool { return r.URL.Query().Get("refresh") != "true" }, + "IncludePlusButton": func() bool { + parts := strings.Split(r.URL.Path, "/") + if len(parts) == 0 { + return false + } + _, err := xid.FromString(parts[len(parts)-1]) + return err != nil + }, } } diff --git a/garden-app/server/templates/base.html b/garden-app/server/templates/base.html index 14812193..593209d9 100644 --- a/garden-app/server/templates/base.html +++ b/garden-app/server/templates/base.html @@ -33,11 +33,11 @@ href="/water_schedules?exclude_weather_data=true">Water Schedules
  • Weather Clients
  • -
  • + {{ if IncludePlusButton }}
    + {{ end }}