added authentication among other things. considered working at this point.
This commit is contained in:
9
templates/account/login.html
Normal file
9
templates/account/login.html
Normal 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 }}
|
||||
9
templates/account/signup.html
Normal file
9
templates/account/signup.html
Normal 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 }}
|
||||
@@ -1,4 +1,4 @@
|
||||
{{ define "index" }}
|
||||
{{ define "content" }}
|
||||
<a href="/new">+ Add New Draw</a>
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user