feat: Basic domain admin page

This commit is contained in:
selfhoster selfhoster 2026-09-19 10:44:44 +02:00
commit ae5d466e99
5 changed files with 92 additions and 2 deletions

30
templates/domain.html Normal file
View file

@ -0,0 +1,30 @@
{% extends 'base.html' %}
{% block main %}
<main id="center">
<img src="/assets/img/logo.png" id="logo">
<p style="text-align: center;">You are logged in as {{ user.username }}</p>
<div id="login-line">
<a href="/logout" id="submit-login" value="Logout">Logout</a>
</div>
{% if can_create_user %}
<div>
<h2>Create user</h2>
<form action="/user" method="POST">
<input type="hidden" name="domainname" value="{{ domain.name }}">
<input type="text" name="username" placeholder="username">
<input type="password" name="password" placeholder="password">
<button type="submit" class="button is-info">Create</button>
</form>
</div>
{% endif %}
<div>
<h2>Users on {{ domain.name }}</h2>
<ul>
{% for user in users %}
<li>{{ user.mail }}</li>
{% endfor %}
</ul>
</div>
</main>
{% endblock %}

View file

@ -9,7 +9,7 @@
{% if can_create_domain %}
<div>
<h2>Create domain</h2>
<form action="/domains" method="POST">
<form action="/domain" method="POST">
<input type="text" name="domainname" placeholder="example.com">
<button type="submit" class="button is-info">Create</button>
</form>