2016-04-30 14:28:33 -04:00
|
|
|
<!doctype html>
|
2016-03-12 13:50:43 -05:00
|
|
|
<html>
|
|
|
|
<head>
|
2022-12-28 12:05:56 -05:00
|
|
|
<title>Tilde Friends Sign-in</title>
|
2021-01-02 13:10:00 -05:00
|
|
|
<link type="text/css" rel="stylesheet" href="/static/style.css" />
|
|
|
|
<link type="image/png" rel="shortcut icon" href="/static/favicon.png" />
|
2016-03-12 13:50:43 -05:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
|
|
</head>
|
|
|
|
<body>
|
2022-12-28 12:05:56 -05:00
|
|
|
<h1 style="text-align: center">Tilde Friends Sign-in</h1>
|
2023-08-09 18:38:41 -04:00
|
|
|
<tf-auth id="auth"></tf-auth>
|
|
|
|
<script>
|
|
|
|
window.litDisableBundleWarning = true;
|
|
|
|
</script>
|
|
|
|
<script type="module">
|
2024-02-08 20:21:57 -05:00
|
|
|
import {LitElement, html} from '/lit/lit-all.min.js';
|
2023-08-09 18:38:41 -04:00
|
|
|
let g_data = $AUTH_DATA;
|
|
|
|
let app = document.getElementById('auth');
|
|
|
|
Object.assign(app, g_data);
|
|
|
|
|
|
|
|
class TfAuthElement extends LitElement {
|
|
|
|
static get_properties() {
|
|
|
|
return {
|
|
|
|
name: {type: String},
|
|
|
|
tab: {type: String},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
super();
|
|
|
|
this.tab = 'login';
|
|
|
|
}
|
|
|
|
|
|
|
|
tab_changed(name) {
|
|
|
|
this.tab = name;
|
|
|
|
this.requestUpdate();
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
let self = this;
|
|
|
|
return html`
|
|
|
|
<style>
|
|
|
|
[name="tab"] {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
[name="tab"]+label {
|
2023-08-12 07:54:27 -04:00
|
|
|
background-color: #586e75;
|
2023-08-09 18:38:41 -04:00
|
|
|
padding: 1em;
|
|
|
|
display: inline-block;
|
|
|
|
flex: 1 0;
|
|
|
|
text-align: center;
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
[name="tab"]+label:hover {
|
|
|
|
background-color: #dc322f;
|
|
|
|
}
|
|
|
|
[name="tab"]:checked+label {
|
|
|
|
background-color: #93a1a1;
|
2023-08-12 07:54:27 -04:00
|
|
|
border: 2px solid #eee8d5;
|
2023-08-09 18:38:41 -04:00
|
|
|
}
|
|
|
|
.error {
|
|
|
|
color: #f00;
|
|
|
|
border: 1px solid #f00;
|
|
|
|
margin: 4px;
|
|
|
|
padding: 8px;
|
|
|
|
}
|
2023-08-12 07:54:27 -04:00
|
|
|
form label {
|
|
|
|
padding-top: 1em;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
form input {
|
|
|
|
font-size: x-large;
|
|
|
|
padding: 4px;
|
|
|
|
}
|
|
|
|
input[type="submit"] {
|
|
|
|
margin-top: 1em;
|
|
|
|
margin-bottom: 1em;
|
|
|
|
padding: 1em;
|
|
|
|
}
|
2023-08-09 18:38:41 -04:00
|
|
|
</style>
|
2023-08-12 07:54:27 -04:00
|
|
|
<div style="display: flex; flex-direction: column; max-width: 1280px; margin: auto">
|
2023-08-09 18:38:41 -04:00
|
|
|
<h1 ?hidden=${this.name}>Welcome.</h1>
|
|
|
|
<h1 ?hidden=${this.name === undefined}>Welcome, ${this.name}.</h1>
|
|
|
|
|
|
|
|
<div style="display: flex; flex-direction: row; width: 100%">
|
|
|
|
<input type="radio" name="tab" id="login" value="Login" ?checked=${this.tab == 'login'} @change=${() => self.tab_changed('login')}></input>
|
|
|
|
<label for="login" id="login_label">Login</label>
|
|
|
|
|
|
|
|
<input type="radio" name="tab" id="register" value="Register" ?checked=${this.tab == 'register'} @change=${() => self.tab_changed('register')}></input>
|
|
|
|
<label for="register" id="register_label">Register</label>
|
|
|
|
|
|
|
|
<input type="radio" name="tab" id="guest" value="Guest" ?checked=${this.tab == 'guest'} @change=${() => self.tab_changed('guest')}></input>
|
|
|
|
<label for="guest" id="guest_label">Guest</label>
|
2023-09-22 18:59:26 -04:00
|
|
|
|
|
|
|
<input type="radio" name="tab" id="change" value="Change Password" ?checked=${this.tab == 'change'} @change=${() => self.tab_changed('change')}></input>
|
|
|
|
<label for="change" id="change_label">Change Password</label>
|
2023-08-09 18:38:41 -04:00
|
|
|
</div>
|
|
|
|
|
2023-09-22 18:59:26 -04:00
|
|
|
<div ?hidden=${this.tab != 'login' && this.tab != 'register' && this.tab != 'change'}>
|
2023-08-09 18:38:41 -04:00
|
|
|
<div id="error" ?hidden=${this.error === undefined} class="error">
|
|
|
|
${this.error}
|
|
|
|
</div>
|
2023-08-12 07:54:27 -04:00
|
|
|
<form method="POST" style="display: flex; flex-direction: column">
|
|
|
|
<label for="name">Name:</label>
|
|
|
|
<input type="text" id="name" name="name"></input>
|
|
|
|
|
2023-09-22 18:59:26 -04:00
|
|
|
<label for="password">${this.tab == 'change' ? 'Old ' : ''}Password:</label>
|
2023-08-12 07:54:27 -04:00
|
|
|
<input type="password" id="password" name="password"></input>
|
|
|
|
|
2023-09-22 18:59:26 -04:00
|
|
|
<label ?hidden=${this.tab != 'change'} for="new_password">New Password:</label>
|
2023-09-23 17:29:01 -04:00
|
|
|
<input ?hidden=${this.tab != 'change'} type="password" id="new_password" name="new_password"></input>
|
2023-09-22 18:59:26 -04:00
|
|
|
|
|
|
|
<label ?hidden=${this.tab != 'register' && this.tab != 'change'} for="confirm">Confirm ${this.tab == 'change' ? 'New ' : ''}Password:</label>
|
|
|
|
<input ?hidden=${this.tab != 'register' && this.tab != 'change'} type="password" id="confirm" name="confirm"></input>
|
2023-08-12 07:54:27 -04:00
|
|
|
|
|
|
|
<input id="loginButton" type="submit" name="submit" value="Login"></input>
|
2023-08-09 18:38:41 -04:00
|
|
|
<input type="hidden" name="register" value="${this.tab == 'register' ? 1 : 0}"></input>
|
2023-09-22 18:59:26 -04:00
|
|
|
<input type="hidden" name="change" value="${this.tab == 'change' ? 1 : 0}"></input>
|
2023-08-09 18:38:41 -04:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<div ?hidden=${this.tab != 'guest'}>
|
2023-08-12 07:54:27 -04:00
|
|
|
<form method="POST" style="display: flex; flex-direction: column">
|
2023-08-09 18:38:41 -04:00
|
|
|
<input type="submit" id="guestButton" name="guestButton" value="Proceed as Guest"></input>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div ?hidden=${this.have_administrator} class="notice">
|
|
|
|
There is currently no administrator. You will be made administrator.
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<h2>Code of Conduct</h2>
|
2023-08-12 07:54:27 -04:00
|
|
|
<textarea readonly rows="20" cols="80" style="resize: none">${this.code_of_conduct}</textarea>
|
2023-08-09 18:38:41 -04:00
|
|
|
</div>
|
|
|
|
`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
customElements.define('tf-auth', TfAuthElement);
|
|
|
|
</script>
|
2016-03-12 13:50:43 -05:00
|
|
|
</body>
|
|
|
|
</html>
|