mfa and api wiring

This commit is contained in:
Joey Kimsey
2026-09-12 15:11:21 -04:00
parent 17d83f7209
commit 58ca586d94
11 changed files with 2065 additions and 134 deletions

View File

@ -201,7 +201,7 @@
<div class="mx-auto p-4 rounded context-main-bg capsule-login-card">
<h1 class="h3 mb-3 text-center">Connect a site</h1>
<p class="text-muted text-center mb-4">
Sign in to any Tempus Project install. Capsule talks to that site<EFBFBD>s API and keeps
Sign in to any Tempus Project install. Capsule talks to that site?s API and keeps
the session on this machine.
</p>
<form id="login-form">
@ -286,6 +286,52 @@
</div>
</section>
<section id="view-mfa" class="view" hidden>
<div class="container pt-4">
<div class="mx-auto p-4 rounded context-main-bg capsule-login-card">
<h1 class="h3 mb-3 text-center">Verify it's you</h1>
<p id="mfa-prompt" class="text-muted text-center mb-4">
Choose how you want to authenticate.
</p>
<form id="mfa-method-form" hidden>
<fieldset>
<legend class="visually-hidden">Authentication method</legend>
<div id="mfa-methods" class="mb-3"></div>
</fieldset>
<p id="mfa-method-error" class="text-danger" hidden></p>
<button id="mfa-method-submit" class="btn btn-primary w-100" type="submit">
Continue
</button>
</form>
<form id="mfa-code-form" hidden>
<div class="mb-3">
<label class="form-label" for="mfa-code">Authentication code</label>
<input
id="mfa-code"
class="form-control"
name="authCode"
type="text"
inputmode="numeric"
autocomplete="one-time-code"
maxlength="8"
required
/>
</div>
<p id="mfa-code-error" class="text-danger" hidden></p>
<button id="mfa-code-submit" class="btn btn-primary w-100" type="submit">
Continue
</button>
<button id="mfa-reset" class="btn btn-link w-100 mt-2" type="button" hidden>
Choose another method
</button>
</form>
<p class="text-center mt-4 mb-0">
<button id="mfa-cancel" type="button" class="btn btn-link">Cancel</button>
</p>
</div>
</div>
</section>
<section id="view-stub" class="view" hidden>
<div class="m-2 m-lg-4">
<div class="col-12 col-lg-10 mx-auto p-4 rounded shadow-sm context-main-bg">
@ -297,6 +343,7 @@
<section id="view-home" class="view" hidden>
<div class="m-2 m-lg-4">
<div class="col-12 col-lg-10 mx-auto p-4 rounded shadow-sm context-main-bg">
<h1 class="h3">Dashboard</h1>
<h1 class="h3">Workspace</h1>
<p class="text-muted" id="home-note">
Search, notifications, messages, and profile are here. Site API wiring is the next
@ -306,6 +353,51 @@
Connected to <a id="home-site" href="#" target="_blank" rel="noreferrer"></a>
as <strong id="home-username"></strong>.
</p>
<p id="home-plugins" class="small text-muted mb-4"></p>
<div class="row g-4">
<div class="col-md-6" id="contact-panel" hidden>
<h2 class="h5">Contact</h2>
<form id="contact-form">
<div class="mb-2">
<label class="form-label" for="contact-name">Name</label>
<input id="contact-name" class="form-control" name="name" type="text" required />
</div>
<div class="mb-2">
<label class="form-label" for="contact-email">Email</label>
<input id="contact-email" class="form-control" name="email" type="email" />
</div>
<div class="mb-2">
<label class="form-label" for="contact-entry">Message</label>
<textarea id="contact-entry" class="form-control" name="entry" rows="3" required></textarea>
</div>
<p id="contact-status" class="small" hidden></p>
<button class="btn btn-primary" type="submit">Send</button>
</form>
</div>
<div class="col-md-6" id="bugreport-panel" hidden>
<h2 class="h5">Bug report</h2>
<form id="bugreport-form">
<div class="mb-2">
<label class="form-label" for="bug-url">Page URL</label>
<input id="bug-url" class="form-control" name="url" type="url" required />
</div>
<div class="mb-2">
<label class="form-label" for="bug-ourl">Expected URL <span class="text-muted">(optional)</span></label>
<input id="bug-ourl" class="form-control" name="ourl" type="url" />
</div>
<div class="form-check mb-2">
<input class="form-check-input" type="checkbox" id="bug-repeat" />
<label class="form-check-label" for="bug-repeat">This happens every time</label>
</div>
<div class="mb-2">
<label class="form-label" for="bug-entry">What happened</label>
<textarea id="bug-entry" class="form-control" name="entry" rows="3" required></textarea>
</div>
<p id="bug-status" class="small" hidden></p>
<button class="btn btn-primary" type="submit">Send report</button>
</form>
</div>
</div>
</div>
</div>
</section>
@ -315,7 +407,13 @@
<div class="col-12 col-lg-10 mx-auto p-4 rounded shadow-sm context-main-bg">
<h1 class="h3">Search</h1>
<p class="text-muted" id="search-summary"></p>
<p class="mb-0 text-muted">Results will come from the site search API next.</p>
<p id="search-error" class="text-danger" hidden></p>
<div id="search-results" class="list-group mb-3"></div>
<nav id="search-pager" class="d-flex gap-2" hidden>
<button id="search-prev" type="button" class="btn btn-sm btn-outline-primary">Previous</button>
<span id="search-page-label" class="align-self-center small text-muted"></span>
<button id="search-next" type="button" class="btn btn-sm btn-outline-primary">Next</button>
</nav>
</div>
</div>
</section>
@ -324,6 +422,7 @@
<div class="m-2 m-lg-4">
<div class="col-12 col-sm-10 col-lg-8 mx-auto p-4 rounded shadow-sm context-main-bg">
<h1 class="h3 text-center">Notifications</h1>
<p id="notifications-empty" class="text-muted text-center" hidden></p>
<table class="table">
<tbody id="notification-list"></tbody>
</table>
@ -334,22 +433,54 @@
<section id="view-messages" class="view" hidden>
<div class="m-2 m-lg-4">
<div class="col-12 col-sm-10 col-lg-8 mx-auto p-4 rounded shadow-sm context-main-bg">
<div class="d-flex justify-content-between align-items-center mb-3">
<h1 class="h3 mb-0">Messages</h1>
<button type="button" class="btn btn-sm btn-primary" disabled>
<i class="fa fa-fw fa-pen"></i> New message
</button>
<div id="messages-inbox">
<div class="d-flex justify-content-between align-items-center mb-3">
<h1 class="h3 mb-0">Messages</h1>
<a href="#/messages/new" class="btn btn-sm btn-primary" id="messages-new">
<i class="fa fa-fw fa-pen"></i> New message
</a>
</div>
<p id="messages-empty" class="text-muted" hidden></p>
<table class="table table-striped">
<thead>
<tr>
<th>With</th>
<th>Last message</th>
<th>Updated</th>
</tr>
</thead>
<tbody id="message-list"></tbody>
</table>
</div>
<div id="messages-compose" hidden>
<h1 class="h3">New message</h1>
<form id="compose-form">
<div class="mb-3">
<label class="form-label" for="compose-to">Username</label>
<input id="compose-to" class="form-control" name="toUser" type="text" autocomplete="username" required />
</div>
<div class="mb-3">
<label class="form-label" for="compose-body">Message</label>
<textarea id="compose-body" class="form-control" name="message" rows="4" required></textarea>
</div>
<p id="compose-error" class="text-danger" hidden></p>
<button class="btn btn-primary" type="submit">Send</button>
<a href="#/messages" class="btn btn-link">Cancel</a>
</form>
</div>
<div id="messages-thread" hidden>
<button id="thread-back" type="button" class="btn btn-link px-0 mb-2">
<i class="fa fa-fw fa-arrow-left"></i> Inbox
</button>
<h1 class="h3" id="thread-title"></h1>
<p id="thread-error" class="text-danger" hidden></p>
<div id="thread-lines" class="capsule-thread mb-3"></div>
<form id="thread-reply">
<label class="form-label" for="thread-body">Reply</label>
<textarea id="thread-body" class="form-control mb-2" rows="3" required></textarea>
<button class="btn btn-primary" type="submit">Send</button>
</form>
</div>
<table class="table table-striped">
<thead>
<tr>
<th>With</th>
<th>Last message</th>
<th>Updated</th>
</tr>
</thead>
<tbody id="message-list"></tbody>
</table>
</div>
</div>
</section>
@ -424,6 +555,10 @@
<label class="form-label d-block" for="settings-avatar-file">Avatar</label>
<input id="settings-avatar-file" class="form-control" type="file" accept="image/*" />
</div>
<div class="mb-3">
<label class="form-label" for="settings-name">Display name</label>
<input id="settings-name" class="form-control" name="name" type="text" autocomplete="name" />
</div>
<div class="mb-3">
<label class="form-label" for="settings-gender">Gender</label>
<select id="settings-gender" class="form-select" name="gender">
@ -458,9 +593,10 @@
<label class="form-check-label" for="settings-dark">Enable Dark-Mode viewing</label>
</div>
<p id="settings-note" class="small text-muted">
Saving will use the site API next. This form matches User CP preferences.
Email, password, and phone stay on the site.
</p>
<p id="settings-status" class="text-success" hidden></p>
<p id="settings-error" class="text-danger" hidden></p>
<button class="btn btn-lg btn-primary w-100" type="submit">Update</button>
</fieldset>
</form>