diff --git a/app/__init__.py b/app/__init__.py index 1694fe018..21f0c8e03 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -284,6 +284,7 @@ def init_app(application): @application.context_processor def _attach_current_global_daily_messages(): + global_limit = 0 remaining_global_messages = 0 if current_app: if request.view_args: @@ -301,7 +302,10 @@ def init_app(application): remaining_global_messages = global_limit - global_messages_count.get( "count" ) - return {"daily_global_messages_remaining": remaining_global_messages} + return { + "global_message_limit": global_limit, + "daily_global_messages_remaining": remaining_global_messages, + } @application.before_request def record_start_time(): diff --git a/app/assets/javascripts/date.js b/app/assets/javascripts/date.js new file mode 100644 index 000000000..1d6a0d353 --- /dev/null +++ b/app/assets/javascripts/date.js @@ -0,0 +1,9 @@ +(function (window) { + + "use strict"; + + // Show the current year + document.getElementById("current-year").innerHTML = new Date().getFullYear(); + + +})(window); diff --git a/app/templates/views/dashboard/_usage.html b/app/templates/views/dashboard/_usage.html index e7f9e5f07..a2e46d007 100644 --- a/app/templates/views/dashboard/_usage.html +++ b/app/templates/views/dashboard/_usage.html @@ -15,7 +15,7 @@
You have sent {{ 5000 - daily_global_messages_remaining }} of your 5000 daily messages allowance.
+You have sent {{ global_message_limit - daily_global_messages_remaining }} of your {{ global_message_limit }} daily messages allowance.
You have {{ daily_global_messages_remaining }} messages remaining.