Add admin interface with trip and trip-admin management

This commit is contained in:
Ian Gulliver
2026-02-14 22:17:32 -08:00
parent f31a22d5f8
commit 7cc73fe02c
5 changed files with 409 additions and 31 deletions

View File

@@ -1,5 +1,29 @@
const CLIENT_ID = '{{.env.CLIENT_ID}}';
function initHead() {
document.documentElement.className = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'wa-dark' : 'wa-light';
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', e => {
document.documentElement.className = e.matches ? 'wa-dark' : 'wa-light';
});
const head = document.head;
const addLink = (rel, type, href) => {
const link = document.createElement('link');
link.rel = rel;
if (type) link.type = type;
link.href = href;
head.appendChild(link);
};
addLink('stylesheet', null, 'https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist-cdn/styles/themes/default.css');
const script = document.createElement('script');
script.type = 'module';
script.src = 'https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist-cdn/webawesome.loader.js';
head.appendChild(script);
}
initHead();
function getProfile() {
const data = localStorage.getItem('profile');
return data ? JSON.parse(data) : null;
@@ -97,9 +121,10 @@ export async function init() {
const buttonContainer = document.createElement('div');
signin.appendChild(buttonContainer);
const isDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
google.accounts.id.renderButton(buttonContainer, {
type: 'standard',
theme: 'filled_black',
theme: isDark ? 'outline' : 'filled_black',
size: 'large',
text: 'sign_in_with',
shape: 'pill',