Skip to content

Commit 9ea24e9

Browse files
Make lead update modals UI same for both projects and applications (#4306)
Fixes #4288
1 parent 50af140 commit 9ea24e9

File tree

5 files changed

+22
-11
lines changed

5 files changed

+22
-11
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ npm-debug.log
5151

5252
# IntelliJ
5353
out/
54+
.idea/*
5455

5556
# JIRA plugin
5657
atlassian-ide-plugin.xml

hypha/apply/funds/forms.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ class Meta:
8383
def __init__(self, *args, **kwargs):
8484
super().__init__(*args, **kwargs)
8585
lead_field = self.fields["lead"]
86-
lead_field.label = _("New lead")
86+
lead_field.label = _("Update lead from {lead} to").format(
87+
lead=self.instance.lead
88+
)
8789
lead_field.queryset = lead_field.queryset.exclude(id=self.instance.lead.id)
8890

8991

Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
{% load i18n %}
1+
{% load i18n heroicons %}
22
{% if request.user.is_apply_staff %}
3-
<span>
4-
{% trans "Lead" %}:
5-
<a class="text-white underline"
6-
href="{% url 'apply:submissions:list' %}?lead={{ submission.lead.id }}">
7-
{{ submission.lead }}
8-
</a>
9-
</span>
3+
<a class="link link--edit-lead is-active link--transparent hover:opacity-70 transition-opacity"
4+
href="{% url 'funds:submissions:lead_update' pk=submission.pk %}"
5+
hx-get="{% url 'funds:submissions:lead_update' pk=submission.pk %}"
6+
hx-target="#htmx-modal"
7+
>
8+
<u>{% trans "Lead" %}: {{ submission.lead }}</u>
9+
{% heroicon_micro "pencil-square" class="inline ms-1" aria_hidden=true %}
10+
</a>
1011
{% elif request.user.is_org_faculty or not HIDE_STAFF_IDENTITY %}
1112
<span>{% trans "Lead" %}: {{ submission.lead }}</span>
1213
{% endif %}

hypha/apply/funds/views/submission_edit.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ def get(self, *args, **kwargs):
533533
self.template,
534534
context={
535535
"form": lead_form,
536-
"value": _("Submit"),
536+
"value": _("Update"),
537537
"object": self.object,
538538
},
539539
)
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
{% load i18n %}
2-
{% modal_title %}{% trans "Assign Lead" %}{% endmodal_title %}
2+
{% modal_title %}{% trans "Update Lead" %}{% endmodal_title %}
33

44
<div class="p-4">
5+
<div>
6+
<dl class="mb-4">
7+
<dt class="font-semibold">{% trans "Current Lead" %}</dt>
8+
<dd class="truncate">{{ object.lead }} &lt;{{object.lead.email}}&gt;</dd>
9+
</dl>
10+
</div>
11+
512
{% url 'apply:projects:lead_update' object.id as url %}
613
{% include 'funds/includes/dialog_form_base.html' with form=form value=value url=url %}
714
</div>

0 commit comments

Comments
 (0)