From a3a78f755d9e559d3b449a34a1c5a66cc573d43d Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Mon, 29 Jul 2019 02:36:57 -0400 Subject: [PATCH] Display thousand commas in numeric dashboard Signed-off-by: Roberto Rosario --- HISTORY.rst | 2 ++ docs/releases/3.3.rst | 2 ++ mayan/apps/dashboards/classes.py | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 6588ac08c4..a71d1f4e8a 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -66,6 +66,8 @@ - Add web links app. - Add support to display column help text as a tooltip. +- Update numeric dashboard widget to display + thousand commas. 3.2.6 (2019-07-10) ================== diff --git a/docs/releases/3.3.rst b/docs/releases/3.3.rst index 688283c96b..a1d56f4807 100644 --- a/docs/releases/3.3.rst +++ b/docs/releases/3.3.rst @@ -81,6 +81,8 @@ Changes - Add web links app. - Add support to display column help text as a tooltip. +- Update numeric dashboard widget to display + thousand commas. Removals -------- diff --git a/mayan/apps/dashboards/classes.py b/mayan/apps/dashboards/classes.py index c1e4a6d478..e3869556cf 100644 --- a/mayan/apps/dashboards/classes.py +++ b/mayan/apps/dashboards/classes.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals +from django.contrib.humanize.templatetags.humanize import intcomma from django.template import loader @@ -85,7 +86,8 @@ class DashboardWidgetNumeric(BaseDashboardWidget): def get_context(self): return { - 'count': self.count, + 'count': intcomma(value=self.count), + 'count_raw': self.count, 'icon_class': self.icon_class, 'label': self.label, 'link': self.link,