From 1780fd16a2d776e21d54da5fa0ad0280b26cb6c2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jean-S=C3=A9bastien=20Caux?= <git@jscaux.org>
Date: Thu, 15 Dec 2022 04:52:24 +0100
Subject: [PATCH] Tweak pool submission details

---
 .../_submission_details_summary_contents.html | 17 ++++---
 scipost_django/submissions/urls/pool.py       | 49 ++++++++++---------
 scipost_django/submissions/views/pool.py      |  7 ++-
 3 files changed, 41 insertions(+), 32 deletions(-)

diff --git a/scipost_django/submissions/templates/submissions/pool/_submission_details_summary_contents.html b/scipost_django/submissions/templates/submissions/pool/_submission_details_summary_contents.html
index e4b9ea957..4fdaca9a3 100644
--- a/scipost_django/submissions/templates/submissions/pool/_submission_details_summary_contents.html
+++ b/scipost_django/submissions/templates/submissions/pool/_submission_details_summary_contents.html
@@ -84,6 +84,7 @@
 	  <div class="col-md-4">
 	    <a class="btn btn-success text-white" href="{% url 'submissions:pool:editorial_assignment' submission.preprint.identifier_w_vn_nr %}"><small>Volunteer as EiC</small></a>
 	  </div>
+
 	{% endif %}
       </div>
     {% endif %}
@@ -105,6 +106,14 @@
 	</a></li>
       {% endif %}
     </ul>
+    {% if submission.cycle.has_required_actions %}
+      <li>
+	<button class="btn btn-sm btn-danger text-white">
+	  Required actions
+	</button>
+	{% if request.user.contributor.is_ed_admin %}{% include 'submissions/pool/_required_actions_tooltip.html' with submission=submission classes='text-white' %}{% endif %}
+      </ul>
+    {% endif %}
   </div>
 </div>
 
@@ -117,14 +126,6 @@
   </div>
 {% endif %}
 
-{% if submission.cycle.has_required_actions %}
-  <div class="card-text bg-danger text-white mt-1 py-1 px-2">
-    <button type="button" class="btn p-0" disabled>
-      <small class="text-white">This Submission contains required actions.</small>
-    </button>
-    {% if request.user.contributor.is_ed_admin %}{% include 'submissions/pool/_required_actions_tooltip.html' with submission=submission classes='text-white' %}{% endif %}
-  </div>
-{% endif %}
 
 {% if submission.status == 'seeking_assignment' %}
   {% get_editor_invitations submission request.user as invitations %}
diff --git a/scipost_django/submissions/urls/pool.py b/scipost_django/submissions/urls/pool.py
index 43eca244a..8c378ec77 100644
--- a/scipost_django/submissions/urls/pool.py
+++ b/scipost_django/submissions/urls/pool.py
@@ -18,8 +18,33 @@ urlpatterns = [ # building on /submissions/pool/
     ),
     path( # <identifier>/
         "<identifier:identifier_w_vn_nr>/",
-        views_pool.pool,
-        name="pool",
+        include([
+            path(
+                "",
+                views_pool.pool,
+                name="pool",
+            ),
+            path(
+                "add_remark",
+                views_pool.add_remark,
+                name="add_remark",
+            ),
+            path(
+                "editorial_assignment/",
+                include([
+                    path(
+                        "",
+                        views_pool.editorial_assignment,
+                        name="editorial_assignment",
+                    ),
+                    path(
+                        "<int:assignment_id>/",
+                        views_pool.editorial_assignment,
+                        name="editorial_assignment",
+                    ),
+                ]),
+            ),
+        ])
     ),
     path(
         "submissions/",
@@ -36,30 +61,10 @@ urlpatterns = [ # building on /submissions/pool/
             ),
         ]),
     ),
-    path(
-        "add_remark/<identifier:identifier_w_vn_nr>",
-        views_pool.add_remark,
-        name="add_remark",
-    ),
     # Assignment of Editor-in-charge
     path(
         "assignment_request/<int:assignment_id>",
         views_pool.assignment_request,
         name="assignment_request",
     ),
-    path(
-        "pool/<identifier:identifier_w_vn_nr>/editorial_assignment/",
-        include([
-            path(
-                "",
-                views_pool.editorial_assignment,
-                name="editorial_assignment",
-            ),
-            path(
-                "<int:assignment_id>/",
-                views_pool.editorial_assignment,
-                name="editorial_assignment",
-            ),
-        ]),
-    ),
 ]
diff --git a/scipost_django/submissions/views/pool.py b/scipost_django/submissions/views/pool.py
index 4c546e158..ff5865e5b 100644
--- a/scipost_django/submissions/views/pool.py
+++ b/scipost_django/submissions/views/pool.py
@@ -16,13 +16,16 @@ from colleges.permissions import (
     fellowship_required,
     fellowship_or_admin_required,
 )
-
+from mails.utils import DirectMailUtil
 from submissions.models import (
     EditorialAssignment,
     EICRecommendation,
     Submission,
 )
-from submissions.forms import SubmissionPoolSearchForm
+from submissions.forms import (
+    SubmissionPoolSearchForm,
+    EditorialAssignmentForm,
+)
 from submissions.utils import SubmissionUtils
 
 
-- 
GitLab