From 7b4910f0376f01772e7a7ce36d240237d9150cf7 Mon Sep 17 00:00:00 2001
From: Saurabh Kumar <theskumar@users.noreply.github.com>
Date: Sat, 30 Mar 2024 03:03:59 +0800
Subject: [PATCH] Fix table layout of Submissions Results page (#3837)

The summary section table is unformatted, making it hard to read the
stats. This PR fixes it.
---
 .../funds/includes/submission_stats.html      | 18 ++++----
 .../templates/funds/submissions_result.html   | 41 +++++++++++++++++--
 2 files changed, 47 insertions(+), 12 deletions(-)

diff --git a/hypha/apply/funds/templates/funds/includes/submission_stats.html b/hypha/apply/funds/templates/funds/includes/submission_stats.html
index ad17a2503..28e0c88c6 100644
--- a/hypha/apply/funds/templates/funds/includes/submission_stats.html
+++ b/hypha/apply/funds/templates/funds/includes/submission_stats.html
@@ -1,22 +1,22 @@
 {% load i18n apply_tags %}
-<div class="stat-block">
-    <div class="stat-block__item">
-        <h5>{% trans "Amounts" %}</h5>
-        <table>
+<div class="flex flex-wrap gap-4">
+    <div class="border p-4">
+        <strong>{% trans "Amounts" %}</strong>
+        <table class="mb-0">
             <tr><th>{% trans "Applied" %} ({{ ""|format_number_as_currency }})</th><th>{% trans "Accepted" %}  ({{ ""|format_number_as_currency }})</th></tr>
             <tr><td>{{ submission_sum|default:"0" }}</td><td>{{ submission_accepted_sum|default:"0" }}</td></tr>
         </table>
     </div>
-    <div class="stat-block__item">
+    <div class="border p-4">
         <h5>{% trans "Submissions" %}</h5>
-        <table>
-            <tr><th>{% trans "Applied" %}</th><th>{% trans "Accepted" %}</th><th>{% trans "Pending" %}</th></tr>
+        <table class="mb-0">
+            <tr><th class="px-4">{% trans "Applied" %}</th><th>{% trans "Accepted" %}</th><th>{% trans "Pending" %}</th></tr>
             <tr><td>{{ object_list.count }}</td><td>{{ submission_accepted_count|default:"0" }}</td><td>{{ submission_undetermined_count|default:"0" }}</td></tr>
         </table>
     </div>
-    <div class="stat-block__item">
+    <div class="border p-4">
         <h5>{% trans "Reviews" %}</h5>
-        <table>
+        <table class="mb-0">
             <tr><th>{% trans "All" %}</th><th>{% trans "You" %}</th><th>{% trans "Your avg. score" %}</th></tr>
             <tr><td>{{ review_count|default:"0" }}</td><td>{{ review_my_count|default:"0" }}</td><td>{{ review_my_score|floatformat:"0"|default:"0" }}</td></tr>
         </table>
diff --git a/hypha/apply/funds/templates/funds/submissions_result.html b/hypha/apply/funds/templates/funds/submissions_result.html
index 43d7f5f52..9d6c917f3 100644
--- a/hypha/apply/funds/templates/funds/submissions_result.html
+++ b/hypha/apply/funds/templates/funds/submissions_result.html
@@ -12,11 +12,46 @@
 
     <div class="wrapper wrapper--large wrapper--inner-space-medium">
         <div class="wrapper wrapper--bottom-space">
-            <h4 class="heading heading--normal">{% trans "Summary" %}</h4>
-            {% include "funds/includes/submission_stats.html" %}
+            <h3>{% trans "Summary" %}</h3>
+            <div class="prose max-w-none"><div class="flex flex-wrap gap-4">
+                <div class="border p-4 shadow">
+                    <h5>{% trans "Amounts" %}</h5>
+                    <table class="mb-0 mt-2">
+                        <tr><th class="pe-4">{% trans "Applied" %} ({{ ""|format_number_as_currency }})</th><th>{% trans "Accepted" %}  ({{ ""|format_number_as_currency }})</th></tr>
+                        <tr><td>{{ submission_sum|default:"0" }}</td><td>{{ submission_accepted_sum|default:"0" }}</td></tr>
+                    </table>
+                </div>
+                <div class="border p-4 shadow">
+                    <h5>{% trans "Submissions" %}</h5>
+                    <table class="mb-0 mt-2">
+                        <tr>
+                            <th class="pe-4">{% trans "Applied" %}</th>
+                            <th class="pe-4">{% trans "Accepted" %}</th>
+                            <th>{% trans "Pending" %}</th>
+                        </tr>
+                        <tr>
+                            <td>{{ object_list.count }}</td>
+                            <td>{{ submission_accepted_count|default:"0" }}</td>
+                            <td>{{ submission_undetermined_count|default:"0" }}</td>
+                        </tr>
+                    </table>
+                </div>
+                <div class="border p-4 shadow">
+                    <h5>{% trans "Reviews" %}</h5>
+                    <table class="mb-0 mt-2">
+                        <tr>
+                            <th class="pe-4">{% trans "All" %}</th>
+                            <th class="pe-4">{% trans "You" %}</th>
+                            <th>{% trans "Your avg. score" %}</th></tr>
+                        <tr><td>{{ review_count|default:"0" }}</td><td>{{ review_my_count|default:"0" }}</td><td>{{ review_my_score|floatformat:"0"|default:"0" }}</td></tr>
+                    </table>
+                </div>
+            </div>
+
+            </div>
         </div>
 
-        <h4 class="heading heading--normal">{% trans "Filter submissions to calculate values" %}</h4>
+        <h3>{% trans "Filter submissions to calculate values" %}</h3>
         {% include "funds/includes/table_filter_and_search.html" with filter_form=filter_form search_term=search_term use_search=True filter_action=filter_action use_batch_actions=False filter_classes="filters-open" %}
         <div class="grid">
             <div><strong>{% trans "Number of submission" %}:</strong> {{ count_values }}{% if not count_values == object_list.count %} ({{ object_list.count }}){% endif %}</div>
-- 
GitLab