diff --git a/ui/.air.toml b/ui/.air.toml index 23dc2de..7e46587 100644 --- a/ui/.air.toml +++ b/ui/.air.toml @@ -5,7 +5,7 @@ tmp_dir = "tmp" [build] args_bin = [] bin = "./tmp/main" - cmd = "templ generate && go build -o ./tmp/main ." + cmd = "rm **/*_templ.go && templ generate && go build -o ./tmp/main ." delay = 1000 exclude_dir = ["assets", "tmp", "vendor", "testdata", "dist"] exclude_file = [] diff --git a/ui/main.go b/ui/main.go index e5a440d..9cbfc06 100644 --- a/ui/main.go +++ b/ui/main.go @@ -15,6 +15,14 @@ func main() { templates.LandingPage(false).Render(c.Request.Context(), buf) + c.Data(200, "text/html", []byte(buf.String())) + }) + r.GET("/login", func(c *gin.Context) { + raw := []byte{} + buf := bytes.NewBuffer(raw) + templates.LoginPage().Render(c.Request.Context(), buf) + + c.Data(200, "text/html", []byte(buf.String())) }) r.Run() // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080") diff --git a/ui/templates/footer.templ b/ui/templates/footer.templ new file mode 100644 index 0000000..24101fa --- /dev/null +++ b/ui/templates/footer.templ @@ -0,0 +1,46 @@ +package templates + +templ Footer() { + +} diff --git a/ui/templates/content.templ b/ui/templates/landing_content.templ similarity index 99% rename from ui/templates/content.templ rename to ui/templates/landing_content.templ index a33c5bf..b88a102 100644 --- a/ui/templates/content.templ +++ b/ui/templates/landing_content.templ @@ -1,6 +1,6 @@ package templates -templ Content() { +templ LandingContent() {
@Nav(auth) - @Content() + @LandingContent() + @Footer() @toggleNavBar() } diff --git a/ui/templates/login_content.templ b/ui/templates/login_content.templ new file mode 100644 index 0000000..a0c7a11 --- /dev/null +++ b/ui/templates/login_content.templ @@ -0,0 +1,78 @@ +package templates + +templ LoginContent() { +
+
+
+
+
+
+
+
+
+ Sign in +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+
+} diff --git a/ui/templates/login_page.templ b/ui/templates/login_page.templ new file mode 100644 index 0000000..6aa1480 --- /dev/null +++ b/ui/templates/login_page.templ @@ -0,0 +1,14 @@ +package templates + +templ LoginPage() { + + + @Head() + + @Nav(false) + @LoginContent() + + @Footer() + @toggleNavBar() + +}