From 9fa1e18aa3f5c5befbb1d587d4fa4e5be9b59498 Mon Sep 17 00:00:00 2001 From: Joseph Nuthalapati Date: Sun, 6 Jul 2025 00:10:15 +0530 Subject: [PATCH] diagnostics: Add collapsible sections for results Uses Bootstrap accordion class to do collapsible sections without adding any custom CSS or JavaScript. Closes #2479 Sunil: - Create one accordion instead of many. Automatically collapsing previously expanded item works. - Fix dangling close tag. - Embrace accordion styling instead of header-like styling for headers. The tables with results are distinguished from the header due to header highlighting and margins around tables. - Fix issue with multiple 'passed' badges show for single app. 'regroup' template tag expects the dict to be already sorted by the selected property. - Internationalize badge text in headers. - Right align badges. Move repair button into the accordion header for better appearance. - Wrap the header on small screen sizes. - Add additional necessary HTML attributes. - Change 'Loading...' to 'Running...' more accurately specify the status. - Show Running and Exception statuses in header. - Use 'text-bg-' classes instead of 'bg-' for allow automatic selection of text color. Signed-off-by: Joseph Nuthalapati Signed-off-by: Sunil Mohan Adapa Reviewed-by: Sunil Mohan Adapa --- .../templates/diagnostics_full.html | 113 +++++++++++++----- 1 file changed, 80 insertions(+), 33 deletions(-) diff --git a/plinth/modules/diagnostics/templates/diagnostics_full.html b/plinth/modules/diagnostics/templates/diagnostics_full.html index dc53e7447..d82fa2f31 100644 --- a/plinth/modules/diagnostics/templates/diagnostics_full.html +++ b/plinth/modules/diagnostics/templates/diagnostics_full.html @@ -32,42 +32,89 @@ {% if results %}

{% trans "Results" %}

- {% for app_id, app_data in results.results.items %} -
-
-

- {% blocktrans trimmed with app_name=app_data.name %} - App: {{app_name}} - {% endblocktrans %} +
+ {% for app_id, app_data in results.results.items %} +
+

+

- {% if app_data.show_repair %} -
- {% csrf_token %} - -
- {% endif %} -
- - {% if app_data.diagnosis %} - {% include "diagnostics_results.html" with results=app_data.diagnosis %} - {% elif app_data.exception %} -

- {% endfor %} + + {% endfor %} + {% endif %} - {% endblock %}