t00-multiuser/server/views/party/createEdit.ejs

32 lines
1.5 KiB
Text
Raw Normal View History

2024-09-19 00:41:40 +01:00
<%- include("../base/header", { title: typeof(party) === "undefined" ? "Create Party" : `Editing ${name}`, userId: session.userId }) %>
<div class="d-flex justify-content-center">
<div class="card my-auto" style="width: 25rem;">
<div class="card-body">
<% if (typeof(party) === "undefined") { %>
<h4 class="card-title text-center">Create New Party</h5>
<% } else { %>
<h4 class="card-title text-center">Editing <%= name %></h5>
<% } %>
<% if (typeof(message) === "string") { %>
<div class="alert alert-danger text-center" role="alert"><%= message %></div>
<% } %>
<form class="mt-3" method="post">
<div class="form-group">
<label for="name" class="form-label">Party Name</label>
<input class="form-control" type="text" name="name" maxlength="64" value="<%= typeof(name) === "undefined" ? "" : name %>" required />
</div>
<div class="form-group mt-3">
<label for="partyRef" class="form-label">Join Code / Party ID<br><span style="font-size: 10pt;">Pick something nice, e.g. "<b>3EGGS</b>"</span></label>
<input class="form-control" type="text" name="partyRef" minlength="5" maxlength="5" value="<%= typeof(partyRef) === "undefined" ? "" : partyRef %>" required />
</div>
<div class="text-center mt-3">
<input class="btn btn-primary" type="submit" value="Save" />
<a class="btn btn-danger ms-2" href="/">Cancel</a>
</div>
</form>
</div>
</div>
</div>
<%- include("../base/footer", { apiKey: session.apiKey, username: session.username }) %>