Refactor and remove sqlite and replace with MySQL
This commit is contained in:
26
web/templates/syndicate/create.html
Normal file
26
web/templates/syndicate/create.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{{ define "content" }}
|
||||
<div class="container py-5">
|
||||
<h2>Create New Syndicate</h2>
|
||||
|
||||
{{ if .Flash }}
|
||||
<div class="alert alert-info">{{ .Flash }}</div>
|
||||
{{ end }}
|
||||
|
||||
<form method="POST">
|
||||
{{ .CSRFField }}
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Syndicate Name</label>
|
||||
<input type="text" name="name" class="form-control" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Description (optional)</label>
|
||||
<textarea name="description" class="form-control"></textarea>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">Create</button>
|
||||
<a href="/syndicate" class="btn btn-secondary">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
{{ end }}
|
||||
41
web/templates/syndicate/index.html
Normal file
41
web/templates/syndicate/index.html
Normal file
@@ -0,0 +1,41 @@
|
||||
{{ define "content" }}
|
||||
<div class="container py-5">
|
||||
<h2>Your Syndicates</h2>
|
||||
|
||||
{{ if .ManagedSyndicates }}
|
||||
<h4 class="mt-4">Managed</h4>
|
||||
<ul class="list-group mb-3">
|
||||
{{ range .ManagedSyndicates }}
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<strong>{{ .Name }}</strong><br>
|
||||
<small class="text-muted">{{ .Description }}</small>
|
||||
</div>
|
||||
<a href="/syndicate/view?id={{ .ID }}" class="btn btn-outline-primary btn-sm">Manage</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
|
||||
{{ if .JoinedSyndicates }}
|
||||
<h4 class="mt-4">Member</h4>
|
||||
<ul class="list-group mb-3">
|
||||
{{ range .JoinedSyndicates }}
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<strong>{{ .Name }}</strong><br>
|
||||
<small class="text-muted">{{ .Description }}</small>
|
||||
</div>
|
||||
<a href="/syndicate/view?id={{ .ID }}" class="btn btn-outline-secondary btn-sm">View</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
|
||||
{{ if not .ManagedSyndicates | and (not .JoinedSyndicates) }}
|
||||
<div class="alert alert-info">You are not part of any syndicates yet.</div>
|
||||
{{ end }}
|
||||
|
||||
<a href="/syndicate/create" class="btn btn-primary mt-3">Create New Syndicate</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
18
web/templates/syndicate/invite.html
Normal file
18
web/templates/syndicate/invite.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{{ define "content" }}
|
||||
<div class="container py-5">
|
||||
<h2>Invite Member to "{{ .Syndicate.Name }}"</h2>
|
||||
{{ if .Flash }}
|
||||
<div class="alert alert-info">{{ .Flash }}</div>
|
||||
{{ end }}
|
||||
|
||||
<form method="POST">
|
||||
{{ .CSRFField }}
|
||||
<div class="mb-3">
|
||||
<label for="username" class="form-label">Username to Invite</label>
|
||||
<input type="text" class="form-control" id="username" name="username" required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Send Invite</button>
|
||||
<a href="/syndicate/view?id={{ .Syndicate.ID }}" class="btn btn-secondary ms-2">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
{{ end }}
|
||||
34
web/templates/syndicate/log_ticket.html
Normal file
34
web/templates/syndicate/log_ticket.html
Normal file
@@ -0,0 +1,34 @@
|
||||
{{ define "content" }}
|
||||
<div class="container py-5">
|
||||
<h2>Add Ticket for {{ .Syndicate.Name }}</h2>
|
||||
|
||||
<form method="POST">
|
||||
{{ .CSRFField }}
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="game_type" class="form-label">Game Type</label>
|
||||
<select class="form-select" id="game_type" name="game_type" required>
|
||||
<option value="Thunderball">Thunderball</option>
|
||||
<option value="Lotto">Lotto</option>
|
||||
<!-- Add more as needed -->
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="draw_date" class="form-label">Draw Date</label>
|
||||
<input type="date" class="form-control" id="draw_date" name="draw_date" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="purchase_method" class="form-label">Purchase Method</label>
|
||||
<input type="text" class="form-control" id="purchase_method" name="purchase_method">
|
||||
</div>
|
||||
|
||||
<!-- Ball Inputs -->
|
||||
{{ template "ballInputs" . }}
|
||||
|
||||
<button type="submit" class="btn btn-success">Submit Ticket</button>
|
||||
<a href="/syndicate/view?id={{ .Syndicate.ID }}" class="btn btn-secondary ms-2">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
{{ end }}
|
||||
57
web/templates/syndicate/manager/invite_links.html
Normal file
57
web/templates/syndicate/manager/invite_links.html
Normal file
@@ -0,0 +1,57 @@
|
||||
{{ define "content" }}
|
||||
<div class="container py-5">
|
||||
<h2>Manage Invite Links</h2>
|
||||
|
||||
{{ if .Tokens }}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Invite Link</th>
|
||||
<th>Invited By</th>
|
||||
<th>Status</th>
|
||||
<th>Expires</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ range .Tokens }}
|
||||
<tr>
|
||||
<td>
|
||||
<code>/syndicate/join?token={{ .Token }}</code>
|
||||
</td>
|
||||
<td>User #{{ .InvitedByUserID }}</td>
|
||||
<td>
|
||||
{{ if .AcceptedByUserID.Valid }}
|
||||
<span class="text-success" title="Joined on {{ .AcceptedAt.Time.Format \"02 Jan 2006 15:04\" }}">
|
||||
Accepted by User #{{ .AcceptedByUserID.Int64 }}
|
||||
</span>
|
||||
{{ else if .ExpiresAt.Before (now) }}
|
||||
<span class="text-danger" title="Expired on {{ .ExpiresAt.Format \"02 Jan 2006 15:04\" }}">Expired</span>
|
||||
{{ else }}
|
||||
<span class="text-warning" title="Expires in {{ humanizeTime .ExpiresAt }}">Pending</span>
|
||||
{{ end }}
|
||||
</td>
|
||||
<td>{{ .ExpiresAt.Format "02 Jan 2006 15:04" }}</td>
|
||||
<td>
|
||||
{{ if not .AcceptedByUserID.Valid }}
|
||||
<form method="POST" action="/account/syndicates/invite/revoke?token={{ .Token }}&id={{ $.SyndicateID }}" class="d-inline">
|
||||
{{ $.CSRFField }}
|
||||
<button class="btn btn-sm btn-outline-danger" title="Invalidate this token">Revoke</button>
|
||||
</form>
|
||||
{{ end }}
|
||||
<form method="POST" action="/account/syndicates/invite/token?id={{ $.SyndicateID }}" class="d-inline">
|
||||
{{ $.CSRFField }}
|
||||
<button class="btn btn-sm btn-outline-secondary" title="Create a new invite token">Regenerate</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
||||
{{ else }}
|
||||
<div class="alert alert-info">No invite links found for this syndicate.</div>
|
||||
{{ end }}
|
||||
|
||||
<a href="/syndicate/view?id={{ .SyndicateID }}" class="btn btn-secondary mt-3">← Back</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
42
web/templates/syndicate/tickets.html
Normal file
42
web/templates/syndicate/tickets.html
Normal file
@@ -0,0 +1,42 @@
|
||||
{{ define "content" }}
|
||||
<div class="container py-4">
|
||||
<h2>Syndicate Tickets</h2>
|
||||
|
||||
{{ if .Tickets }}
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Game</th>
|
||||
<th>Draw Date</th>
|
||||
<th>Numbers</th>
|
||||
<th>Matched</th>
|
||||
<th>Prize</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ range .Tickets }}
|
||||
<tr>
|
||||
<td>{{ .GameType }}</td>
|
||||
<td>{{ .DrawDate }}</td>
|
||||
<td>
|
||||
{{ .Ball1 }} {{ .Ball2 }} {{ .Ball3 }} {{ .Ball4 }} {{ .Ball5 }} {{ .Ball6 }}
|
||||
{{ if .Bonus1 }}+{{ .Bonus1 }}{{ end }}
|
||||
{{ if .Bonus2 }} {{ .Bonus2 }}{{ end }}
|
||||
</td>
|
||||
<td>{{ .MatchedMain }} + {{ .MatchedBonus }}</td>
|
||||
<td>
|
||||
{{ if .IsWinner }}
|
||||
💷 {{ .PrizeLabel }}
|
||||
{{ else }}
|
||||
<span class="text-muted">–</span>
|
||||
{{ end }}
|
||||
</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
||||
{{ else }}
|
||||
<div class="alert alert-info">No tickets found for this syndicate.</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
38
web/templates/syndicate/view.html
Normal file
38
web/templates/syndicate/view.html
Normal file
@@ -0,0 +1,38 @@
|
||||
{{ define "content" }}
|
||||
<div class="container py-5">
|
||||
<h2>{{ .Syndicate.Name }}</h2>
|
||||
<p class="text-muted">{{ .Syndicate.Description }}</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<h4>Members</h4>
|
||||
<ul class="list-group mb-3">
|
||||
{{ range .Members }}
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<span>{{ .Username }}</span>
|
||||
<small class="text-muted">Joined: {{ .JoinedAt.Format "02 Jan 2006" }}</small>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
||||
{{ if .IsManager }}
|
||||
<div class="alert alert-warning">
|
||||
<strong>Manager Controls</strong><br>
|
||||
You can add or remove members, and manage tickets.
|
||||
</div>
|
||||
|
||||
<a href="/syndicate/invite?id={{ .Syndicate.ID }}" class="btn btn-outline-primary">Invite Members</a>
|
||||
|
||||
<form method="POST" action="/account/syndicates/invite/token?id={{ .Syndicate.ID }}" class="mt-3">
|
||||
{{ .CSRFField }}
|
||||
<button type="submit" class="btn btn-sm btn-outline-primary">Generate Invite Link</button>
|
||||
</form>
|
||||
|
||||
{{ if .Flash }}
|
||||
<div class="alert alert-info mt-2">{{ .Flash }}</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
<a href="/syndicate" class="btn btn-secondary mt-3">← Back to Syndicates</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user