From 491fe61bf130c6c5de99233907d5ddd7e81300ea Mon Sep 17 00:00:00 2001
From: Saurabh Kumar <theskumar@users.noreply.github.com>
Date: Thu, 21 Mar 2024 20:21:35 +0800
Subject: [PATCH] Improve UI of applicant dashboard (#3816)

- Update the spacing around "Edit" button of My Submissions
- Update the metadata font color and size, make it bit dark for
  readability, and reduce size to deemphasize.
- Add edit icon to "Edit" button
---
 .../dashboard/applicant_dashboard.html        |  2 +-
 .../partials/applicant_projects.html          |  4 +--
 .../partials/applicant_submissions.html       | 25 ++++++++++---------
 3 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/hypha/apply/dashboard/templates/dashboard/applicant_dashboard.html b/hypha/apply/dashboard/templates/dashboard/applicant_dashboard.html
index 74a79edcd..a8f6a5209 100644
--- a/hypha/apply/dashboard/templates/dashboard/applicant_dashboard.html
+++ b/hypha/apply/dashboard/templates/dashboard/applicant_dashboard.html
@@ -83,7 +83,7 @@
                                 <h4 class="heading heading--no-margin font-bold"><a class="link" href="{{ invoice.get_absolute_url }}">
                                     {% if invoice.invoice_number %}{{ invoice.invoice_number }}{% else %}{{ invoice.vendor_document_number }}{% endif %}
                                 </a></h4>
-                                <p class="m-0 text-gray-400">{% trans "Date added: " %} {{ invoice.requested_at }}</p>
+                                <p class="m-0 text-fg-muted text-sm">{% trans "Date added: " %} {{ invoice.requested_at }}</p>
                             </div>
                             <div class="max-w-[33%] w-full text-center my-auto">
                                 <p class="text-2xl">{% if invoice.invoice_amount %}{{ invoice.invoice_amount | format_number_as_currency }}{% else %}-{% endif %}</p>
diff --git a/hypha/apply/dashboard/templates/dashboard/partials/applicant_projects.html b/hypha/apply/dashboard/templates/dashboard/partials/applicant_projects.html
index c95e743ad..784081f54 100644
--- a/hypha/apply/dashboard/templates/dashboard/partials/applicant_projects.html
+++ b/hypha/apply/dashboard/templates/dashboard/partials/applicant_projects.html
@@ -4,8 +4,8 @@
     <div class="wrapper wrapper--status-bar-outer">
         <div class="wrapper wrapper--status-bar-inner">
             <div class="mt-5 ms-4 lg:max-w-[30%]">
-                <h4 class="heading mb-2 font-bold line-clamp-3 hover:line-clamp-none"><a class="link" href="{% url 'apply:projects:detail' project.id %}">{{ project.title }}</a></h4>
-                <p class="m-0 text-gray-400">{% trans "Project start date: " %} {{ project.created_at.date }}</p>
+                <h4 class="heading mb-0 font-bold line-clamp-3 hover:line-clamp-none"><a class="link" href="{% url 'apply:projects:detail' project.id %}">{{ project.title }}</a></h4>
+                <p class="m-0 text-fg-muted text-sm">{% trans "Project start date: " %} {{ project.created_at.date }}</p>
             </div>
             {% project_status_bar project.status request.user css_class="status-bar--small" %}
         </div>
diff --git a/hypha/apply/dashboard/templates/dashboard/partials/applicant_submissions.html b/hypha/apply/dashboard/templates/dashboard/partials/applicant_submissions.html
index 82e6dc625..a4036589b 100644
--- a/hypha/apply/dashboard/templates/dashboard/partials/applicant_submissions.html
+++ b/hypha/apply/dashboard/templates/dashboard/partials/applicant_submissions.html
@@ -1,11 +1,11 @@
-{% load i18n dashboard_statusbar_tags statusbar_tags workflow_tags %}
+{% load i18n dashboard_statusbar_tags statusbar_tags workflow_tags heroicons %}
 
 {% for submission in page.object_list %}
     <div class="wrapper wrapper--status-bar-outer">
         <div class="wrapper wrapper--status-bar-inner">
             <div class="mt-5 ms-4 lg:max-w-[30%]">
-                <h4 class="heading mb-2 font-bold line-clamp-3 hover:line-clamp-none"><a class="link {% if not submission.is_active %} text-gray-400 {% endif %}" href="{% url 'funds:submissions:detail' submission.id %}">{{ submission.title }}</a></h4>
-                <p class="m-0 text-gray-400">
+                <h4 class="heading mb-0 font-bold line-clamp-3 hover:line-clamp-none"><a class="link {% if not submission.is_active %} text-gray-400 {% endif %}" href="{% url 'funds:submissions:detail' submission.id %}">{{ submission.title }}</a></h4>
+                <p class="m-0 text-fg-muted mb-4 text-sm">
                     {% if submission.is_draft %}
                         {% trans "Drafted on " %}
                     {% else %}
@@ -13,18 +13,19 @@
                     {% endif %}
                     {{ submission.submit_time.date }} {% trans "by" %} {{ submission.user.get_full_name }}
                 </p>
+                {% if request.user|has_edit_perm:submission %}
+                    <a class="button button--primary" href="{% url 'funds:submissions:edit' submission.id %}">
+                        {% if submission.status == 'draft_proposal' %}
+                            {% trans "Start your" %} {{ submission.stage }} {% trans "application" %}
+                        {% else %}
+                            {% heroicon_micro "pencil" class="w-4 h-4 me-1 inline align-middle" aria_hidden=true %}
+                            {% trans "Edit" %}
+                        {% endif %}
+                    </a>
+                {% endif %}
             </div>
             {% status_bar submission.workflow submission.phase request.user css_class="status-bar--small" %}
         </div>
-        {% if request.user|has_edit_perm:submission %}
-            <a class="button button--primary ms-4" href="{% url 'funds:submissions:edit' submission.id %}">
-                {% if submission.status == 'draft_proposal' %}
-                    {% trans "Start your" %} {{ submission.stage }} {% trans "application" %}
-                {% else %}
-                    {% trans "Edit" %}
-                {% endif %}
-            </a>
-        {% endif %}
     </div>
 {% empty %}
     {% trans "No active submissions" %}
-- 
GitLab