mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-12 01:48:54 -04:00
show archived label on platform admin page, and sort last
This commit is contained in:
@@ -20,7 +20,7 @@ def platform_admin():
|
||||
'views/platform-admin.html',
|
||||
**get_statistics(sorted(
|
||||
services,
|
||||
key=lambda service: service['created_at'],
|
||||
key=lambda service: (service['active'], service['created_at']),
|
||||
reverse=True
|
||||
))
|
||||
)
|
||||
@@ -29,12 +29,12 @@ def platform_admin():
|
||||
def get_statistics(services):
|
||||
return {
|
||||
'global_stats': create_global_stats(services),
|
||||
'live_services': format_stats_by_service([
|
||||
'live_services': format_stats_by_service(
|
||||
service for service in services if not service['restricted']
|
||||
]),
|
||||
'trial_mode_services': format_stats_by_service([
|
||||
),
|
||||
'trial_mode_services': format_stats_by_service(
|
||||
service for service in services if service['restricted']
|
||||
]),
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
@@ -72,5 +72,6 @@ def format_stats_by_service(services):
|
||||
'failed': sum(stat['failed'] for stat in stats),
|
||||
'restricted': service['restricted'],
|
||||
'research_mode': service['research_mode'],
|
||||
'created_at': service['created_at']
|
||||
'created_at': service['created_at'],
|
||||
'active': service['active']
|
||||
}
|
||||
|
||||
@@ -23,7 +23,11 @@
|
||||
<a href="{{ url_for('main.service_dashboard', service_id=item['id']) }}" class="browse-list-link">{{ item['name'] }}</a>
|
||||
</div>
|
||||
{% endcall %}
|
||||
{% if item['research_mode'] %}
|
||||
{% if not item['active'] %}
|
||||
{% call field(status='default') %}
|
||||
<span class="heading-medium">archived</span>
|
||||
{% endcall %}
|
||||
{% elif item['research_mode'] %}
|
||||
{% call field() %}
|
||||
<span class="research-mode">research mode</span>
|
||||
{% endcall %}
|
||||
|
||||
Reference in New Issue
Block a user