Add services overview table to organization dashboard

This commit is contained in:
Beverly Nguyen
2025-10-16 17:42:42 -07:00
parent 847101fbf6
commit 507c33a4db
2 changed files with 44 additions and 0 deletions

View File

@@ -115,6 +115,7 @@ def organization_dashboard(org_id):
return render_template(
"views/organizations/organization/index.html",
selected_year=year,
services=current_organization.services,
**message_allowance,
**service_counts,
)

View File

@@ -73,4 +73,47 @@
</ol>
</div>
<div class="margin-bottom-5">
<h2 class="font-heading-lg margin-bottom-2">Services Overview</h2>
<table class="usa-table">
<thead>
<tr>
<th scope="col" role="columnheader">Name</th>
<th scope="col" role="columnheader">Status</th>
<th scope="col" role="columnheader">Usage</th>
<th scope="col" role="columnheader">Primary Contact</th>
<th scope="col" role="columnheader">Recent Template Used</th>
<th scope="col" role="columnheader">Created</th>
</tr>
</thead>
<tbody>
{% if services %}
{% for service in services %}
<tr>
<td><a href="{{ url_for('main.service_dashboard', service_id=service.id) }}" class="usa-link">{{ service.name }}</a></td>
<td>
{% if not service.active %}
Suspended
{% elif service.restricted %}
Trial
{% else %}
Live
{% endif %}
</td>
<td>{{ service.usage|default('N/A') }}</td>
<td>{{ service.primary_contact|default('N/A') }}</td>
<td>{{ service.recent_template|default('N/A') }}</td>
<td>{{ service.created_at.strftime('%b %d, %Y') if service.created_at else 'N/A' }}</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td colspan="6" class="table-empty-message">No services found within this organization</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
{% endblock %}