From cbd78144b08eae20f0506a694fd445761c65865a Mon Sep 17 00:00:00 2001 From: daveoconnor Date: Tue, 5 Aug 2025 16:43:52 -0700 Subject: [PATCH] New Libraries page in release report (#1864) --- libraries/forms.py | 4 ++ templates/admin/release_report_detail.html | 50 +++++++++++++++++++++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/libraries/forms.py b/libraries/forms.py index 0c6a59e2..2f6d2dfc 100644 --- a/libraries/forms.py +++ b/libraries/forms.py @@ -748,6 +748,9 @@ class CreateReportForm(CreateReportFullForm): lambda x: x.get("top_contributors_release").count() <= AUTHORS_PER_PAGE_THRESHOLD, ) + new_libraries = libraries.exclude( + library_version__version__release_date__lte=prior_version.release_date + ).prefetch_related("authors") top_contributors = self._get_top_contributors_for_version(version) # total messages sent during this release (version) total_mailinglist_count = EmailData.objects.filter(version=version).aggregate( @@ -850,6 +853,7 @@ class CreateReportForm(CreateReportFullForm): "version_commit_count": version_commit_count, "top_contributors_release_overall": top_contributors, "library_data": library_data, + "new_libraries": new_libraries, "batched_library_data": batched_library_data, "top_libraries_for_version": top_libraries_for_version, "library_count": library_count, diff --git a/templates/admin/release_report_detail.html b/templates/admin/release_report_detail.html index ff03ad7a..92a44efc 100644 --- a/templates/admin/release_report_detail.html +++ b/templates/admin/release_report_detail.html @@ -20,11 +20,17 @@ body { list-style: circle; margin-left: 2rem; } -.sponsor-message a, #library_index li a, ul.slack-channels li div a { +.sponsor-message a, +#library_index li a, +ul.slack-channels li div a, +.new-libraries a { color: rgb(2, 132, 199); } -.sponsor-message a:hover, #library_index li a:hover { +.sponsor-message a:hover, +#library_index li a:hover, +ul.slack-channels li div a:hover, +.new-libraries a:hover { color: rgb(255, 159, 0); } .committee_members img { @@ -388,6 +394,46 @@ body { + {% if new_libraries %} +
+
+

New Libraries

+ {% for library in new_libraries %} +
+ {% if library.graphic %} +
+ +
+ {% endif %} +
+
+ {{ library.name }} +
+
+ {{ library.description }} +
+ +
Contributors:
+
+ {% for author in library.authors.all %} +
+ {% avatar user=author %} +
+
+ {{ author.display_name }} +
+
+
+ {% endfor %} +
+
+
+ {% endfor %} +
+
+ {% endif %} {% with "img/release_report/bg1.png,img/release_report/bg4-rev.png,img/release_report/bg3-rev.png,img/release_report/bg1-rev.png,img/release_report/bg2.png,img/release_report/bg6-rev.png,img/release_report/bg3.png,img/release_report/bg4.png,img/release_report/bg5.png,img/release_report/bg6.png,img/release_report/bg2-rev.png" as bg_list_str %} {% with bg_list=bg_list_str|split:"," %} {% for batch in batched_library_data %}