05/06 Phase 2: fixed issues

This commit is contained in:
2026-05-07 11:09:06 -04:00
parent 5b26836399
commit 9f7d656d5e
29 changed files with 1442 additions and 94 deletions
+58
View File
@@ -0,0 +1,58 @@
{% extends "admin/layouts/base.html" %}
{% block title %}Tenants{% endblock %}
{% block content %}
<div class="d-flex justify-content-between align-items-center mb-4">
<h4 class="fw-bold mb-0"><i class="bi bi-building me-2"></i>Tenants</h4>
<a href="{{ url_for('tenants.create') }}" class="btn btn-dark btn-sm">
<i class="bi bi-plus-lg me-1"></i>New Tenant
</a>
</div>
<div class="card shadow-sm mb-3">
<div class="card-body py-2">
<form method="GET" class="d-flex gap-2 align-items-center">
<label class="text-muted small me-1">Filter by status:</label>
{% for s in ['', 'active', 'trial', 'suspended', 'cancelled'] %}
<a href="{{ url_for('tenants.index', status=s) }}"
class="btn btn-sm {{ 'btn-dark' if status_filter == s else 'btn-outline-secondary' }}">
{{ s.capitalize() if s else 'All' }}
</a>
{% endfor %}
</form>
</div>
</div>
<div class="card shadow-sm">
<div class="table-responsive">
<table class="table table-hover mb-0">
<thead class="table-dark">
<tr>
<th>Slug</th><th>Name</th><th>Plan</th><th>Status</th>
<th>Owner</th><th>Created</th><th>Actions</th>
</tr>
</thead>
<tbody>
{% for t in tenants %}
<tr>
<td><code>{{ t.slug }}</code>{% if t.is_demo %}<span class="badge bg-info ms-1">Demo</span>{% endif %}</td>
<td>{{ t.name }}</td>
<td>{{ t.plan.name if t.plan else '—' }}</td>
<td>
<span class="badge bg-{{ {'active':'success','trial':'primary','suspended':'warning','cancelled':'danger'}.get(t.status,'secondary') }}">
{{ t.status }}
</span>
</td>
<td class="text-muted small">{{ t.owner_email }}</td>
<td class="text-muted small">{{ t.created_at.strftime('%Y-%m-%d') }}</td>
<td>
<a href="{{ url_for('tenants.detail', tenant_id=t.id) }}" class="btn btn-outline-secondary btn-sm">View</a>
</td>
</tr>
{% else %}
<tr><td colspan="7" class="text-center text-muted py-4">No tenants found.</td></tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}