| {% extends "base.html" %} {# Assuming a base template exists or will be created #} |
|
|
| {% block title %}Drafts - PoliSage{% endblock %} |
|
|
| {% block content %} |
| <div class="container mt-4"> |
| <div class="d-flex justify-content-between align-items-center mb-3"> |
| <h2>Drafts</h2> |
| <a href="{{ url_for("drafting.create_draft") }}" class="btn btn-primary"> |
| <i class="bi bi-plus-circle me-1"></i> New Draft |
| </a> |
| </div> |
|
|
| {% with messages = get_flashed_messages(with_categories=true) %} |
| {% if messages %} |
| {% for category, message in messages %} |
| <div class="alert alert-{{ category }} alert-dismissible fade show" role="alert"> |
| {{ message }} |
| <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> |
| </div> |
| {% endfor %} |
| {% endif %} |
| {% endwith %} |
|
|
| {% if drafts %} |
| <div class="list-group"> |
| {% for draft in drafts %} |
| <a href="{{ url_for("drafting.view_draft", draft_id=draft.id) }}" class="list-group-item list-group-item-action flex-column align-items-start"> |
| <div class="d-flex w-100 justify-content-between"> |
| <h5 class="mb-1">{{ draft.title }}</h5> |
| <small>{{ draft.last_updated.strftime("%Y-%m-%d %H:%M") }}</small> |
| </div> |
| <p class="mb-1">Status: <span class="badge bg-secondary">{{ draft.status }}</span></p> |
| <small>Author: {{ draft.author.username if draft.author else "N/A" }}</small> |
| </a> |
| {% endfor %} |
| </div> |
| {% else %} |
| <div class="alert alert-info" role="alert"> |
| No drafts found. <a href="{{ url_for("drafting.create_draft") }}">Create a new one?</a> |
| </div> |
| {% endif %} |
| </div> |
| {% endblock %} |
|
|
|
|