From 3c98f741d6bdedeef0a7644c3eea00e4cbb0265a Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Date: Mon, 26 Aug 2024 16:18:47 +0530 Subject: [PATCH] Activity tweak icons and messages --- .../apply/activity/adapters/activity_feed.py | 45 +++++++-------- .../activity/ui/activity-action-item.html | 56 ++++++++++++------- .../activity/ui/activity-comment-item.html | 22 +++++--- 3 files changed, 69 insertions(+), 54 deletions(-) diff --git a/hypha/apply/activity/adapters/activity_feed.py b/hypha/apply/activity/adapters/activity_feed.py index f3dfe38a93..c6b274b787 100644 --- a/hypha/apply/activity/adapters/activity_feed.py +++ b/hypha/apply/activity/adapters/activity_feed.py @@ -26,12 +26,12 @@ class ActivityAdapter(AdapterBase): MESSAGES.NEW_SUBMISSION: _( "Submitted {source.title_text_display} for {source.page.title}" ), - MESSAGES.EDIT_SUBMISSION: _("Edited"), - MESSAGES.APPLICANT_EDIT: _("Edited"), - MESSAGES.UPDATE_LEAD: _("Lead changed from {old_lead} to {source.lead}"), - MESSAGES.BATCH_UPDATE_LEAD: _("Batch Lead changed to {new_lead}"), + MESSAGES.EDIT_SUBMISSION: _("edited the submission"), + MESSAGES.APPLICANT_EDIT: _("edited the submission"), + MESSAGES.UPDATE_LEAD: _("updated Lead from {old_lead} to {source.lead}"), + MESSAGES.BATCH_UPDATE_LEAD: _("batch updated Lead to {new_lead}"), MESSAGES.DETERMINATION_OUTCOME: _( - "Sent a determination. Outcome: {determination.clean_outcome}" + "sent a determination. Outcome: {determination.clean_outcome}" ), MESSAGES.BATCH_DETERMINATION_OUTCOME: "batch_determination", MESSAGES.INVITED_TO_PROPOSAL: _("Invited to submit a proposal"), @@ -42,24 +42,22 @@ class ActivityAdapter(AdapterBase): MESSAGES.OPENED_SEALED: _("Opened the submission while still sealed"), MESSAGES.SCREENING: "handle_screening_statuses", MESSAGES.REVIEW_OPINION: _( - "{user} {opinion.opinion_display}s with {opinion.review.author}s review of {source}" + "{opinion.opinion_display}s with {opinion.review.author}s review of {source}" ), MESSAGES.DELETE_REVIEW_OPINION: _( - "{user} deleted the opinion for review: {review_opinion.review}" + "deleted the opinion for review: {review_opinion.review}" ), MESSAGES.CREATED_PROJECT: _("Created project"), MESSAGES.PROJECT_TRANSITION: "handle_project_transition", MESSAGES.UPDATE_PROJECT_TITLE: _( - "{user} has updated the project title from {old_title} to {source.title}" - ), - MESSAGES.UPDATE_PROJECT_LEAD: _( - "Lead changed from {old_lead} to {source.lead}" + "updated the project title from {old_title} to {source.title}" ), + MESSAGES.UPDATE_PROJECT_LEAD: _("update Lead from {old_lead} to {source.lead}"), MESSAGES.SEND_FOR_APPROVAL: _("Requested approval"), MESSAGES.APPROVE_PAF: "handle_paf_assignment", MESSAGES.APPROVE_PROJECT: _("Approved"), MESSAGES.REQUEST_PROJECT_CHANGE: _( - 'Requested changes for acceptance: "{comment}"' + 'requested changes for acceptance: "{comment}"' ), MESSAGES.SUBMIT_CONTRACT_DOCUMENTS: _("Submitted Contract Documents"), MESSAGES.UPLOAD_CONTRACT: _("Uploaded a {contract.state} contract"), @@ -69,17 +67,13 @@ class ActivityAdapter(AdapterBase): MESSAGES.SUBMIT_REPORT: _("Submitted a report"), MESSAGES.SKIPPED_REPORT: "handle_skipped_report", MESSAGES.REPORT_FREQUENCY_CHANGED: "handle_report_frequency", - MESSAGES.DISABLED_REPORTING: _("Reporting disabled"), + MESSAGES.DISABLED_REPORTING: _("disabled reporting"), MESSAGES.BATCH_DELETE_SUBMISSION: "handle_batch_delete_submission", MESSAGES.BATCH_ARCHIVE_SUBMISSION: "handle_batch_archive_submission", MESSAGES.BATCH_UPDATE_INVOICE_STATUS: "handle_batch_update_invoice_status", - MESSAGES.ARCHIVE_SUBMISSION: _( - "{user} has archived the submission: {source.title_text_display}" - ), - MESSAGES.UNARCHIVE_SUBMISSION: _( - "{user} has unarchived the submission: {source.title_text_display}" - ), - MESSAGES.DELETE_INVOICE: _("Deleted an invoice"), + MESSAGES.ARCHIVE_SUBMISSION: _("archived this submission"), + MESSAGES.UNARCHIVE_SUBMISSION: _("un-archived this submission"), + MESSAGES.DELETE_INVOICE: _("deleted an invoice"), MESSAGES.REMOVE_TASK: "handle_task_removal", } @@ -214,13 +208,12 @@ def handle_paf_assignment(self, source, paf_approvals, **kwargs): def handle_task_removal(self, source, task, **kwargs): if task.user: return _( - "{user} has removed the task {task.code} for {source} from the task list".format( - user=kwargs.get("user"), task=task, source=source + "removed the task {task.code} for {source} from the task list".format( + task=task, source=source ) ) return _( - "{user} has removed the task {task.code} for {source} from whole team's{user_groups} task list.".format( - user=kwargs.get("user"), + "removed the task {task.code} for {source} from whole team's{user_groups} task list.".format( task=task, source=source, user_groups=list(task.user_group.all().values_list("name", flat=True)), @@ -363,10 +356,10 @@ def handle_screening_statuses(self, source, old_status, **kwargs): if new_status and old_status != "-": return _( - 'Updated screening decision from "{old_status}" to "{new_status}".' + 'Updated screening decision from "{old_status}" to "{new_status}"' ).format(old_status=old_status, new_status=new_status) elif new_status: - return _('Added screening decision to "{new_status}".').format( + return _('Added screening decision to "{new_status}"').format( new_status=new_status ) elif old_status != "-": diff --git a/hypha/apply/activity/templates/activity/ui/activity-action-item.html b/hypha/apply/activity/templates/activity/ui/activity-action-item.html index 242903b342..217e63f74a 100644 --- a/hypha/apply/activity/templates/activity/ui/activity-action-item.html +++ b/hypha/apply/activity/templates/activity/ui/activity-action-item.html @@ -1,27 +1,43 @@ {% load i18n activity_tags heroicons %} -
-
-
-
-
- {% heroicon_micro "eye" class="fill-gray-400 inline" aria_hidden=true %} +{% with activity|display_for:request.user as activity_text %} +
+
+
+
+
+ {% if 'edit' in activity_text.lower %} + {% heroicon_micro "pencil-square" class="inline" aria_hidden=true size=14 %} + {% elif 'progressed' in activity_text.lower %} + {% heroicon_micro "arrow-trending-up" class="inline" aria_hidden=true size=14 %} + {% elif 'sent a determination' in activity_text.lower %} + {% heroicon_micro "rocket-launch" class="inline" aria_hidden=true size=14 %} + {% elif 'submitted a review' in activity_text.lower %} + {% heroicon_micro "chat-bubble-left-ellipsis" class="inline" aria_hidden=true size=14 %} + {% elif 'un-archived' in activity_text.lower %} + {% heroicon_micro "lock-open" class="inline" aria_hidden=true size=14 %} + {% elif 'archived' in activity_text.lower %} + {% heroicon_micro "lock-closed" class="inline" aria_hidden=true size=14 %} + {% else %} + {% heroicon_micro "eye" class="inline" aria_hidden=true size=15 %} + {% endif %} +
-
-
- - {{ activity|display_activity_author:request.user }} - - - {{ activity|display_for:request.user|striptags|lowerfirst }} - - {{ activity.timestamp|date:'SHORT_DATETIME_FORMAT' }} - - +
+ + {{ activity|display_activity_author:request.user }} + + + {{ activity_text|striptags|lowerfirst }} + + {{ activity.timestamp|date:'SHORT_DATETIME_FORMAT' }} + + +
-
+{% endwith %} diff --git a/hypha/apply/activity/templates/activity/ui/activity-comment-item.html b/hypha/apply/activity/templates/activity/ui/activity-comment-item.html index 667f812e8c..a55b782719 100644 --- a/hypha/apply/activity/templates/activity/ui/activity-comment-item.html +++ b/hypha/apply/activity/templates/activity/ui/activity-comment-item.html @@ -1,11 +1,11 @@ {% load i18n activity_tags nh3_tags markdown_tags submission_tags apply_tags heroicons users_tags %} -
+
{% with activity|display_activity_author:request.user as author_name %} -
+
-
-
+
+
{{ author_name }} @@ -43,9 +43,15 @@ {% endif %}
-
+
{% if not request.user.is_applicant %} - ({{ activity.visibility|visibility_display:request.user }}) + {% with activity.visibility|visibility_display:request.user as visibility_text %} + + {% heroicon_outline "eye" size=14 class="inline" aria_hidden=true %} + {{ visibility_text }} + + {% endwith %} {% endif %} {% if editable and activity.user == request.user %} @@ -60,7 +66,7 @@ {% endif %}
-
+
{% if submission_title %} @@ -86,4 +92,4 @@
{% endwith %}
-
+