added authentication among other things. considered working at this point.

This commit is contained in:
2025-03-25 11:27:21 +00:00
parent cf8b0041b2
commit f1ad9757ba
19 changed files with 310 additions and 58 deletions

View File

@@ -0,0 +1,9 @@
{{ define "content" }}
<h2>Login</h2>
<form method="POST" action="/login">
{{ .csrfField }}
<label>Username: <input type="text" name="username" required></label><br>
<label>Password: <input type="password" name="password" required></label><br>
<button type="submit">Login</button>
</form>
{{ end }}

View File

@@ -0,0 +1,9 @@
{{ define "content" }}
<h2>Sign Up</h2>
<form method="POST" action="/signup">
{{ .csrfField }}
<label>Username: <input type="text" name="username" required></label><br>
<label>Password: <input type="password" name="password" required></label><br>
<button type="submit">Sign Up</button>
</form>
{{ end }}

View File

@@ -1,4 +1,4 @@
{{ define "index" }}
{{ define "content" }}
<a href="/new">+ Add New Draw</a>
<table>
<tr>

View File

@@ -15,11 +15,7 @@
<body>
<h1>Lotto Tracker</h1>
{{ if eq .Page "index" }}
{{ template "index" .Data }}
{{ else if eq .Page "new_draw" }}
{{ template "new_draw" .Data }}
{{ end }}
{{ template "content" . }}
</body>
</html>

View File

@@ -1,7 +1,8 @@
{{ define "new_draw" }}
{{ define "content" }}
<a href="/">← Back</a>
<h2>Add New Thunderball Draw</h2>
<form method="POST" action="/submit">
{{ .csrfField }}
<div class="form-section">
<label>Date: <input type="date" name="date" required></label>
</div>

View File

@@ -1,7 +1,8 @@
{{ define "new_ticket" }}
{{ define "content" }}
<a href="/">← Back</a>
<h2>Log My Ticket</h2>
<form method="POST" action="/submit-ticket">
{{ .csrfField }}
<div class="form-section">
<label>Draw Date:
<select name="draw_date" required>

View File

@@ -1,5 +1,4 @@
{{ define "tickets" }}
{{ define "content" }}
{{ define "content" }}
<a href="/">← Back to Home</a>
<h2>My Tickets</h2>
@@ -32,5 +31,4 @@
{{ end }}
</tbody>
</table>
{{ template "layout" . }}
{{ end }}