From cb00f4fcd96fed4401bb8a23bc2d1ffb7609299f Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Tue, 21 May 2024 23:44:48 -0600 Subject: [PATCH] templates/partials: start conversion to templ Signed-off-by: Sumner Evans --- internal/templates/base.templ | 0 internal/templates/partials/footer.templ | 33 ++++++++ internal/templates/partials/navbar.templ | 97 ++++++++++++++++++++++++ website/static/index.css | 4 +- website/templates/partials/navbar.html | 2 +- 5 files changed, 133 insertions(+), 3 deletions(-) create mode 100644 internal/templates/base.templ create mode 100644 internal/templates/partials/footer.templ create mode 100644 internal/templates/partials/navbar.templ diff --git a/internal/templates/base.templ b/internal/templates/base.templ new file mode 100644 index 0000000..e69de29 diff --git a/internal/templates/partials/footer.templ b/internal/templates/partials/footer.templ new file mode 100644 index 0000000..db636fa --- /dev/null +++ b/internal/templates/partials/footer.templ @@ -0,0 +1,33 @@ +package partials + +templ Footer(hostedByHTML string) { +
+
+
+

+ Organized by + + + + and hosted at + + + +

+

+ Need help? You can always email support with any + questions you have. +

+

+ © 2023 Mines ACM. + View the + + source + code + . + @templ.Raw(hostedByHTML) +

+
+
+
+} diff --git a/internal/templates/partials/navbar.templ b/internal/templates/partials/navbar.templ new file mode 100644 index 0000000..66014b4 --- /dev/null +++ b/internal/templates/partials/navbar.templ @@ -0,0 +1,97 @@ +package partials + +func getNavLinkClasses(activePageName, pageName string) []string { + classes := []string{"nav-link"} + if activePageName == pageName { + classes = append(classes, pageName+"-link-active") + } + return classes +} + +templ Navbar(pageName string, registrationEnabled bool, username string) { + +} diff --git a/website/static/index.css b/website/static/index.css index 312fb5c..cf39f74 100644 --- a/website/static/index.css +++ b/website/static/index.css @@ -89,12 +89,12 @@ a.btn:hover { border-bottom: 5px solid #B44A88; } -.navbar #registration-link:hover { +.navbar #register-link:hover { color: #008234; border-bottom: 5px solid #008234; } -.navbar .registration-link-active { +.navbar .register-link-active { color: #008234 !important; border-bottom: 5px solid #008234; } diff --git a/website/templates/partials/navbar.html b/website/templates/partials/navbar.html index f0c8f56..1e361fa 100644 --- a/website/templates/partials/navbar.html +++ b/website/templates/partials/navbar.html @@ -23,7 +23,7 @@ {{ if .RegistrationEnabled }} {{ end }}