From 73374d16d2457ee84d9c19c69f695fae4c78847e Mon Sep 17 00:00:00 2001
From: George Katsikas <giorgakis.katsikas@gmail.com>
Date: Thu, 1 Aug 2024 11:15:50 +0200
Subject: [PATCH] reword configure to customize in ref invitations

---
 scipost_django/submissions/forms/__init__.py  |  4 ++--
 ... _hx_customize_refereeing_invitation.html} |  0
 .../_hx_select_referee_table_row.html         | 24 ++++++++++---------
 .../templates/submissions/select_referee.html |  2 +-
 scipost_django/submissions/urls/__init__.py   |  6 ++---
 scipost_django/submissions/views/__init__.py  |  6 ++---
 6 files changed, 22 insertions(+), 20 deletions(-)
 rename scipost_django/submissions/templates/submissions/{_hx_configure_refereeing_invitation.html => _hx_customize_refereeing_invitation.html} (100%)

diff --git a/scipost_django/submissions/forms/__init__.py b/scipost_django/submissions/forms/__init__.py
index 97571d764..e94841fd9 100644
--- a/scipost_django/submissions/forms/__init__.py
+++ b/scipost_django/submissions/forms/__init__.py
@@ -2723,7 +2723,7 @@ class ConfigureRefereeInvitationForm(forms.Form):
 
         self.helper = FormHelper()
         self.helper.form_action = reverse(
-            "submissions:_hx_configure_refereeing_invitation",
+            "submissions:_hx_customize_refereeing_invitation",
             kwargs={
                 "identifier_w_vn_nr": self.submission.preprint.identifier_w_vn_nr,
                 "profile_id": self.profile.id,
@@ -2740,7 +2740,7 @@ class ConfigureRefereeInvitationForm(forms.Form):
                 ),
                 Div(Field("profile_email"), css_class="mx-4"),
                 ButtonHolder(
-                    Submit("submit", "Invite", css_class="btn btn-sm btn-primary"),
+                    Submit("submit", "Draft Email", css_class="btn btn-sm btn-primary"),
                     Button(
                         "cancel",
                         "Cancel",
diff --git a/scipost_django/submissions/templates/submissions/_hx_configure_refereeing_invitation.html b/scipost_django/submissions/templates/submissions/_hx_customize_refereeing_invitation.html
similarity index 100%
rename from scipost_django/submissions/templates/submissions/_hx_configure_refereeing_invitation.html
rename to scipost_django/submissions/templates/submissions/_hx_customize_refereeing_invitation.html
diff --git a/scipost_django/submissions/templates/submissions/_hx_select_referee_table_row.html b/scipost_django/submissions/templates/submissions/_hx_select_referee_table_row.html
index 23dc51d2d..2609ebf0b 100644
--- a/scipost_django/submissions/templates/submissions/_hx_select_referee_table_row.html
+++ b/scipost_django/submissions/templates/submissions/_hx_select_referee_table_row.html
@@ -47,20 +47,22 @@
               hx-swap="afterend">Add Email</button>
 
       <button id="ref-inv-{{ profile.id }}-send-btn" type="button" class="me-2 btn btn-sm btn-{% if profile.warned_against_invitation %}warning{% else %}light{% endif %}" 
-      {% if profile.warned_against_invitation %}hx-confirm="Do you want to send an invitation to this referee despite the warning?"{% endif %}
-      hx-get="{% url 'submissions:_hx_configure_refereeing_invitation' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr profile_id=profile.id %}" hx-target="closest tr" 
-      {% if not profile.can_be_sent_invitation %}disabled{% endif %}
-      hx-swap="afterend">Configure</button>
+        {% if profile.warned_against_invitation %}hx-confirm="Do you want to send an invitation to this referee despite the warning?"{% endif %}
+         hx-get="{% url 'submissions:_hx_customize_refereeing_invitation' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr profile_id=profile.id %}" 
+         hx-target="closest tr" 
+         hx-swap="afterend"
+         {% if not profile.can_be_sent_invitation %}disabled{% endif %}
+         >Customize Invitation</button>
       <button id="ref-inv-{{ profile.id }}-send-btn" type="button" class="ms-auto btn btn-sm btn-{% if profile.warned_against_invitation %}warning{% else %}primary{% endif %}" 
-      {% if profile.warned_against_invitation %}hx-confirm="Do you want to send an invitation to this referee despite the warning?"{% endif %}
-      hx-get="{% url 'submissions:_hx_quick_invite_referee' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr profile_id=profile.id %}" hx-target="closest td" 
-      {% if not profile.can_be_sent_invitation %}disabled{% endif %}
-      hx-swap="outerHTML">Quick Send</button>
+        {% if profile.warned_against_invitation %}hx-confirm="Do you want to send an invitation to this referee despite the warning?"{% endif %}
+         hx-get="{% url 'submissions:_hx_quick_invite_referee' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr profile_id=profile.id %}" 
+         hx-target="closest td" 
+         hx-swap="outerHTML"
+         {% if not profile.can_be_sent_invitation %}disabled{% endif %}
+         >Quick Send</button>
     </div>
 
-    {% if profile.already_invited %}
-      <div class="text-warning">This person has already been invited</div>
-    {% endif %}
+    {% if profile.already_invited %}<div class="text-warning">This person has already been invited</div>{% endif %}
 
     {% if not profile.accepts_refereeing_requests %}
       <div class="text-danger">This person does not accept refereeing requests</div>
diff --git a/scipost_django/submissions/templates/submissions/select_referee.html b/scipost_django/submissions/templates/submissions/select_referee.html
index d08b075a0..b800d97ce 100644
--- a/scipost_django/submissions/templates/submissions/select_referee.html
+++ b/scipost_django/submissions/templates/submissions/select_referee.html
@@ -52,7 +52,7 @@
     There are three actions you can perform on a referee:
     <ul>
       <li><strong>Add</strong> an <strong>Email</strong> to the referee's profile.</li>
-      <li><strong>Configure</strong> the invitation by selecting an alternative email address, whether auto-reminders are sent, and the exact email content.</li>
+      <li><strong>Customize</strong> the invitation by selecting an alternative email address, whether auto-reminders are sent, and the exact email content.</li>
       <li><strong>Quick Send</strong> an invitation to the primary email, with auto-reminders, and the default email content.</li>
     </ul>
   </p>
diff --git a/scipost_django/submissions/urls/__init__.py b/scipost_django/submissions/urls/__init__.py
index 67a35cafa..c09872008 100644
--- a/scipost_django/submissions/urls/__init__.py
+++ b/scipost_django/submissions/urls/__init__.py
@@ -355,9 +355,9 @@ urlpatterns = [
         name="_hx_quick_invite_referee",
     ),
     path(
-        "refereeing/_hx_configure_invitation/<identifier:identifier_w_vn_nr>/<int:profile_id>",
-        views._hx_configure_refereeing_invitation,
-        name="_hx_configure_refereeing_invitation",
+        "refereeing/_hx_customize_invitation/<identifier:identifier_w_vn_nr>/<int:profile_id>",
+        views._hx_customize_refereeing_invitation,
+        name="_hx_customize_refereeing_invitation",
     ),
     path(
         "refereeing/_hx_add_referee_profile_email/<int:profile_id>",
diff --git a/scipost_django/submissions/views/__init__.py b/scipost_django/submissions/views/__init__.py
index 6b7f8f44a..f7d7fcad5 100644
--- a/scipost_django/submissions/views/__init__.py
+++ b/scipost_django/submissions/views/__init__.py
@@ -1263,7 +1263,7 @@ def select_referee(request, identifier_w_vn_nr):
     return render(request, "submissions/select_referee.html", context)
 
 
-def _hx_configure_refereeing_invitation(request, identifier_w_vn_nr, profile_id):
+def _hx_customize_refereeing_invitation(request, identifier_w_vn_nr, profile_id):
     submission = get_object_or_404(
         Submission.objects.in_pool_filter_for_eic(request.user),
         preprint__identifier_w_vn_nr=identifier_w_vn_nr,
@@ -1295,7 +1295,7 @@ def _hx_configure_refereeing_invitation(request, identifier_w_vn_nr, profile_id)
         )
 
     return render(
-        request, "submissions/_hx_configure_refereeing_invitation.html", context
+        request, "submissions/_hx_customize_refereeing_invitation.html", context
     )
 
 
@@ -1332,7 +1332,7 @@ def _hx_add_referee_profile_email(request, profile_id):
         return response
 
     return render(
-        request, "submissions/_hx_configure_refereeing_invitation.html", {"form": form}
+        request, "submissions/_hx_customize_refereeing_invitation.html", {"form": form}
     )
 
 
-- 
GitLab