This commit is contained in:
2024-12-28 00:07:12 -05:00
parent dfeb478a72
commit 69db561a0c
9 changed files with 222 additions and 258 deletions

View File

@@ -12,28 +12,31 @@
<img class="qrcode-image" id="QRCodeImage" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/wcAAgMBAAeWBjwAAAAASUVORK5CYII=" />
</div>
</div>
<h1>Welcome, <%= username %>!</h1>
<form id="editor">
<div id="server-response">Server Ready</div>
<table border="1">
<tr>
<th>Ticket#</th>
<th>Owner</th>
<th>Offered To</th>
<th>Action</th>
</tr>
<% for (const t in tickets) { %>
<div class="content">
<h1>Welcome, <%= username %>!</h1>
<form id="editor">
<div id="server-response">Server Ready</div>
<table border="1">
<tr>
<th>Ticket#</th>
<th>Owner</th>
<th>Offered To</th>
<th>Action</th>
</tr>
<% for (const t in tickets) { %>
<tr>
<td><%=t%></td>
<td><%=tickets[t].owner%></td>
<td><input type="edit" value="<%=tickets[t].offered%>" id="<%=t%>-offered"></td>
<td><button id="<%=t%>-action" type="button"> QRCode </button></td>
</tr>
<% } %>
<tr>
</tr>
</table>
</form>
<% } %>
<tr>
</tr>
</table>
</form>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {

View File

@@ -6,16 +6,17 @@
</head>
<body class="grid">
<%- include('partials/nav') %>
<form id="editor" method="post">
<table border="1">
<tr>
<th>Camp</th>
<th>Leader</th>
<th>#Issued</th>
<th>#Claimed</th>
<th>#Used</th>
</tr>
<% for (const c in camps) { %>
<div class="content">
<form id="editor" method="post">
<table border="1">
<tr>
<th>Camp</th>
<th>Leader</th>
<th>#Issued</th>
<th>#Claimed</th>
<th>#Used</th>
</tr>
<% for (const c in camps) { %>
<tr>
<td><a href="/editcamp?campname=<%= c %>"><%=c%></td>
<td><%=camps[c].leader%> </td>
@@ -23,15 +24,16 @@
<td><%=camps[c].claimed%> </td>
<td><%=camps[c].used%> </td>
</tr>
<% } %>
<tr>
</tr>
</table>
<br><b>Create New Camp:</b><br>
Group Name: <input type="edit" name="campname"><br>
Lead Email: <input type="edit" name="leader"><br>
Initial Qty (Optional): <input type="edit" name="qty"><br>
<input type="submit" value="Submit">
</form>
<% } %>
<tr>
</tr>
</table>
<br><b>Create New Camp:</b><br>
Group Name: <input type="edit" name="campname"><br>
Lead Email: <input type="edit" name="leader"><br>
Initial Qty (Optional): <input type="edit" name="qty"><br>
<input type="submit" value="Submit">
</form>
</div>
</body>
</html>

View File

@@ -12,17 +12,22 @@
<img class="qrcode-image" id="QRCodeImage" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/wcAAgMBAAeWBjwAAAAASUVORK5CYII=" />
</div>
</div>
<form id="editor">
<div id="server-response">Server Ready</div>
<table border="1">
<tr>
<th>Ticket#</th>
<th>Owner</th>
<th>Offered To</th>
<th>Status</th>
<th>Action</th>
</tr>
<% for (const t in tickets) { %>
<div class="content">
<form id="editor">
<div id="server-response">Server Ready</div>
<br>
Camp Name: <%=campname%><br>
Camp Leader: <%=leader%>
<table border="1">
<tr>
<th>Ticket#</th>
<th>Owner</th>
<th>Offered To</th>
<th>Status</th>
<th>Action</th>
</tr>
<% for (const t in tickets) { %>
<tr>
<td><%=t%></td>
<td><input type="edit" value="<%=tickets[t].owner%>" id="<%=t%>-owner"> </td>
@@ -36,12 +41,19 @@
</td>
<td><button id="<%=t%>-action" type="button"> QRCode </button></td>
</tr>
<% } %>
<tr>
</tr>
</table>
</form>
<script>
<% } %>
<tr>
</tr>
</table>
</form>
<form action='/moretickets' method='post'>
<input type="hidden" name="campname" value="<%=campname%>">
Issue Tickets (Qty): <input type="edit" name="qty"><br>
<button type="submit">Issue</button>
</form>
</div>
</body>
<script>

19
views/login.ejs Normal file
View File

@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<%- include('partials/nav') %>
<div class="content">
Most users log in with an email link, not a password.
<form id="editor" method="POST" action="/login">
Email:<input type="email" name="username"><br>
Password:<input type="password" name="password"><br>
<button id="Submit" type="submit">Log In</button>
<br>
</form>
</div>
</body>
</html>

View File

@@ -12,25 +12,28 @@
<img class="qrcode-image" id="QRCodeImage" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/wcAAgMBAAeWBjwAAAAASUVORK5CYII=" />
</div>
</div>
<form id="editor">
<div id="server-response">Server Ready</div>
<table border="1">
<tr>
<th>Ticket#</th>
<th>Offered To</th>
<th>Action</th>
</tr>
<% for (const t in tickets) { %>
<div class="content">
<form id="editor">
<div id="server-response">Server Ready</div>
Tickets owned by <%=username%>
<table border="1">
<tr>
<th>Ticket#</th>
<th>Offered To</th>
<th>Action</th>
</tr>
<% for (const t in tickets) { %>
<tr>
<td><%=t%></td>
<td><input type="edit" value="<%=tickets[t].offered%>" id="<%=t%>-offered"></td>
<td><button id="<%=t%>-action" type="button"> QRCode </button></td>
</tr>
<% } %>
<tr>
</tr>
</table>
</form>
<% } %>
<tr>
</tr>
</table>
</form>
</div>
<script>

View File

@@ -6,7 +6,9 @@
</head>
<body>
<%- include('partials/nav') %>
<%=message%>
<div class="content">
<%=message%>
</div>
</body>
</html>

View File

@@ -1,10 +1,14 @@
<!-- views/partials/nav.ejs -->
<aside>
<nav class="nav-links">
Welcome, <%= username %>!
Falls on Fire
<ul>
<li><a href="/mytickets">View My Tickets</a></li>
<%if (superuser) {%>
<li><a href="/camps">View Camps (Admin)</a></li>
<li><a href="/settings">Settings (Admin)</a></li>
<%}%>
<li><a href="/logout">Log Out</a></li>
</ul>
</nav>
</aside>

19
views/settings.ejs Normal file
View File

@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<title>Settings</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<%- include('partials/nav') %>
<div class="content">
<form action='/purge' method='post'>
<button type="submit" >Purge Revoked Tickets</button>
</form>
<form action='/wipedb' method='post'>
<button type="submit" >Wipe the Database</button>
</form>
</div>
</body>
</html>