Fixed small username bug.

This commit is contained in:
Michael Woods
2025-12-27 15:47:24 -05:00
parent 342f32f499
commit 13eac22741
2 changed files with 25 additions and 24 deletions

View File

@@ -130,7 +130,11 @@ async def bulletin_list_page(
return templates.TemplateResponse(
"bulletin_list.html",
{"request": request, "bulletins": bulletins, "current_user": current_user.username}
{
"request": request,
"bulletins": bulletins,
"current_user": current_user.username
}
)
@html_router.get("/bulletins/new", response_class=HTMLResponse)

View File

@@ -1,34 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bulletins - PacketServer</title>
<link rel="stylesheet" href="{{ url_for('static', path='/css/style.css') }}">
</head>
<body>
<h1>Bulletins</h1>
{% extends "base.html" %}
{% block title %}Bulletins - {{ server_name }}{% endblock %}
{% block content %}
<div class="container mt-4">
<h1 class="mb-4">Bulletins</h1>
{% if current_user %}
<p><a href="/bulletins/new">Create New Bulletin</a></p>
<p class="mb-4"><a href="/bulletins/new" class="btn btn-primary">Create New Bulletin</a></p>
{% else %}
<p><em>Log in to create bulletins.</em></p>
<p class="mb-4"><em>Log in to create bulletins.</em></p>
{% endif %}
{% if bulletins %}
<ul>
<ul class="list-unstyled">
{% for bull in bulletins %}
<li>
<strong><a href="/bulletins/{{ bull.id }}">{{ bull.subject }}</a></strong>
<div class="meta">by {{ bull.author }} on {{ bull.created_at[:10] }}</div>
<div class="preview">{{ bull.body[:200] }}{% if bull.body|length > 200 %}...{% endif %}</div>
<hr>
</li>
<li class="mb-4 pb-4 border-bottom">
<strong><a href="/bulletins/{{ bull.id }}" class="text-decoration-none">{{ bull.subject }}</a></strong>
<div class="text-muted small">by {{ bull.author }} on {{ bull.created_at[:10] }}</div>
<div class="mt-2">{{ bull.body[:200] }}{% if bull.body|length > 200 %}...{% endif %}</div>
</li>
{% endfor %}
</ul>
</ul>
{% else %}
<p>No bulletins yet.</p>
<p>No bulletins yet.</p>
{% endif %}
<p><a href="/dashboard">← Back to Dashboard</a></p>
</body>
</html>
<p><a href="{{ url_for('dashboard') }}">← Back to Dashboard</a></p>
</div>
{% endblock %}