From 96be01ea722d2652f4ee44705c2ef8eedbb0bdcc Mon Sep 17 00:00:00 2001 From: Preston Baxter Date: Sun, 5 Nov 2023 11:34:53 -0600 Subject: [PATCH] B: tmp --- ui/.gitignore | 1 + ui/Makefile | 3 +- ui/tailwind.config.js | 2 +- ui/templates/dashboard_page.templ | 52 ++++++++++++++++--------------- 4 files changed, 30 insertions(+), 28 deletions(-) diff --git a/ui/.gitignore b/ui/.gitignore index 6a93c70..0fb2a3d 100644 --- a/ui/.gitignore +++ b/ui/.gitignore @@ -1,4 +1,5 @@ dist/* tmp/* **/*_templ.go +templates/*.html docker/tmp/* diff --git a/ui/Makefile b/ui/Makefile index 78fec0e..e972b14 100644 --- a/ui/Makefile +++ b/ui/Makefile @@ -1,8 +1,7 @@ BASE_URL="us-central1-docker.pkg.dev/pbaxter-infra/capstone-repo" local-build: - rm **/*_templ.go - templ generate --path ./templates + rm **/*_templ.go; templ generate -path ./templates npx tailwindcss -i static/index.css -o dist/output.css GOEXPERIMENT=loopvar go build -o ./tmp/main . diff --git a/ui/tailwind.config.js b/ui/tailwind.config.js index 07fa1cc..31b64d4 100644 --- a/ui/tailwind.config.js +++ b/ui/tailwind.config.js @@ -1,5 +1,5 @@ module.exports = { - content: ["templates/*.templ"], + content: ["./templates/*.html"], theme: { extend: {}, }, plugins: [], } diff --git a/ui/templates/dashboard_page.templ b/ui/templates/dashboard_page.templ index 85f42c5..278893d 100644 --- a/ui/templates/dashboard_page.templ +++ b/ui/templates/dashboard_page.templ @@ -7,13 +7,22 @@ import ( "git.preston-baxter.com/Preston_PLB/capstone/frontend-service/db/models" ) -func hasPco(vendors []models.VendorAccount) bool { +func hasVendor(name string, vendors []models.VendorAccount) bool { for _, vendor := range vendors { - if vendor.Name == models.PCO_VENDOR_NAME { + if vendor.Name == name { return true } } return false + +} + +func hasPco(vendors []models.VendorAccount) bool { + return hasVendor(models.PCO_VENDOR_NAME, vendors) +} + +func hasYoutube(vendors []models.VendorAccount) bool { + return hasVendor(models.YOUTUBE_VENDOR_NAME, vendors) } templ DashboardPage(user *models.User, vendorAccounts []models.VendorAccount, actionMappings []models.ActionMapping) { @@ -233,7 +242,7 @@ templ DashboardVendorDropDown() {
- -
- - -
-
-
-
- - -
-
- - -
-
- - +
+
+ +
+ +
+