new file: .env.example
new file: .gitignore new file: Dockerfile new file: README.md new file: app.py new file: auth.py new file: config.py new file: db.py new file: db_helpers.py new file: docker-compose.yml new file: requirements.txt new file: routes/__init__.py new file: routes/admin_routes.py new file: routes/auth_routes.py new file: routes/journal_routes.py new file: static/css/style.css new file: static/js/main.js new file: templates/admin/dashboard.html new file: templates/admin/users.html new file: templates/base.html new file: templates/day.html new file: templates/future.html new file: templates/index.html new file: templates/login.html new file: templates/week.html
This commit is contained in:
49
templates/admin/dashboard.html
Normal file
49
templates/admin/dashboard.html
Normal file
@@ -0,0 +1,49 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Admin – Bullet Journal{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-head">
|
||||
<div>
|
||||
<h1>Admin-Panel</h1>
|
||||
<p class="muted">Zentrales Dashboard</p>
|
||||
</div>
|
||||
<a href="{{ url_for('admin.users') }}" class="btn">Benutzer verwalten</a>
|
||||
</div>
|
||||
|
||||
<section class="stat-grid">
|
||||
<div class="stat-card">
|
||||
<span class="stat-number">{{ total_users }}</span>
|
||||
<span class="stat-label">Benutzer</span>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<span class="stat-number">{{ total_admins }}</span>
|
||||
<span class="stat-label">Admins</span>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<span class="stat-number">{{ total_notes }}</span>
|
||||
<span class="stat-label">Notizen</span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<h2>Kürzlich angelegte Benutzer</h2>
|
||||
{% if recent %}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr><th>Benutzername</th><th>E-Mail</th><th>Rolle</th><th>Erstellt</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for u in recent %}
|
||||
<tr>
|
||||
<td>{{ u.username }}</td>
|
||||
<td>{{ u.email or '–' }}</td>
|
||||
<td>{{ 'Admin' if u.is_admin else 'Benutzer' }}</td>
|
||||
<td>{{ u.created_at.strftime('%d.%m.%Y %H:%M') if u.created_at else '–' }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p class="muted">Noch keine Benutzer.</p>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
79
templates/admin/users.html
Normal file
79
templates/admin/users.html
Normal file
@@ -0,0 +1,79 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Benutzerverwaltung – Bullet Journal{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-head">
|
||||
<div>
|
||||
<h1>Benutzerverwaltung</h1>
|
||||
<p class="muted">Accounts erstellen und verwalten</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="card">
|
||||
<h2>Neuen Benutzer anlegen</h2>
|
||||
<form method="post" action="{{ url_for('admin.users') }}" class="note-form">
|
||||
<div class="note-form-row">
|
||||
<label>
|
||||
Benutzername
|
||||
<input type="text" name="username" required>
|
||||
</label>
|
||||
<label>
|
||||
Passwort
|
||||
<input type="text" name="password" required>
|
||||
</label>
|
||||
<label>
|
||||
E-Mail
|
||||
<input type="email" name="email">
|
||||
</label>
|
||||
<label class="checkbox-label">
|
||||
<input type="checkbox" name="is_admin" value="1"> Admin
|
||||
</label>
|
||||
<button type="submit" class="btn btn-primary">Anlegen</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<h2>Alle Benutzer</h2>
|
||||
{% if users %}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Benutzername</th>
|
||||
<th>E-Mail</th>
|
||||
<th>Rolle</th>
|
||||
<th>Notizen</th>
|
||||
<th>Erstellt</th>
|
||||
<th>Aktionen</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for u in users %}
|
||||
<tr>
|
||||
<td>{{ u.id }}</td>
|
||||
<td>{{ u.username }}</td>
|
||||
<td>{{ u.email or '–' }}</td>
|
||||
<td>{{ 'Admin' if u.is_admin else 'Benutzer' }}</td>
|
||||
<td>{{ u.note_count }}</td>
|
||||
<td>{{ u.created_at.strftime('%d.%m.%Y') if u.created_at else '–' }}</td>
|
||||
<td class="table-actions">
|
||||
<form method="post" action="{{ url_for('admin.reset_password', user_id=u.id) }}" class="inline">
|
||||
<input type="text" name="new_password" placeholder="Neues Passwort" required>
|
||||
<button class="btn btn-small">PW zurücksetzen</button>
|
||||
</form>
|
||||
{% if u.id != session.get('user_id') %}
|
||||
<form method="post" action="{{ url_for('admin.delete_user', user_id=u.id) }}" class="inline"
|
||||
onsubmit="return confirm('Benutzer wirklich löschen? Alle Notizen gehen verloren.');">
|
||||
<button class="btn btn-small btn-danger">Löschen</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p class="muted">Keine Benutzer vorhanden.</p>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user