diff --git a/handler/account.go b/handler/account.go index 7df1efb..65e4cad 100644 --- a/handler/account.go +++ b/handler/account.go @@ -42,7 +42,7 @@ func (handler AccountImpl) handleAccountPage() http.HandlerFunc { return } - comp := account.AccountListComp(nil) + comp := account.Account() handler.render.RenderLayout(r, w, comp, user) } } diff --git a/template/account/account.templ b/template/account/account.templ new file mode 100644 index 0000000..9490e3f --- /dev/null +++ b/template/account/account.templ @@ -0,0 +1,27 @@ +package account + +import "fmt" + +templ Account() { +
+ @accountItem("Sparkasse", 51268) + @accountItem("Bargeld", 11822) + @accountItem("Bargeld Milch", 8200) +
+} + +func displayBalance(balance int) string { + + euros := float64(balance) / 100 + return fmt.Sprintf("%.2f €", euros) +} + +templ accountItem(name string, balance int) { +
+

{ name }

+

{ displayBalance(balance) }

+ + + +
+} diff --git a/template/account/workout.templ b/template/account/workout.templ deleted file mode 100644 index 4924a27..0000000 --- a/template/account/workout.templ +++ /dev/null @@ -1,7 +0,0 @@ -package account - -import "spend-sparrow/types" - -templ AccountListComp(accounts []*types.Account) { -
-} diff --git a/template/index.templ b/template/index.templ deleted file mode 100644 index d8fbc84..0000000 --- a/template/index.templ +++ /dev/null @@ -1,14 +0,0 @@ -package template - -templ Index() { -
-

- SpendSparrow logo - SpendSparrow -

-

- Spend on the important, like a fine Whiskey -

- Getting Started -
-} diff --git a/template/layout.templ b/template/layout.templ index b8c8869..01a45ee 100644 --- a/template/layout.templ +++ b/template/layout.templ @@ -48,11 +48,11 @@ templ Layout(slot templ.Component, user templ.Component, loggedIn bool, path str
// Content -
+
if slot != nil { @slot } -
+ // Footer
diff --git a/template/not_found.templ b/template/not_found.templ index f564669..0d42ae9 100644 --- a/template/not_found.templ +++ b/template/not_found.templ @@ -5,7 +5,7 @@ templ NotFound() {

Not Found

The page you are looking for does not exist.

- Go back to home + Go back to home
} diff --git a/template/root.templ b/template/root.templ new file mode 100644 index 0000000..928478b --- /dev/null +++ b/template/root.templ @@ -0,0 +1,14 @@ +package template + +templ Index() { +
+

+ SpendSparrow logo + SpendSparrow +

+

+ Spend on the important, like a fine Whiskey +

+ Getting Started +
+}