mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-04-22 02:00:57 -04:00
adding todo
This commit is contained in:
@@ -5,12 +5,7 @@ from functools import partial
|
||||
from flask import current_app, flash, redirect, render_template, request, url_for
|
||||
from flask_login import current_user
|
||||
|
||||
from app import (
|
||||
current_organization,
|
||||
org_invite_api_client,
|
||||
organizations_client,
|
||||
service_api_client,
|
||||
)
|
||||
from app import current_organization, org_invite_api_client, organizations_client
|
||||
from app.main import main
|
||||
from app.main.forms import (
|
||||
AdminBillingDetailsForm,
|
||||
@@ -75,23 +70,10 @@ def organization_dashboard(org_id):
|
||||
|
||||
year = requested_and_current_financial_year(request)[0]
|
||||
|
||||
services = current_organization.services_and_usage(financial_year=year)["services"]
|
||||
|
||||
total_messages_sent = 0
|
||||
total_messages_remaining = 0
|
||||
|
||||
for service in services:
|
||||
service_message_ratio = service_api_client.get_service_message_ratio(
|
||||
service["service_id"]
|
||||
)
|
||||
total_messages_sent += service_message_ratio.get("messages_sent", 0)
|
||||
total_messages_remaining += service_message_ratio.get("messages_remaining", 0)
|
||||
|
||||
# TODO: total message allowance
|
||||
return render_template(
|
||||
"views/organizations/organization/index.html",
|
||||
selected_year=year,
|
||||
messages_sent=total_messages_sent,
|
||||
messages_remaining=total_messages_remaining,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -9,24 +9,6 @@
|
||||
|
||||
{{ page_header('Organization Dashboard', size='large') }}
|
||||
|
||||
<div id="totalMessageChartContainer" data-messages-sent="{{ messages_sent|default(0) }}" data-messages-remaining="{{ messages_remaining|default(0) }}">
|
||||
<div class="grid-row flex-align-center">
|
||||
<h2 id="chartTitle" class="margin-right-1 margin-y-0">Overall {{ selected_year }} Total Message Allowance</h2>
|
||||
<button
|
||||
type="button"
|
||||
class="usa-tooltip usa-tooltip__information margin-right-0"
|
||||
data-position="top"
|
||||
title="Combined totals across all services in {{ current_org.name }}: pending, failed, or delivered"
|
||||
>
|
||||
<span class="usa-sr-only">More information</span>
|
||||
i
|
||||
</button>
|
||||
</div>
|
||||
<svg id="totalMessageChart"></svg>
|
||||
<div id="message"></div>
|
||||
</div>
|
||||
<div id="totalMessageTable" class="margin-bottom-3"></div>
|
||||
|
||||
<div class="margin-top-5 margin-bottom-5">
|
||||
<h2 class="font-heading-lg">What is a service?</h2>
|
||||
<p class="usa-body">
|
||||
|
||||
Reference in New Issue
Block a user