From 04611b03419193632feec4a018cde80f09a5e7b7 Mon Sep 17 00:00:00 2001 From: chrystinne Date: Thu, 14 May 2026 12:17:12 -0400 Subject: [PATCH 1/3] Add yearly project counts table to submission statistics page. --- .../templates/console/submission_stats.html | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/physionet-django/console/templates/console/submission_stats.html b/physionet-django/console/templates/console/submission_stats.html index 69e3e1a7df..2cbe609602 100644 --- a/physionet-django/console/templates/console/submission_stats.html +++ b/physionet-django/console/templates/console/submission_stats.html @@ -38,5 +38,34 @@ +
+ New projects (past 6 years) +
+
+
+ + + + + + + + + + + {% for year, val in yearly_stats.items %} + + + + + + + + + {% endfor %} +
YearCreatedSubmittedResubmittedPublishedRejected
{{ year }}{{ val.0 }}{{ val.1 }}{{ val.2 }}{{ val.3 }}{{ val.4 }}
+ +
+
{% endblock %} From 6079c78b206cee835de1877b2ca720fc9699ff8f Mon Sep 17 00:00:00 2001 From: chrystinne Date: Thu, 14 May 2026 12:18:04 -0400 Subject: [PATCH 2/3] Add yearly project counts to submission statistics. --- physionet-django/console/views.py | 36 ++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/physionet-django/console/views.py b/physionet-django/console/views.py index b54f81ab9e..cfdd695135 100644 --- a/physionet-django/console/views.py +++ b/physionet-django/console/views.py @@ -2445,8 +2445,42 @@ def submission_stats(request): except AttributeError: pass + # Aggregate counts per year (last 6 years) + current_year = datetime.today().year + yearly_stats = OrderedDict() + for y in range(current_year - 5, current_year + 1): + yearly_stats[y] = [0, 0, 0, 0, 0] + + for project_set in all_projects: + for project in project_set: + create_yr = project.creation_datetime.year + if create_yr in yearly_stats: + yearly_stats[create_yr][0] += 1 + + for log in project.edit_log_history(): + sub_yr = log.submission_datetime.year + if sub_yr in yearly_stats: + if log.is_resubmission: + yearly_stats[sub_yr][2] += 1 + else: + yearly_stats[sub_yr][1] += 1 + try: + if log.decision == 0 and log.decision_datetime is not None: + rej_yr = log.decision_datetime.year + if rej_yr in yearly_stats: + yearly_stats[rej_yr][4] += 1 + except AttributeError: + pass + + try: + pub_yr = project.publish_datetime.year + if pub_yr in yearly_stats: + yearly_stats[pub_yr][3] += 1 + except AttributeError: + pass + return render(request, 'console/submission_stats.html', - {'submenu': 'submission', 'stats': stats}) + {'submenu': 'submission', 'stats': stats, 'yearly_stats': yearly_stats}) @console_permission_required('project.can_view_stats') From 3ecde0c9718d63af517527ebff0139246e84ef35 Mon Sep 17 00:00:00 2001 From: chrystinne Date: Thu, 14 May 2026 12:28:50 -0400 Subject: [PATCH 3/3] Rename New projects to Projects in submission statistics page. --- .../console/templates/console/submission_stats.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physionet-django/console/templates/console/submission_stats.html b/physionet-django/console/templates/console/submission_stats.html index 2cbe609602..c504120e63 100644 --- a/physionet-django/console/templates/console/submission_stats.html +++ b/physionet-django/console/templates/console/submission_stats.html @@ -39,7 +39,7 @@
- New projects (past 6 years) + Projects (past 6 years)