1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-11-09 20:00:12 +00:00
jfa-go/html/admin.html
Harvey Tindall 88f4de9c46
implement accounts tab functionality
also:
* added a homemade loading animation to buttons
* respect disabled invite emails and email address as username
2021-01-01 23:31:32 +00:00

280 lines
16 KiB
HTML

<!DOCTYPE html>
<html lang="en" class="light-theme">
<head>
<link rel="stylesheet" type="text/css" href="css/base.css">
<script>
window.URLBase = "{{ .urlBase }}";
window.notificationsEnabled = {{ .notifications }};
window.emailEnabled = {{ .email_enabled }};
window.ombiEnabled = {{ .ombiEnabled }};
window.usernamesEnabled = {{ .username }};
</script>
{{ template "header.html" . }}
<title>Admin - jfa-go</title>
</head>
<body class="max-w-full overflow-x-hidden section">
<div id="modal-login" class="modal">
<form class="modal-content card" id="form-login" href="">
<span class="heading">Login</span>
<input type="text" class="field input ~neutral !high mt-half mb-1" placeholder="username" id="login-user">
<input type="password" class="field input ~neutral !high mb-1" placeholder="password" id="login-password">
<label>
<input type="submit" class="unfocused">
<span class="button ~urge !normal full-width center supra submit">Login</span>
</label>
</form>
</div>
<div id="modal-add-user" class="modal">
<form class="modal-content card" id="form-add-user" href="">
<span class="heading">New User <span class="modal-close">&times;</span></span>
<input type="text" class="field input ~neutral !high mt-half mb-1" placeholder="username" id="add-user-user">
<input type="email" class="field input ~neutral !high mt-half mb-1" placeholder="email address">
<input type="password" class="field input ~neutral !high mb-1" placeholder="password" id="add-user-password">
<label>
<input type="submit" class="unfocused">
<span class="button ~urge !normal full-width center supra submit">Create</span>
</label>
</form>
</div>
<div id="modal-about" class="modal">
<div class="modal-content content card">
<span class="heading">About <span class="modal-close">&times;</span></span>
<img src="/banner.svg" class="mt-1" alt="jfa-go banner">
<p><i class="icon ri-github-fill"></i><a href="https://github.com/hrfee/jfa-go">jfa-go</a></p>
<p>Version <span class="code monospace">{{ .version }}</span></p>
<p>Commit <span class="code monospace">{{ .commit }}</span></p>
<p><a href="https://github.com/hrfee/jfa-go/blob/main/LICENSE">Available under the MIT License.</a></p>
</div>
</div>
<div id="modal-modify-user" class="modal">
<form class="modal-content card" id="form-modify-user" href="">
<span class="heading">Modify Settings for <span id="header-modify-user"></span> <span class="modal-close">&times;</span></span>
<p class="content">Apply settings from an existing profile, or source them directly from a user.</p>
<div class="flex-row mb-1">
<label class="flex-row-group mr-1">
<input type="radio" name="modify-user-source" class="unfocused" id="radio-use-profile" checked>
<span class="button ~neutral !high supra full-width center">Profile</span>
</label>
<label class="flex-row-group ml-1">
<input type="radio" name="modify-user-source" class="unfocused" id="radio-use-user">
<span class="button ~neutral !normal supra full-width center">User</span>
</label>
</div>
<div class="select ~neutral !normal mb-1">
<select id="modify-user-profiles">
<option>Friends</option>
<option>Family</option>
<option>Default</option>
</select>
</div>
<div class="select ~neutral !normal mb-1 unfocused">
<select id="modify-user-users">
<option>Person</option>
<option>Other person</option>
</select>
</div>
<label class="switch mb-1">
<input type="checkbox" id="modify-user-homescreen" checked>
<span>Apply homescreen layout</span>
</label>
<label>
<input type="submit" class="unfocused">
<span class="button ~urge !normal full-width center supra submit">Apply</span>
</label>
</form>
</div>
<div id="modal-delete-user" class="modal">
<form class="modal-content card" id="form-delete-user" href="">
<span class="heading">Delete <span id="header-delete-user"></span> <span class="modal-close">&times;</span></span>
<div class="content mt-half">
<label class="switch mb-1">
<input type="checkbox" id="delete-user-notify" checked>
<span>Send notification email</span>
</label>
<textarea id="textarea-delete-user" class="textarea full-width ~neutral !normal mb-1" placeholder="Your account has been deleted."></textarea>
<label>
<input type="submit" class="unfocused">
<span class="button ~critical !normal full-width center supra submit">Delete</span>
</label>
</div>
</form>
</div>
<div id="modal-restart" class="modal">
<div class="modal-content card ~critical !normal">
<span class="heading">Restart needed <span class="modal-close">&times;</span></span>
<p class="content pb-1">A restart is needed to apply some settings you changed. Do it now or later?</p>
<div class="fr">
<span class="button ~info !normal">Apply, restart later</span>
<span class="button ~critical !normal">Apply &amp; restart</span>
</div>
</div>
</div>
<div id="modal-refresh" class="modal">
<div class="modal-content card ~urge !normal">
<span class="heading">Settings applied.</span>
<p class="content">Refresh the page in a few seconds.</p>
</div>
</div>
<div id="modal-ombi-defaults" class="modal">
<form class="modal-content card" id="form-ombi-defaults" href="">
<span class="heading">Ombi user defaults <span class="modal-close">&times;</span></span>
<p class="content">Create an Ombi user and configure it, then select it here. It's settings/permissions will be stored and applied to new ombi users created by jfa-go.</p>
<div class="select ~neutral !normal mb-1">
<select>
<option>Person</option>
<option>Other person</option>
</select>
</div>
<label>
<input type="submit" class="unfocused">
<span class="button ~urge !normal full-width center supra submit">Submit</span>
</label>
</form>
</div>
<div id="notification-box"></div>
<div class="page-container max-w-screen-lg px-6 py-4 mx-auto lg:mx-auto md:py-8">
<div class="mb-1">
<header class="flex flex-wrap items-center justify-between">
<div class="text-neutral-700">
<span id="invitesTab-button" class="tab-button portal ~urge active">Invites</span>
<span id="accountsTab-button" class="tab-button portal">Accounts</span>
<span id="settingsTab-button" class="tab-button portal">Settings</span>
</div>
</header>
</div>
<div class="mb-1">
<div class="text-neutral-700">
<span class="button ~critical !normal mb-1 unfocused" id="logout-button">Logout</span>
<span id="button-theme" class="button ~neutral !normal mb-1">Theme</span>
</div>
</div>
<div id="invitesTab">
<div class="card ~neutral !low invites mb-1">
<span class="heading">Invites</span>
<div id="invites"></div>
</div>
<div class="card ~neutral !low">
<span class="heading">Create</span>
<div class="row" id="create-inv">
<div class="card ~neutral !normal col">
<label class="label supra" for="create-days">Days</label>
<div class="select ~neutral !normal mb-1 mt-half">
<select id="create-days">
<option>0</option>
</select>
</div>
<label class="label supra" for="create-hours">Hours</label>
<div class="select ~neutral !normal mb-1 mt-half">
<select id="create-hours">
<option>0</option>
</select>
</div>
<label class="label supra" for="create-minutes">Minutes</label>
<div class="select ~neutral !normal mb-1 mt-half">
<select id="create-minutes">
<option>0</option>
</select>
</div>
</div>
<div class="card ~neutral !normal col">
<label class="label supra" for="create-uses">Number of uses</label>
<div class="flex-expand mb-1 mt-half">
<input type="number" min="0" id="create-uses" class="input ~neutral !normal mr-1" value=1>
<label for="create-inf-uses" class="button ~neutral !normal">
<span></span>
<input type="checkbox" class="unfocused" id="create-inf-uses" aria-label="Set uses to infinite">
</label>
</div>
<p class="support unfocused" id="create-inf-uses-warning"><span class="badge ~critical">Warning</span> invites with infinite uses can be used abusively.</p>
<label class="label supra">Profile</label>
<div class="select ~neutral !normal mb-1 mt-half">
<select id="create-profile">
</select>
</div>
<div id="create-send-to-container">
<label class="label supra">Send to</label>
<div class="flex-expand mb-1 mt-half">
<input type="email" id="create-send-to" class="input ~neutral !normal mr-1" placeholder="example@example.com">
<label for="create-send-to-enabled" class="button ~neutral !normal">
<input type="checkbox" id="create-send-to-enabled" aria-label="Send to address enabled">
</label>
</div>
</div>
<span class="button ~urge !normal supra full-width center lg" id="create-submit">Create</span>
</div>
</div>
</div>
</div>
<div id="accountsTab" class="unfocused">
<div class="card ~neutral !low accounts mb-1">
<span class="heading">Accounts</span>
<div class="fr">
<span class="button ~neutral !normal" id="accounts-add-user">Add User</span>
<span class="button ~urge !normal" id="accounts-modify-user">Modify Settings</span>
<span class="button ~critical !normal" id="accounts-delete-user">Delete User</span>
</div>
<div class="card ~neutral !normal accounts-header mt-half">
<table class="table">
<thead>
<tr>
<th><input type="checkbox" value="" id="accounts-select-all"></th>
<th>Username</th>
<th>Email Address</th>
<th>Last Active</th>
</tr>
</thead>
<tbody id="accounts-list"></tbody>
</table>
</div>
</div>
</div>
<div id="settingsTab" class="unfocused">
<div class="card ~neutral !low settings">
<span class="heading">Settings</span>
<div class="fr">
<span class="button ~neutral !normal" id="accounts-add-user">Save</span>
</div>
<div class="row">
<div class="card ~neutral !normal col">
<aside class="aside sm ~info mb-half">Note: <span class="badge ~critical">*</span> indicates a required field, <span class="badge ~critical">R</span> indicates changes require a restart.</aside>
<span class="button ~neutral !low settings-section-button mb-half" id="setting-about">About</span>
<span class="button ~neutral !low settings-section-button mb-half selected">User Profiles</span>
</div>
<div class="card ~neutral !normal col">
<div class="settings-section">
<p class="support lg mb-half">Settings section description.</p>
<div class="setting">
<label class="label" for="settings-select">Select <span class="badge ~critical">R</span></label>
<div class="select ~neutral !normal mt-half">
<select id="settings-select">
<option>Option 1</option>
</select>
</div>
</div>
<div class="setting">
<label class="label" for="settings-input">
Input <span class="badge ~critical">*</span>
<div class="tooltip right">
<i class="icon ri-information-line"></i>
<span class="content sm">An example tooltip.</span>
</div>
</label>
<input type="text" class="input ~neutral !normal mt-half" placeholder="Value">
</div>
<div class="setting">
<label class="switch settings">
<input type="checkbox" id="settings-check">
<span>Checkbox <span class="badge ~critical">R</span></span>
</label>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="js/admin.js" type="module"></script>
</body>
</html>