mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-04-28 05:01:06 -04:00
927 - Updates to math in Dashboard area
This commit is contained in:
@@ -301,7 +301,10 @@ def init_app(application):
|
||||
remaining_global_messages = global_limit - global_messages_count.get(
|
||||
"count"
|
||||
)
|
||||
return {"daily_global_messages_remaining": remaining_global_messages}
|
||||
return {
|
||||
"daily_global_messages_remaining": remaining_global_messages,
|
||||
"global_message_limit": global_limit
|
||||
}
|
||||
|
||||
@application.before_request
|
||||
def record_start_time():
|
||||
|
||||
9
app/assets/javascripts/date.js
Normal file
9
app/assets/javascripts/date.js
Normal file
@@ -0,0 +1,9 @@
|
||||
(function (window) {
|
||||
|
||||
"use strict";
|
||||
|
||||
// Show the current year
|
||||
document.getElementById("current-year").innerHTML = new Date().getFullYear();
|
||||
|
||||
|
||||
})(window);
|
||||
@@ -15,7 +15,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ big_number(40000 - sms_allowance_remaining, smaller=True) }}</td>
|
||||
<td>{{ big_number(sms_sent, smaller=True) }}</td>
|
||||
<td>
|
||||
{% if sms_cost %}
|
||||
{{ big_number(
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ 5000 - daily_global_messages_remaining }}</td>
|
||||
<td>{{ global_message_limit - daily_global_messages_remaining }}</td>
|
||||
<td>
|
||||
{{ daily_global_messages_remaining }}
|
||||
</td>
|
||||
@@ -54,7 +54,7 @@
|
||||
</table>
|
||||
|
||||
{% if current_user.has_permissions('manage_service') %}
|
||||
<h3 class='margin-bottom-0'>2023</h3>
|
||||
<h3 class='margin-bottom-0' id="current-year"></h3>
|
||||
{{ ajax_block(partials, updates_url, 'usage') }}
|
||||
{{ show_more(
|
||||
url_for(".usage", service_id=current_service['id']),
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
<div class='grid-col-12'>
|
||||
<h2 class="heading-small margin-bottom-1">Daily messages across all services</h2>
|
||||
<p class="margin-0">You have sent {{ 5000 - daily_global_messages_remaining }} of your 5000 daily messages allowance.</p>
|
||||
<p class="margin-0">You have sent {{ global_message_limit - daily_global_messages_remaining }} of your {{ global_message_limit }} daily messages allowance.</p>
|
||||
<p class="margin-0"></p>You have {{ daily_global_messages_remaining }} messages remaining.</p>
|
||||
<h2 class='heading-small margin-bottom-1'>Text messages</h2>
|
||||
<div class="keyline-block">
|
||||
|
||||
@@ -126,6 +126,7 @@ const javascripts = () => {
|
||||
paths.src + 'javascripts/errorBanner.js',
|
||||
paths.src + 'javascripts/homepage.js',
|
||||
paths.src + 'javascripts/timeoutPopup.js',
|
||||
paths.src + 'javascripts/date.js',
|
||||
paths.src + 'javascripts/main.js',
|
||||
])
|
||||
.pipe(plugins.prettyerror())
|
||||
|
||||
Reference in New Issue
Block a user