diff --git a/scipost_django/edadmin/templates/edadmin/_hx_submission.html b/scipost_django/edadmin/templates/edadmin/_hx_submission_details_contents.html similarity index 69% rename from scipost_django/edadmin/templates/edadmin/_hx_submission.html rename to scipost_django/edadmin/templates/edadmin/_hx_submission_details_contents.html index 968eb6cb275effec29d2e5da2a99f93a7293eaa1..d8d1fd924e4600f7934cc70a18e2e52e64f82a79 100644 --- a/scipost_django/edadmin/templates/edadmin/_hx_submission.html +++ b/scipost_django/edadmin/templates/edadmin/_hx_submission_details_contents.html @@ -1,8 +1,8 @@ <div class="p-4"> - <h1>Status: {{ submission.get_status_display }}</h1> - <hr class="my-2"> - <h1>Submission details summary</h1> - {% include 'submissions/_submission_summary.html' with submission=submission hide_title=1 show_abstract=1 %} + <details> + <summary><h1>Submission details summary</h1></summary> + {% include 'submissions/_submission_summary.html' with submission=submission hide_title=1 show_abstract=1 %} + </details> {% if submission.in_stage_incoming %} {% include "edadmin/_hx_submission_incoming.html" with submission=submission %} diff --git a/scipost_django/edadmin/templates/edadmin/_hx_submissions_list.html b/scipost_django/edadmin/templates/edadmin/_hx_submissions.html similarity index 58% rename from scipost_django/edadmin/templates/edadmin/_hx_submissions_list.html rename to scipost_django/edadmin/templates/edadmin/_hx_submissions.html index 1691b63869b5a90c851809334d840f77bd9ae38c..eed712b598f5203aa51a6a012f0308f1d50dda4f 100644 --- a/scipost_django/edadmin/templates/edadmin/_hx_submissions_list.html +++ b/scipost_django/edadmin/templates/edadmin/_hx_submissions.html @@ -2,20 +2,8 @@ <div class="ms-3 mt-3"><strong>{{ forloop.counter0|add:start_index }} of {{ count }}</strong></div> - <details id="submission-{{ submission.pk }}-details" - class="border border-2 mx-3" - > - <summary style="list-style: none;" - class="p-2 bg-primary bg-opacity-10" - > - {% include "submissions/pool/_submission_details_summary_contents.html" with submission=submission %} - </summary> - <div id="submission-{{ submission.pk }}-edadmin" - hx-get="{% url 'edadmin:_hx_submission' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}" - hx-trigger="toggle once from:#submission-{{ submission.pk }}-details, submission-{{ submission.pk }}-details-updated" - > - </div> - </details> + {% include "edadmin/_submission_details.html" with submission=submission %} + {% empty %} <p><strong>No Submission found</strong></p> {% endfor %} diff --git a/scipost_django/edadmin/templates/edadmin/_submission_details.html b/scipost_django/edadmin/templates/edadmin/_submission_details.html new file mode 100644 index 0000000000000000000000000000000000000000..cc820cdd3dd891d888c1349f86b835942c996dd3 --- /dev/null +++ b/scipost_django/edadmin/templates/edadmin/_submission_details.html @@ -0,0 +1,14 @@ +<details id="submission-{{ submission.pk }}-details" + class="border border-2 mx-3" +> + <summary style="list-style: none;" + class="p-2 bg-primary bg-opacity-10" + > + {% include "submissions/pool/_submission_details_summary_contents.html" with submission=submission %} + </summary> + <div id="submission-{{ submission.pk }}-details-contents" + hx-get="{% url 'edadmin:_hx_submission_details_contents' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}" + hx-trigger="toggle once from:#submission-{{ submission.pk }}-details, submission-{{ submission.pk }}-details-updated" + > + </div> +</details> diff --git a/scipost_django/edadmin/templates/edadmin/edadmin.html b/scipost_django/edadmin/templates/edadmin/edadmin.html index 10ee1c53b67fc14e0d17e1e2958f40ba8f8df6a7..00ac88fd453e580527b93780ebcc846ab45dbdc8 100644 --- a/scipost_django/edadmin/templates/edadmin/edadmin.html +++ b/scipost_django/edadmin/templates/edadmin/edadmin.html @@ -7,7 +7,7 @@ <div class="container"> <nav class="breadcrumb hidden-sm-down"> {% block breadcrumb_items %} - <a href="{% url 'submissions:pool:pool' %}" class="breadcrumb-item">EdAdmin</a> + <a href="{% url 'edadmin:edadmin' %}" class="breadcrumb-item">EdAdmin</a> {% endblock %} </nav> </div> diff --git a/scipost_django/edadmin/urls/base.py b/scipost_django/edadmin/urls/base.py index e99112d78ebb6829c611b170b82686a22c48c1ea..ba6aee73fc5d7902aba60a5d5cf2002e45ce886f 100644 --- a/scipost_django/edadmin/urls/base.py +++ b/scipost_django/edadmin/urls/base.py @@ -21,9 +21,9 @@ urlpatterns = [ "<identifier:identifier_w_vn_nr>/", include([ path( - "", - base._hx_submission, - name="_hx_submission", + "details/contents", + base._hx_submission_details_contents, + name="_hx_submission_details_contents", ), ]), ), diff --git a/scipost_django/edadmin/views/base.py b/scipost_django/edadmin/views/base.py index 04aa60a6c85d003501254bbbb5379a0c38943c76..362e2ae27d61e79da4727643b72d8523647e8053 100644 --- a/scipost_django/edadmin/views/base.py +++ b/scipost_django/edadmin/views/base.py @@ -47,14 +47,14 @@ def _hx_submissions_in_stage(request, stage): page_obj, "start_index": start_index, } - return render(request, "edadmin/_hx_submissions_list.html", context) + return render(request, "edadmin/_hx_submissions.html", context) @login_required @user_passes_test(is_edadmin) -def _hx_submission(request, identifier_w_vn_nr): +def _hx_submission_details_contents(request, identifier_w_vn_nr): submission = get_object_or_404( Submission, preprint__identifier_w_vn_nr=identifier_w_vn_nr ) context = {"submission": submission,} - return render(request, "edadmin/_hx_submission.html", context) + return render(request, "edadmin/_hx_submission_details_contents.html", context) diff --git a/scipost_django/submissions/templates/submissions/admin/_hx_submission_update_preprint_file.html b/scipost_django/submissions/templates/submissions/admin/_hx_submission_update_preprint_file.html index 8561acab8b1ec283dabecd47525065ad89aa24db..0d84915e8059a17a6c70b94053c42139da5811b6 100644 --- a/scipost_django/submissions/templates/submissions/admin/_hx_submission_update_preprint_file.html +++ b/scipost_django/submissions/templates/submissions/admin/_hx_submission_update_preprint_file.html @@ -3,7 +3,7 @@ <p><strong>Update the preprint pdf</strong> <button type="button" class="ms-2 px-1 py-0 btn btn-sm btn-outline-danger" - hx-get="{% url 'submissions:pool:_hx_submission_li_details' submission.preprint.identifier_w_vn_nr %}" + hx-get="{% url 'submissions:pool:_hx_submission_details_contents' submission.preprint.identifier_w_vn_nr %}" hx-target="#details_{{ submission.id }}" > cancel diff --git a/scipost_django/submissions/templates/submissions/admin/_hx_submission_update_target_journal.html b/scipost_django/submissions/templates/submissions/admin/_hx_submission_update_target_journal.html index 0f1e7b78f6514485d7e50daf3184de9d0a5cacaf..cfc2f9dd810ebbcc17caaf99db3d931ad8c77e6c 100644 --- a/scipost_django/submissions/templates/submissions/admin/_hx_submission_update_target_journal.html +++ b/scipost_django/submissions/templates/submissions/admin/_hx_submission_update_target_journal.html @@ -3,7 +3,7 @@ <p><strong>Update the target Journal</strong> <button type="button" class="ms-2 px-1 py-0 btn btn-sm btn-outline-danger" - hx-get="{% url 'submissions:pool:_hx_submission_li_details' form.instance.preprint.identifier_w_vn_nr %}" + hx-get="{% url 'submissions:pool:_hx_submission_details_contents' form.instance.preprint.identifier_w_vn_nr %}" hx-target="#details_{{ form.instance.id }}" > cancel diff --git a/scipost_django/submissions/templates/submissions/admin/_hx_submission_update_target_proceedings.html b/scipost_django/submissions/templates/submissions/admin/_hx_submission_update_target_proceedings.html index 5f6165cbbfb395099734537f1a8d8e0d4073603d..9d747f300b7fa88f940c5046bd99ca8ffdf77bb9 100644 --- a/scipost_django/submissions/templates/submissions/admin/_hx_submission_update_target_proceedings.html +++ b/scipost_django/submissions/templates/submissions/admin/_hx_submission_update_target_proceedings.html @@ -3,7 +3,7 @@ <p><strong>Update the target Proceedings</strong> <button type="button" class="ms-2 px-1 py-0 btn btn-sm btn-outline-danger" - hx-get="{% url 'submissions:pool:_hx_submission_li_details' form.instance.preprint.identifier_w_vn_nr %}" + hx-get="{% url 'submissions:pool:_hx_submission_details_contents' form.instance.preprint.identifier_w_vn_nr %}" hx-target="#details_{{ form.instance.id }}" > cancel diff --git a/scipost_django/submissions/templates/submissions/pool/_hx_submission_details.html b/scipost_django/submissions/templates/submissions/pool/_hx_submission_details.html index e9601b751843c558bf85763a41f1c9700a61f593..e0e8a32b3dc55560832eddee4b8af9d5d0e8493d 100644 --- a/scipost_django/submissions/templates/submissions/pool/_hx_submission_details.html +++ b/scipost_django/submissions/templates/submissions/pool/_hx_submission_details.html @@ -1,137 +1,25 @@ -{% load static %} -{% load submissions_pool %} -{% load user_groups %} +<details id="submission-{{ submission.pk }}-details" + class="border border-2 mx-3" +> + <summary style="list-style: none;" + class="p-2 bg-primary bg-opacity-10" + > + {% include "submissions/pool/_submission_details_summary_contents.html" with submission=submission %} -{% is_ed_admin request.user as is_ed_admin %} - - -<details> - <summary> </summary> -</details> - -<div class="pool-item"> - <div class="row"> - <div class="col-md-7"> - <a href="{% url 'submissions:submission' submission.preprint.identifier_w_vn_nr %}">{{ submission.title }}</a> - <br> - <em>by {{ submission.author_list }}</em> - <br> - <div class="my-2"> - <span class="text-secondary">{% include 'bi/bullseye.html' %}: </span> - {{ submission.submitted_to }} - </div> - </div> - <div class="col-md-5"> - <ul class="bg-secondary py-1"> - {% for specialty in submission.specialties.all %} - <li><small>{{ specialty }}</small></li> - {% endfor %} - </ul> - </div> - </div> - - <div class="row mb-0"> - <div class="col-md-3"> - <small class="text-muted">Editor-in-charge</small> - <br> - <ul class="list list-unstyled"> - {% if submission.status == 'seeking_assignment' %} - {% if is_ed_admin %} - <li>Seeking assignment</li> - {% else %} - <li>You can - <a href="{% url 'submissions:pool:editorial_assignment' submission.preprint.identifier_w_vn_nr %}"><strong class="text-danger">volunteer to become Editor-in-charge</strong></a> - </li> - {% endif %} - {% if request.user.contributor.is_active_senior_fellow %} - <li>As Senior Fellow: <a href="{% url 'submissions:editor_invitations' submission.preprint.identifier_w_vn_nr %}"><strong class="text-danger">view/update editor invitations</strong></a></li> - {% endif %} - {% elif submission.editor_in_charge == request.user.contributor %} - <li> - <strong>You are the EIC</strong> - <a role="button" class="btn btn-info px-1 py-0" href="{% url 'submissions:editorial_page' submission.preprint.identifier_w_vn_nr %}"><small>{% include 'bi/arrow-right.html' %} Editorial page</small></a> - </li> - {% else %} - <li>{{ submission.editor_in_charge }}</li> - {% endif %} - </ul> - </div> - <div class="col-md-3"> - <small class="text-muted">Original submission date</small> - <br> - {{ submission.original_submission_date|date:'Y-m-d' }} - </div> - <div class="col-md-2"> - <small class="text-muted">Latest activity</small> - <br> - {{ submission.latest_activity }} - </div> - <div class="col-md-4"> - <small class="text-muted">Submission Status</small> - <br> - <span class="label label-sm label-secondary text-wrap">{{ submission.get_status_display }}</span> - {% with recommendation=submission.eicrecommendations.active.first %} - {% if recommendation %} - <br> - <small class="text-muted">EIC Recommendation & Status</small> - <br> - <span class="label label-sm label-secondary text-wrap">{{ recommendation.get_full_status_display }}</span> - <br> - <small class="text-muted">{{ recommendation.eligible_to_vote.count }} voting: {{ recommendation.voted_for.count }} agreed, {{ recommendation.voted_against.count }} disagreed, {{ recommendation.voted_abstain.count }} abstained</small> - {% endif %} - {% endwith %} - {% if submission.editorial_decision %} - <br> - <small class="text-muted">Editorial Decision Status</small> - <br> - <span class="label label-sm label-secondary text-wrap">{{ submission.editorial_decision.get_status_display }}</span> - {% endif %} - </div> - </div> - {% if is_ed_admin and submission.has_inadequate_fellowship_composition %} - <div class="border border-danger text-danger mt-1 py-1 px-2"> - <strong> - {% include 'bi/exclamation-triangle-fill.html' %} - Notice to admin: The current editor is not assigned to the pool. Therefore, the editor will not be able to reach the editorial page. - </strong> - </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 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 %} - {% if invitations %} - <div class="border border-warning mt-1 py-1 px-2"> - <span class="mt-1 px-1 text-danger">{% include 'bi/exclamation.html' %}</i> - You are invited to become Editor-in-charge of this Submission. <a href="{% url 'submissions:pool:editorial_assignment' submission.preprint.identifier_w_vn_nr %}">You can reply to this invitation here</a>. - </div> - {% endif %} - {% endif %} - - <div id="details_{{ submission.id }}" class="mt-2"> - <button type="button" class="btn btn-primary p-1 mx-auto" - hx-get="{% url 'submissions:pool:_hx_submission_li_details' submission.preprint.identifier_w_vn_nr %}" - hx-target="#details_{{ submission.id }}" - hx-indicator="#indicator-details-{{ submission.id }}" + <div id="details_{{ submission.id }}" + class="mt-2" + hx-get="{% url 'submissions:pool:_hx_submission_details_contents' submission.preprint.identifier_w_vn_nr %}" + hx-trigger="toggle once from:#submission-{{ submission.pk }}-details" + hx-indicator="#indicator-details-{{ submission.id }}" > - <small>View details</small> - </button> - <span id="indicator-details-{{ submission.id }}" class="htmx-indicator p-1"> - <button class="btn btn-sm btn-warning p-2" type="button" disabled> - <small><strong>Loading...</strong></small> - <div class="spinner-grow spinner-grow-sm ms-2" role="status" aria-hidden="true"></div> - </button> - </span> </div> + <span id="indicator-details-{{ submission.id }}" class="htmx-indicator p-1"> + <button class="btn btn-sm btn-warning p-2" type="button" disabled> + <small><strong>Loading...</strong></small> + <div class="spinner-grow spinner-grow-sm ms-2" role="status" aria-hidden="true"></div> + </button> + </span> -</div> +</details> diff --git a/scipost_django/submissions/templates/submissions/pool/_hx_submission_li_details.html b/scipost_django/submissions/templates/submissions/pool/_hx_submission_details_contents.html similarity index 93% rename from scipost_django/submissions/templates/submissions/pool/_hx_submission_li_details.html rename to scipost_django/submissions/templates/submissions/pool/_hx_submission_details_contents.html index a0cd2935ff4daeb1f0bed0b4e796665b733dee86..9557faa0209592822c073017c1993b979207dd05 100644 --- a/scipost_django/submissions/templates/submissions/pool/_hx_submission_li_details.html +++ b/scipost_django/submissions/templates/submissions/pool/_hx_submission_details_contents.html @@ -6,13 +6,7 @@ {% is_ed_admin request.user as is_ed_admin %} -<button type="button" class="btn btn-primary p-1" - data-bs-toggle="collapse" data-bs-target="#collapse_{{ submission.id }}" - aria-expanded="true" aria-controls="collapse_{{ submission.id }}"> - <small>Toggle details visibility</small> -</button> - -<div class="collapse show bg-light submission-detail mt-1 p-2" id="collapse_{{ submission.id }}"> +<div class="bg-light submission-detail mt-1 p-2" id="collapse_{{ submission.id }}"> <div class="card-body px-0"> <div class="row"> <div class="col-md-8"> @@ -235,10 +229,4 @@ </div> - <button type="button" class="btn btn-primary p-1" - data-bs-toggle="collapse" data-bs-target="#collapse_{{ submission.id }}" - aria-expanded="true" aria-controls="collapse_{{ submission.id }}"> - <small>Toggle details visibility</small> - </button> - </div> diff --git a/scipost_django/submissions/templates/submissions/pool/_hx_submission_li.html b/scipost_django/submissions/templates/submissions/pool/_hx_submission_li.html deleted file mode 100644 index 6585317c53cbe9893e49969dcbd84170db99329a..0000000000000000000000000000000000000000 --- a/scipost_django/submissions/templates/submissions/pool/_hx_submission_li.html +++ /dev/null @@ -1,131 +0,0 @@ -{% load static %} -{% load submissions_pool %} -{% load user_groups %} - -{% is_ed_admin request.user as is_ed_admin %} - - -<div class="pool-item"> - <div class="row"> - <div class="col-md-7"> - <a href="{% url 'submissions:submission' submission.preprint.identifier_w_vn_nr %}">{{ submission.title }}</a> - <br> - <em>by {{ submission.author_list }}</em> - <br> - <div class="my-2"> - <span class="text-secondary">{% include 'bi/bullseye.html' %}: </span> - {{ submission.submitted_to }} - </div> - </div> - <div class="col-md-5"> - <ul class="bg-secondary py-1"> - {% for specialty in submission.specialties.all %} - <li><small>{{ specialty }}</small></li> - {% endfor %} - </ul> - </div> - </div> - - <div class="row mb-0"> - <div class="col-md-3"> - <small class="text-muted">Editor-in-charge</small> - <br> - <ul class="list list-unstyled"> - {% if submission.status == 'seeking_assignment' %} - {% if is_ed_admin %} - <li>Seeking assignment</li> - {% else %} - <li>You can - <a href="{% url 'submissions:pool:editorial_assignment' submission.preprint.identifier_w_vn_nr %}"><strong class="text-danger">volunteer to become Editor-in-charge</strong></a> - </li> - {% endif %} - {% if request.user.contributor.is_active_senior_fellow %} - <li>As Senior Fellow: <a href="{% url 'submissions:editor_invitations' submission.preprint.identifier_w_vn_nr %}"><strong class="text-danger">view/update editor invitations</strong></a></li> - {% endif %} - {% elif submission.editor_in_charge == request.user.contributor %} - <li> - <strong>You are the EIC</strong> - <a role="button" class="btn btn-info px-1 py-0" href="{% url 'submissions:editorial_page' submission.preprint.identifier_w_vn_nr %}"><small>{% include 'bi/arrow-right.html' %} Editorial page</small></a> - </li> - {% else %} - <li>{{ submission.editor_in_charge }}</li> - {% endif %} - </ul> - </div> - <div class="col-md-3"> - <small class="text-muted">Original submission date</small> - <br> - {{ submission.original_submission_date|date:'Y-m-d' }} - </div> - <div class="col-md-2"> - <small class="text-muted">Latest activity</small> - <br> - {{ submission.latest_activity }} - </div> - <div class="col-md-4"> - <small class="text-muted">Submission Status</small> - <br> - <span class="label label-sm label-secondary text-wrap">{{ submission.get_status_display }}</span> - {% with recommendation=submission.eicrecommendations.active.first %} - {% if recommendation %} - <br> - <small class="text-muted">EIC Recommendation & Status</small> - <br> - <span class="label label-sm label-secondary text-wrap">{{ recommendation.get_full_status_display }}</span> - <br> - <small class="text-muted">{{ recommendation.eligible_to_vote.count }} voting: {{ recommendation.voted_for.count }} agreed, {{ recommendation.voted_against.count }} disagreed, {{ recommendation.voted_abstain.count }} abstained</small> - {% endif %} - {% endwith %} - {% if submission.editorial_decision %} - <br> - <small class="text-muted">Editorial Decision Status</small> - <br> - <span class="label label-sm label-secondary text-wrap">{{ submission.editorial_decision.get_status_display }}</span> - {% endif %} - </div> - </div> - {% if is_ed_admin and submission.has_inadequate_fellowship_composition %} - <div class="border border-danger text-danger mt-1 py-1 px-2"> - <strong> - {% include 'bi/exclamation-triangle-fill.html' %} - Notice to admin: The current editor is not assigned to the pool. Therefore, the editor will not be able to reach the editorial page. - </strong> - </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 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 %} - {% if invitations %} - <div class="border border-warning mt-1 py-1 px-2"> - <span class="mt-1 px-1 text-danger">{% include 'bi/exclamation.html' %}</i> - You are invited to become Editor-in-charge of this Submission. <a href="{% url 'submissions:pool:editorial_assignment' submission.preprint.identifier_w_vn_nr %}">You can reply to this invitation here</a>. - </div> - {% endif %} - {% endif %} - - <div id="details_{{ submission.id }}" class="mt-2"> - <button type="button" class="btn btn-primary p-1 mx-auto" - hx-get="{% url 'submissions:pool:_hx_submission_li_details' submission.preprint.identifier_w_vn_nr %}" - hx-target="#details_{{ submission.id }}" - hx-indicator="#indicator-details-{{ submission.id }}" - > - <small>View details</small> - </button> - <span id="indicator-details-{{ submission.id }}" class="htmx-indicator p-1"> - <button class="btn btn-sm btn-warning p-2" type="button" disabled> - <small><strong>Loading...</strong></small> - <div class="spinner-grow spinner-grow-sm ms-2" role="status" aria-hidden="true"></div> - </button> - </span> - </div> - -</div> diff --git a/scipost_django/submissions/templates/submissions/pool/_hx_submissions_list.html b/scipost_django/submissions/templates/submissions/pool/_hx_submissions_list.html index 56bd5b8862027a50d26657c24d96b6da742345d5..e1d1013e0531cde9a631b57b16625dde7e06a5a0 100644 --- a/scipost_django/submissions/templates/submissions/pool/_hx_submissions_list.html +++ b/scipost_django/submissions/templates/submissions/pool/_hx_submissions_list.html @@ -1,5 +1,5 @@ {% for submission in page_obj %} - <span>{% if not forloop.first %} class="mt-4"{% endif %}><strong>{{ forloop.counter0|add:start_index }} of {{ count }}</strong></span> + <div class="ms-3 mt-3"><strong>{{ forloop.counter0|add:start_index }} of {{ count }}</strong></div> {% include 'submissions/pool/_hx_submission_details.html' with submission=submission %} {% empty %} <strong>No Submission could be found</strong> 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 9752d528a3abd54799c3f25d23a763df78bb7122..e4b9ea957ff42933eda394393a6496a39298d8cd 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 @@ -1,3 +1,5 @@ +{% load submissions_pool %} + <div class="row mb-0"> <div class="col col-md-9"> <table> @@ -73,13 +75,14 @@ <strong>{{ submission.editor_in_charge }}</strong> {% endif %} </div> - {% elif request.user.contributor.is_ed_admin or request.user.contributor.is_active_senior_fellow %} - <div class="col-md-4"> - <a class="btn btn-primary" href="{% url 'submissions:editor_invitations' submission.preprint.identifier_w_vn_nr %}"><small>View/update invitations</small></a> - </div> {% else %} + {% if request.user.contributor.is_ed_admin or request.user.contributor.is_active_senior_fellow %} + <div class="col-md-4"> + <a class="btn btn-primary" href="{% url 'submissions:editor_invitations' submission.preprint.identifier_w_vn_nr %}"><small>View/update invitations</small></a> + </div> + {% endif %} <div class="col-md-4"> - <a class="btn btn-success" href="{% url 'submissions:pool:editorial_assignment' submission.preprint.identifier_w_vn_nr %}"><small>Volunteer as EiC</small></a> + <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> @@ -94,13 +97,41 @@ <ul class="ms-2 list list-unstyled"> <li class="mb-2"><a href="{% url 'submissions:submission' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}" target="_blank">{% include "bi/arrow-right-square-fill.html" %}submission page</a></li> {% if request.user.contributor.is_ed_admin or request.user.contributor == submission.editor_in_charge %} - <li class="mb-2"><a href="{% url 'submissions:editorial_page' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}" target="_blank"> - <span class="text-danger"> - {% include "bi/arrow-right-square-fill.html" %} - editorial page - </span> - </a></li> + <li class="mb-2"><a href="{% url 'submissions:editorial_page' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}" target="_blank"> + <span class="text-danger"> + {% include "bi/arrow-right-square-fill.html" %} + editorial page + </span> + </a></li> {% endif %} </ul> </div> </div> + +{% if request.user.contributor.is_ed_admin and submission.has_inadequate_fellowship_composition %} + <div class="border border-danger text-danger mt-1 py-1 px-2"> + <strong> + {% include 'bi/exclamation-triangle-fill.html' %} + Notice to admin: The current editor is not assigned to the pool. Therefore, the editor will not be able to reach the editorial page. + </strong> + </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 %} + {% if invitations %} + <div class="border border-warning mt-1 py-1 px-2"> + <span class="mt-1 px-1 text-danger">{% include 'bi/exclamation.html' %}</i> + You are invited to become Editor-in-charge of this Submission. <a href="{% url 'submissions:pool:editorial_assignment' submission.preprint.identifier_w_vn_nr %}">You can reply to this invitation here</a>. + </div> + {% endif %} +{% endif %} diff --git a/scipost_django/submissions/urls/pool.py b/scipost_django/submissions/urls/pool.py index 4a1cc7be76af2cae4435e79a959e5c3bc4674c02..43eca244aeae565fb6177d95665df3550947e2e4 100644 --- a/scipost_django/submissions/urls/pool.py +++ b/scipost_django/submissions/urls/pool.py @@ -31,8 +31,8 @@ urlpatterns = [ # building on /submissions/pool/ ), path( "<identifier:identifier_w_vn_nr>", - views_pool.pool_hx_submission_li_details, - name="_hx_submission_li_details", + views_pool.pool_hx_submission_details_contents, + name="_hx_submission_details_contents", ), ]), ), diff --git a/scipost_django/submissions/views/__init__.py b/scipost_django/submissions/views/__init__.py index 1665c4c436458a05e0821c87f32d2f13aec7b3bc..109b0c46285e7628bac8bbd01b60e9a9de350d43 100644 --- a/scipost_django/submissions/views/__init__.py +++ b/scipost_django/submissions/views/__init__.py @@ -2361,7 +2361,7 @@ def _hx_submission_update_target_journal(request, identifier_w_vn_nr): ) return redirect( reverse( - "submissions:pool:_hx_submission_li_details", + "submissions:pool:_hx_submission_details_contents", args=(submission.preprint.identifier_w_vn_nr,), ) ) @@ -2387,7 +2387,7 @@ def _hx_submission_update_target_proceedings(request, identifier_w_vn_nr): ) return redirect( reverse( - "submissions:pool:_hx_submission_li_details", + "submissions:pool:_hx_submission_details_contents", args=(submission.preprint.identifier_w_vn_nr,), ) ) @@ -2421,7 +2421,7 @@ def _hx_submission_update_preprint_file(request, identifier_w_vn_nr): ) return redirect( reverse( - "submissions:pool:_hx_submission_li_details", + "submissions:pool:_hx_submission_details_contents", args=(preprint.identifier_w_vn_nr,), ) ) diff --git a/scipost_django/submissions/views/pool.py b/scipost_django/submissions/views/pool.py index 97dcff532034a099d2e0e113155773920b95c988..4c546e158b2d62c74f1161577a170babfe002193 100644 --- a/scipost_django/submissions/views/pool.py +++ b/scipost_django/submissions/views/pool.py @@ -72,13 +72,13 @@ def pool_hx_submissions_list(request): @login_required @fellowship_or_admin_required() -def pool_hx_submission_li_details(request, identifier_w_vn_nr): +def pool_hx_submission_details_contents(request, identifier_w_vn_nr): submission = get_object_or_404( Submission.objects.in_pool(request.user, historical=True), preprint__identifier_w_vn_nr=identifier_w_vn_nr, ) context = {"remark_form": RemarkForm(), "submission": submission} - return render(request, "submissions/pool/_hx_submission_li_details.html", context) + return render(request, "submissions/pool/_hx_submission_details_contents.html", context) @login_required