From dd24746bcde550cffaf698a0c9c727e869e3cfb3 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Thu, 15 Feb 2024 15:43:04 +0000 Subject: Implemented template cache This is not perfect. At the moment, the new render() function, introduced in this commit, expects a templateData{} struct which contains an Operations field. This will need to be made generic, or we have multiple render() functions to accommdate the different types of data struct we want to be able to pass to templates. Also, in this commit I had to get rid of the /pages/operations and /pages/organisation sub directories for now. This does not fit the newTemplateCache() function - also introduced here. This needs to be refactored if we want to have subdirectories of templates - or else we stick to putting them inside pages/ and we name them appropriately, as we have done here with operations_list and organisation_list templates. --- ui/html/pages/operations/list.tmpl.html | 58 ----------------------------- ui/html/pages/operations_list.tmpl.html | 59 ++++++++++++++++++++++++++++++ ui/html/pages/organisations/list.tmpl.html | 36 ------------------ ui/html/pages/organisations_list.tmpl.html | 36 ++++++++++++++++++ 4 files changed, 95 insertions(+), 94 deletions(-) delete mode 100644 ui/html/pages/operations/list.tmpl.html create mode 100644 ui/html/pages/operations_list.tmpl.html delete mode 100644 ui/html/pages/organisations/list.tmpl.html create mode 100644 ui/html/pages/organisations_list.tmpl.html (limited to 'ui') diff --git a/ui/html/pages/operations/list.tmpl.html b/ui/html/pages/operations/list.tmpl.html deleted file mode 100644 index eac3325..0000000 --- a/ui/html/pages/operations/list.tmpl.html +++ /dev/null @@ -1,58 +0,0 @@ -{{ define "title" }}Operations{{end}} - - -{{ define "main" }} -

Operations [Admin]

- -

-Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. -

- -{{if .Operations}} - - - - - - - - - - - - - - - {{range .Operations }} - - - - - - - - - - - {{end}} - -
OperationRPLead Inspector[s]DescriptionOrganisationEPsESsSharePoint
{{.Name}}Tim GudgeonTina McKinchey / Barbara Snelland{{.Description}}{{.OrganisationName}}EP 2024 - {{if .EngagementStrategies}} - - {{else}} - NA - {{end}} - Link
-{{else}} -

There are no operations.

-{{end}} - -{{ end }} - diff --git a/ui/html/pages/operations_list.tmpl.html b/ui/html/pages/operations_list.tmpl.html new file mode 100644 index 0000000..2863d19 --- /dev/null +++ b/ui/html/pages/operations_list.tmpl.html @@ -0,0 +1,59 @@ +{{ define "title" }}Operations{{end}} + + +{{ define "main" }} +

Operations [Admin]

+ +

+Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. +

+ + +{{if .Operations}} + + + + + + + + + + + + + + + {{range .Operations }} + + + + + + + + + + + {{end}} + +
OperationRPLead Inspector[s]DescriptionOrganisationEPsESsSharePoint
{{.Name}}Tim GudgeonTina McKinchey / Barbara Snelland{{.Description}}{{.OrganisationName}}EP 2024 + {{if .EngagementStrategies}} + + {{else}} + NA + {{end}} + Link
+{{else}} +

There are no operations.

+{{end}} + +{{ end }} + diff --git a/ui/html/pages/organisations/list.tmpl.html b/ui/html/pages/organisations/list.tmpl.html deleted file mode 100644 index 1b0e3a9..0000000 --- a/ui/html/pages/organisations/list.tmpl.html +++ /dev/null @@ -1,36 +0,0 @@ -{{ define "title" }}Organisations{{end}} - -{{ define "main" }} -

Organisations [Admin]

-

There is nothing to see here yet.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OrganisationRPLead Inspector[s]Another attributeAnother attributeSharePoint
First organisationTim GudgeonTina McKinchey / Barbara SnellandBobbinsBobbinsLink
Second organisationSeth PringBarbara SnellandBobbinsBobbinsLink
-{{ end }} diff --git a/ui/html/pages/organisations_list.tmpl.html b/ui/html/pages/organisations_list.tmpl.html new file mode 100644 index 0000000..1b0e3a9 --- /dev/null +++ b/ui/html/pages/organisations_list.tmpl.html @@ -0,0 +1,36 @@ +{{ define "title" }}Organisations{{end}} + +{{ define "main" }} +

Organisations [Admin]

+

There is nothing to see here yet.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OrganisationRPLead Inspector[s]Another attributeAnother attributeSharePoint
First organisationTim GudgeonTina McKinchey / Barbara SnellandBobbinsBobbinsLink
Second organisationSeth PringBarbara SnellandBobbinsBobbinsLink
+{{ end }} -- cgit v1.2.3