From fbf0f6250dadf3fb3ba70b8b8f40b2c265b09939 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 12 Feb 2024 04:50:44 +0000 Subject: An Operations list page now renders data in table The data is fetched from the database and uses html/template to render the rows in a list. A critical bug was not including the dot in {{ template "main" . }} in the base template. THIS MEANT THAT NO DATA PASSED TO ExecuteTemplate function rendered and took a long time to figure out. --- ui/html/base.tmpl.html | 2 +- ui/html/pages/operations/list.tmpl.html | 35 +++++++++++---------------------- ui/static/css/main.css | 1 - 3 files changed, 13 insertions(+), 25 deletions(-) (limited to 'ui') diff --git a/ui/html/base.tmpl.html b/ui/html/base.tmpl.html index 91bdbc2..58122a0 100644 --- a/ui/html/base.tmpl.html +++ b/ui/html/base.tmpl.html @@ -14,7 +14,7 @@ {{ template "nav" . }}
- {{ template "main" }} + {{ template "main" . }}
diff --git a/ui/html/pages/operations/list.tmpl.html b/ui/html/pages/operations/list.tmpl.html index 046ca29..a8685ce 100644 --- a/ui/html/pages/operations/list.tmpl.html +++ b/ui/html/pages/operations/list.tmpl.html @@ -3,44 +3,33 @@ {{ define "main" }}

Operations [Admin]

- {{if .Operations}} - - {{else}} -

There are no operations.

- {{end}} - +{{if .Operations}} - - + + + {{range .Operations }} - + - - - - - - - - - - + + + {{end}}
Operation RP Lead Inspector[s]Another attributeAnother attributeDescriptionOrganisation SharePoint
First operation{{.Name}} Tim Gudgeon Tina McKinchey / Barbara SnellandBobbinsBobbinsLink
Second organisationSeth PringBarbara SnellandBobbinsBobbins{{.Description}}{{.OrganisationName}} Link
+{{else}} +

There are no operations.

+{{end}} + {{ end }} diff --git a/ui/static/css/main.css b/ui/static/css/main.css index 1760fba..d8060bd 100644 --- a/ui/static/css/main.css +++ b/ui/static/css/main.css @@ -23,7 +23,6 @@ a:hover { a.admin-link { font-size: 0.65rem; - padding: 0em 0em 1.2em 0em; } -- cgit v1.2.3