From 71caaa823032a32bc59b5ddaa9cb5d10b455c799 Mon Sep 17 00:00:00 2001 From: Nickiel12 Date: Wed, 24 Jan 2024 18:58:29 -0800 Subject: [PATCH] added two transaction panels --- web/dashboard.templ | 6 +++--- web/data_endpoints.go | 12 ++++++++++++ web/dataendpoints.templ | 13 ++++++++++++- web/router.go | 14 +++++++++----- web/sass/nav.scss | 1 + web/sass/site.scss | 18 ++++++++++++++++-- web/sass/utility-classes.scss | 6 +++--- web/sass/variables.scss | 2 +- web/templates/index.html | 15 +++++++++++++++ web/transactions.templ | 4 ++-- 10 files changed, 74 insertions(+), 17 deletions(-) diff --git a/web/dashboard.templ b/web/dashboard.templ index f4fad21..67a20e7 100644 --- a/web/dashboard.templ +++ b/web/dashboard.templ @@ -14,7 +14,7 @@ templ dashboard() {
@@ -22,7 +22,7 @@ templ dashboard() {
@@ -66,7 +66,7 @@ templ dashboard() { diff --git a/web/data_endpoints.go b/web/data_endpoints.go index c66f4a3..000b63e 100644 --- a/web/data_endpoints.go +++ b/web/data_endpoints.go @@ -39,6 +39,18 @@ func getTransactionsRows(w http.ResponseWriter, req *http.Request) { component.Render(context.Background(), w); } +func getTransactionQuickAccess(w http.ResponseWriter, req *http.Request) { + component := transaction_quick_access(); + component.Render(context.Background(), w); + +} + +func getRightPanelQuickAccess(w http.ResponseWriter, req *http.Request) { + component := right_panel_quick_access(); + component.Render(context.Background(), w); + +} + func getExpenditureChart(w http.ResponseWriter, req *http.Request) { data_package := struct{ Labels []string `json:"labels"` diff --git a/web/dataendpoints.templ b/web/dataendpoints.templ index 4119418..1dc0b79 100644 --- a/web/dataendpoints.templ +++ b/web/dataendpoints.templ @@ -37,7 +37,7 @@ templ account_summary_rows(accounts *[]types.TwoIntsItem){
@@ -56,3 +56,14 @@ templ account_summary_rows(accounts *[]types.TwoIntsItem){
} } + +templ transaction_quick_access() { +
+

Hello world

+
+} + +templ right_panel_quick_access() { +
+
+} diff --git a/web/router.go b/web/router.go index b91696c..96dddb1 100644 --- a/web/router.go +++ b/web/router.go @@ -29,11 +29,15 @@ func WebRouter() http.Handler { r := chi.NewRouter() r.Get("/", getDashboard) r.Get("/transactions", getTransactionsPage) - r.Get("/web/transaction_table_rows", getTransactionsRows) - r.Get("/web/account_summaries", getAccountSummaries) - r.Get("/web/dashboard/expenditure_chart", getExpenditureChart) - r.Get("/web/dashboard/account_summary/{accountID}", getAccountSummaryChart) - r.Handle("/chart.js/*", http.StripPrefix("/chart.js/", http.FileServer(http.Dir("web/node_modules/chart.js/")))) + + r.Get("/components/account_summaries", getAccountSummaries) + r.Get("/components/transactions_quick_access", getTransactionQuickAccess) + r.Get("/components/right_panel_quick_access", getRightPanelQuickAccess) + + r.Get("/components/data/transaction_table_rows", getTransactionsRows) + r.Get("/components/data/expenditure_chart", getExpenditureChart) + r.Get("/components/data/account_summary/{accountID}", getAccountSummaryChart) + r.Handle("/static/*", http.StripPrefix("/static/", http.FileServer(http.Dir("web/static/")))) return r } diff --git a/web/sass/nav.scss b/web/sass/nav.scss index 8c613b5..48fa5a3 100644 --- a/web/sass/nav.scss +++ b/web/sass/nav.scss @@ -47,3 +47,4 @@ nav { background-color: var(--#{$prefix}-nav-hover); } } + diff --git a/web/sass/site.scss b/web/sass/site.scss index 5167e3a..6ff8488 100644 --- a/web/sass/site.scss +++ b/web/sass/site.scss @@ -12,7 +12,7 @@ $border-radius: 8px; body { - background-color: var(--#{$prefix}-bg); + background-color: var(--#{$prefix}-base); height: 97vh; } @@ -53,7 +53,7 @@ div#below-header { div#left-col { width: 15vw; padding: 10px; - background-color: var(--#{$prefix}-nav-bg); + background-color: var(--#{$prefix}-nav-base); border-radius: $border-radius; } @@ -77,4 +77,18 @@ div#right-col { padding: 10px; background-color: var(--#{$prefix}-nav-bg); border-radius: $border-radius; + display: flex; + flex-direction: column; +} + +#transactions-quick-access { + border-radius: $border-radius; + height: 500px; +} + +#right-panel-quick-access { + border-radius: $border-radius; + margin-top: auto; + margin-bottom: 10px; + height: 300px; } diff --git a/web/sass/utility-classes.scss b/web/sass/utility-classes.scss index 373f521..d401d69 100644 --- a/web/sass/utility-classes.scss +++ b/web/sass/utility-classes.scss @@ -118,7 +118,7 @@ $w_h_sizes: ( } .btn-c-invert { - color: var(--#{$prefix}-bg) !important; + color: var(--#{$prefix}-base) !important; } .btn-c-invert:hover { color: var(--#{$prefix}-text) !important; @@ -160,7 +160,7 @@ table.table-striped { tbody { tr { &.row_awaiting_processing { - background-color: var(--#{$prefix}-bg) !important; + background-color: var(--#{$prefix}-base) !important; max-width: 0px; div { opacity: 0; @@ -200,7 +200,7 @@ table.table-striped { left: 0; font-size: 1em; background-color: var(--#{$prefix}-overlay0); - color: var(--#{$prefix}-bg); + color: var(--#{$prefix}-base); border-radius: 0px 0px $border-radius $border-radius; border-style: solid; border-color: var(--#{$prefix}-overlay2); diff --git a/web/sass/variables.scss b/web/sass/variables.scss index bdd50f7..0d5efe8 100644 --- a/web/sass/variables.scss +++ b/web/sass/variables.scss @@ -2,7 +2,7 @@ @each $flavor, $color in catppuccin.$palette { body.#{$flavor} { - --#{$prefix}-bg: #{map-get($color, 'base')}; + --#{$prefix}-base: #{map-get($color, 'base')}; --#{$prefix}-crust: #{map-get($color, 'crust')}; --#{$prefix}-mantle: #{map-get($color, 'mantle')}; --#{$prefix}-surface0: #{map-get($color, 'surface0')}; diff --git a/web/templates/index.html b/web/templates/index.html index 2e0d444..f4651c1 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -56,7 +56,22 @@ {{.InnerHtml}}
+
+
+
+
diff --git a/web/transactions.templ b/web/transactions.templ index 9fd4a6f..464a6c3 100644 --- a/web/transactions.templ +++ b/web/transactions.templ @@ -62,7 +62,7 @@ templ transactions_page(userID int, accounts *[]string) {