Skip to content

Commit 9f43d3e

Browse files
committed
Updated suggestions
1 parent 5732ce3 commit 9f43d3e

4 files changed

Lines changed: 38 additions & 30 deletions

File tree

hypha/apply/activity/adapters/emails.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ def handle_co_applicant_invite(self, source, related, **kwargs):
183183
can_accept=can_accept,
184184
accept_link=accept_link,
185185
related=related,
186+
invited_user=invited_user,
186187
**kwargs,
187188
)
188189

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
{% extends "messages/email/base.html" %}
22
{% load i18n activity_tags %}
3-
{% block salutation %}{% blocktrans with name=related.invited_user_email|email_name %}Dear {{ name }},{% endblocktrans %}{% endblock %}
3+
4+
{% block salutation %}
5+
{% if invited_user %}
6+
{% blocktrans with name=invited_user.get_display_name %}Dear {{ name }},{% endblocktrans %}
7+
{% else %}
8+
{% blocktrans with name=related.invited_user_email|email_name %}Dear {{ name }},{% endblocktrans %}
9+
{% endif %}
10+
{% endblock %}
411

512
{% block content %}{# fmt:off #}
613
{% blocktrans %}You have been invited as a co-applicant to an application on {{ ORG_SHORT_NAME }} by {{ user }}.{% endblocktrans %}
714
{% if not can_accept %}
815
{% trans "But You can't accept this invite because you already hold a responsible position in" %} {{ ORG_SHORT_NAME }}
916
{% else %}
10-
{% blocktrans %} Click on link if you want to accept it.{% endblocktrans %}
17+
{% blocktrans %}Click on link if you want to accept it.{% endblocktrans %}
18+
1119
{% trans "Link" %}: {{ request.scheme }}://{{ request.get_host }}{{ accept_link }}
1220
{% endif %}
1321
{% endblock %}{# fmt:on #}

hypha/apply/funds/templates/funds/coapplicant_invite_landing_page.html

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,25 @@
99
{% block content %}
1010
<div class="bg-gray-100 max-w-[70%] mx-auto mt-6 px-10 pt-6 pb-4 border border-gray-300 rounded-sm">
1111
{% if is_valid %}
12-
<p>{% trans "You've been invited to join the submission" %} "{{ invite.submission.title }}" {% trans "as a co-applicant with email" %} <i>{{ invite.invited_user_email }}</i>. {% trans "Please respond to the invitation by choosing accept or decline." %}</p>
13-
<p>{% trans "If you accept, you’ll be automatically signed up or logged in and taken directly to" %} {% if two_factor_required %}{% trans "two factor authentication and then to" %} {% endif %} {% trans "the submission." %}</p>
14-
<p>{% trans "We recommend updating your profile after accepting the invite. You’ll also have the option to update your name and email in 'My account' section." %}</p>
15-
<div class="flex justify-end mt-10">
16-
<a
17-
class="button button--submit button--white"
18-
hx-post="."
19-
hx-vals='{"action": "reject"}'
20-
hx-trigger="click"
21-
hx-swap="none"
22-
>{% trans "Decline" %}</a>
23-
<a
24-
class="button button--submit button--primary"
25-
type="button"
26-
hx-post="."
27-
hx-vals='{"action": "accept"}'
28-
hx-trigger="click"
29-
hx-swap="none"
30-
>{% trans "Accept" %} </a>
31-
</div>
12+
<p>{% trans "You've been invited to join the application" %} "{{ invite.submission.title }}" {% trans "as a co-applicant with email" %} <i>{{ invite.invited_user_email }}</i>. {% trans "Please respond to the invitation by choosing accept or decline." %}</p>
13+
<p>{% trans "If you accept, you’ll be automatically signed up or logged in and taken directly to" %} {% if two_factor_required %}{% trans "two factor authentication and then to" %} {% endif %} {% trans "the application. We recommend updating your profile after accepting the invite. You’ll also have the option to update your name and email in 'My account' section." %}
14+
<div class="flex justify-end mt-10">
15+
<a
16+
class="button button--submit button--white"
17+
hx-post="."
18+
hx-vals='{"action": "reject"}'
19+
hx-trigger="click"
20+
hx-swap="none"
21+
>{% trans "Decline" %}</a>
22+
<a
23+
class="button button--submit button--primary"
24+
type="button"
25+
hx-post="."
26+
hx-vals='{"action": "accept"}'
27+
hx-trigger="click"
28+
hx-swap="none"
29+
>{% trans "Accept" %} </a>
30+
</div>
3231
{% else %}
3332
<div class="flex justify-center my-8 text-xl font-bold text-red-500" >{% trans "Invalid Invite" %}</div>
3433
<div class="flex justify-center">{% trans "Oops! The invite you are using is no longer valid " %}</div>

hypha/apply/funds/templates/funds/includes/co-applicant-block.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{% load i18n heroicons %}
22

33
<div class="sidebar__inner sidebar__inner--actions" data-testid="sidebar-primary-actions">
4-
<details {% if user.is_applicant %} open {% endif %}>
5-
<summary class="flex gap-4 justify-between items-center">
4+
<details {% if user.is_applicant or not co_applicants %} open {% endif %} class="group">
5+
<summary class="flex gap-4 justify-between items-center list-none">
66
<p class="flex items-center text-lg font-bold">
7-
{% trans "Co-applicants" %}
8-
{% heroicon_solid "chevron-down" size="16" class="w-4 h-4 ms-2" %}
7+
{% trans "Co-applicants" %} <span class="text-base font-medium"> ({{ co_applicants.count }})</span>
8+
{% heroicon_solid "chevron-down" size="16" class="w-4 h-4 transition-transform rotate-90 ms-2 group-open:rotate-0" %}
99
</p>
1010
<button
1111
class="flex items-center py-1 pr-4 pl-2 font-bold rounded-sm -me-2 {% if object.co_applicant_invites.count >= invite_max_limit %} text-blue-200 {% else %}transition-colors cursor-pointer text-dark-blue hover:bg-slate-200{% endif %}"
1212
hx-get="{% url 'apply:submissions:invite_co_applicant' pk=object.id %}"
1313
hx-target="#htmx-modal"
1414
{% if object.co_applicant_invites.count >= invite_max_limit %}disabled title='{% trans "Max limit reached" %}'{% endif %}
1515
role="button"
16-
aria-label="{% trans "Invite CoApplicant" %}"
16+
aria-label="{% trans "Invite co-applicant" %}"
1717
>
1818
{% heroicon_micro "plus" class="inline align-middle me-1" stroke_width=5 aria_hidden=true %}
1919
{% trans "Invite" %}
@@ -25,7 +25,7 @@
2525

2626
<div>
2727
<a
28-
class="font-bold line-clamp-2"
28+
class="font-bold line-clamp-2 group/coapplicant"
2929
href="{% url 'apply:submissions:edit_co_applicant' invite_pk=invite.id %}"
3030
hx-get="{% url 'apply:submissions:edit_co_applicant' invite_pk=invite.id %}"
3131
hx-target="#htmx-modal"
@@ -37,7 +37,7 @@
3737
{{ invite.invited_user_email }}
3838
{% endif %}
3939

40-
{% heroicon_solid "pencil" class="inline align-middle me-1" width=16 height=16 stroke_width=2 aria_hidden=true %}
40+
{% heroicon_solid "pencil" class="hidden align-middle me-1 group-hover/coapplicant:inline" width=16 height=16 stroke_width=2 aria_hidden=true %}
4141

4242
</div>
4343
</a>
@@ -52,7 +52,7 @@
5252
</div>
5353
{% else %}
5454
<div>
55-
{% trans "No co-applicant yet" %}
55+
{% trans "No co-applicants yet." %}
5656
</div>
5757
{% endif %}
5858
</details>

0 commit comments

Comments
 (0)