Files
bookapp/templates/admin_spend.html
Mike Wichers f7099cc3e4 v2.0.0: Modularize project into single-responsibility packages
Replaced monolithic modules/ package with a clean architecture:

- core/       config.py, utils.py
- ai/         models.py (ResilientModel), setup.py (init_models)
- story/      planner.py, writer.py, editor.py, style_persona.py, bible_tracker.py
- marketing/  cover.py, blurb.py, fonts.py, assets.py
- export/     exporter.py
- web/        app.py (Flask factory), db.py, helpers.py, tasks.py, routes/{auth,project,run,persona,admin}.py
- cli/        engine.py (run_generation), wizard.py (BookWizard)

Flask routes split into 5 Blueprints; all templates updated with blueprint-
prefixed url_for() calls. Dockerfile and docker-compose updated to use
web.app entry point and new package paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 22:20:53 -05:00

60 lines
2.5 KiB
HTML

{% extends "base.html" %}
{% block content %}
<div class="row mb-4">
<div class="col-md-8">
<h2><i class="fas fa-chart-line me-2 text-success"></i>Spend Report</h2>
<p class="text-muted">Aggregate cost analysis per user.</p>
</div>
<div class="col-md-4 text-end">
<a href="{{ url_for('admin.admin_dashboard') }}" class="btn btn-outline-secondary">Back to Admin</a>
</div>
</div>
<div class="card shadow-sm mb-4">
<div class="card-header bg-light d-flex justify-content-between align-items-center">
<h5 class="mb-0">Period Overview</h5>
<div class="btn-group btn-group-sm">
<a href="?days=7" class="btn btn-outline-secondary {{ 'active' if days == 7 }}">7 Days</a>
<a href="?days=30" class="btn btn-outline-secondary {{ 'active' if days == 30 }}">30 Days</a>
<a href="?days=90" class="btn btn-outline-secondary {{ 'active' if days == 90 }}">90 Days</a>
<a href="?days=0" class="btn btn-outline-secondary {{ 'active' if days == 0 }}">All Time</a>
</div>
</div>
<div class="card-body">
<div class="row text-center">
<div class="col-md-12">
<h2 class="text-success fw-bold">${{ "%.4f"|format(total) }}</h2>
<span class="text-muted">Total Spend ({{ 'Last ' ~ days ~ ' Days' if days > 0 else 'All Time' }})</span>
</div>
</div>
</div>
</div>
<div class="card shadow-sm">
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-hover mb-0 align-middle">
<thead class="table-light">
<tr>
<th>User</th>
<th class="text-center">Runs Generated</th>
<th class="text-end">Total Cost</th>
</tr>
</thead>
<tbody>
{% for row in report %}
<tr>
<td class="fw-bold">{{ row.username }}</td>
<td class="text-center"><span class="badge bg-secondary">{{ row.runs }}</span></td>
<td class="text-end font-monospace">${{ "%.4f"|format(row.cost) }}</td>
</tr>
{% else %}
<tr><td colspan="3" class="text-center py-4 text-muted">No spending data found for this period.</td></tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock %}