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( return templates.TemplateResponse(
"bulletin_list.html", "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) @html_router.get("/bulletins/new", response_class=HTMLResponse)

View File

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