diff --git a/scipost_django/edadmin/templates/edadmin/_hx_submission_edadmin.html b/scipost_django/edadmin/templates/edadmin/_hx_submission.html similarity index 100% rename from scipost_django/edadmin/templates/edadmin/_hx_submission_edadmin.html rename to scipost_django/edadmin/templates/edadmin/_hx_submission.html diff --git a/scipost_django/edadmin/templates/edadmin/_hx_submissions_list.html b/scipost_django/edadmin/templates/edadmin/_hx_submissions_list.html index 54f3b6cfedfee8dcad6bb93dbe0fd4de3ba5761f..ed22dfebab2eae1de95a307aa5b3edc8a11146ef 100644 --- a/scipost_django/edadmin/templates/edadmin/_hx_submissions_list.html +++ b/scipost_django/edadmin/templates/edadmin/_hx_submissions_list.html @@ -30,7 +30,7 @@ </div> </summary> <div id="submission-{{ submission.pk }}-edadmin" - hx-get="{% url 'edadmin:_hx_submission_edadmin' identifier_w_vn_nr=submission.preprint.identifier_w_vn_nr %}" + 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> diff --git a/scipost_django/edadmin/urls/__init__.py b/scipost_django/edadmin/urls/__init__.py index 8b96a1393a75640c058fce039257196f1b43810c..d53944f28514c0214ee1e2601ede8fabcb32e89c 100644 --- a/scipost_django/edadmin/urls/__init__.py +++ b/scipost_django/edadmin/urls/__init__.py @@ -2,32 +2,12 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" __license__ = "AGPL v3" -from django.urls import include, path, register_converter - -from ..converters import SubmissionStageSlugConverter -from ..views import base +from django.urls import include, path app_name = "edadmin" -register_converter(SubmissionStageSlugConverter, "stage") - urlpatterns = [ - path("", base.edadmin, name="edadmin"), - path( - "<stage:stage>", - base._hx_submissions_in_stage, - name="_hx_submissions_in_stage", - ), - path( - "<identifier:identifier_w_vn_nr>/", - include([ - path( - "_hx_submission_edadmin", - incoming._hx_submission_edadmin, - name="_hx_submission_edadmin", - ), - ]), - ), + path("", include("edadmin.urls.base")), path("incoming/", include("edadmin.urls.incoming")), ] diff --git a/scipost_django/edadmin/urls/base.py b/scipost_django/edadmin/urls/base.py new file mode 100644 index 0000000000000000000000000000000000000000..e99112d78ebb6829c611b170b82686a22c48c1ea --- /dev/null +++ b/scipost_django/edadmin/urls/base.py @@ -0,0 +1,30 @@ +__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" +__license__ = "AGPL v3" + + +from django.urls import include, path, register_converter + +from ..converters import SubmissionStageSlugConverter +from ..views import base + +register_converter(SubmissionStageSlugConverter, "stage") + + +urlpatterns = [ + path("", base.edadmin, name="edadmin"), + path( + "<stage:stage>", + base._hx_submissions_in_stage, + name="_hx_submissions_in_stage", + ), + path( + "<identifier:identifier_w_vn_nr>/", + include([ + path( + "", + base._hx_submission, + name="_hx_submission", + ), + ]), + ), +] diff --git a/scipost_django/edadmin/urls/incoming.py b/scipost_django/edadmin/urls/incoming.py index 7aa3a90ca46b505b6acf3c56ba179cb1e5fc5654..14e75d365145824bbac89d862f16be2b8de29c8c 100644 --- a/scipost_django/edadmin/urls/incoming.py +++ b/scipost_django/edadmin/urls/incoming.py @@ -8,41 +8,51 @@ from ..views import incoming urlpatterns = [ - path( - "_hx_incoming_list", - incoming._hx_incoming_list, - name="_hx_incoming_list", - ), - path( + path( # "incoming/<identifier>/" "<identifier:identifier_w_vn_nr>/", include([ - path( - "_hx_submission_admissibility", + path( # "incoming/<identifier>/admissibility" + "admissibility", incoming._hx_submission_admissibility, name="_hx_submission_admissibility", ), - path( - "_hx_plagiarism_internal", - incoming._hx_plagiarism_internal, - name="_hx_plagiarism_internal", - ), - path( - "_hx_plagiarism_internal_assess", - incoming._hx_plagiarism_internal_assess, - name="_hx_plagiarism_internal_assess", - ), - path( - "_hx_plagiarism_iThenticate", - incoming._hx_plagiarism_iThenticate, - name="_hx_plagiarism_iThenticate", - ), - path( - "_hx_plagiarism_iThenticate_assess", - incoming._hx_plagiarism_iThenticate_assess, - name="_hx_plagiarism_iThenticate_assess", - ), - path( - "_hx_submission_admission", + path( # "incoming/<identifier>/plagiarism/" + "plagiarism/", + include([ + path( # "incoming/<identifier>/plagiarism/internal/" + "internal/", + include([ + path( + "", + incoming._hx_plagiarism_internal, + name="_hx_plagiarism_internal", + ), + path( + "assess", + incoming._hx_plagiarism_internal_assess, + name="_hx_plagiarism_internal_assess", + ), + ]), + ), # end "internal/" + path( # "incoming/<identifier>/plagiarism/iThenticate/" + "iThenticate/", + include([ + path( + "", + incoming._hx_plagiarism_iThenticate, + name="_hx_plagiarism_iThenticate", + ), + path( + "assess", + incoming._hx_plagiarism_iThenticate_assess, + name="_hx_plagiarism_iThenticate_assess", + ), + ]), + ), # end "iThenticate/" + ]), + ), # end "plagiarism/" + path( # "incoming/<identifier>/admission" + "admission", incoming._hx_submission_admission, name="_hx_submission_admission", ), diff --git a/scipost_django/edadmin/views/base.py b/scipost_django/edadmin/views/base.py index c9aa781f54eca7dbe6ac7d10cce02e27727b911d..32192a4e8eb77499159137cb2c19fa6ee15b3a5d 100644 --- a/scipost_django/edadmin/views/base.py +++ b/scipost_django/edadmin/views/base.py @@ -6,7 +6,7 @@ import operator from django.contrib.auth.decorators import login_required, user_passes_test from django.http import Http404 -from django.shortcuts import render +from django.shortcuts import get_object_or_404, render from guardian.shortcuts import get_objects_for_user @@ -41,9 +41,9 @@ def _hx_submissions_in_stage(request, stage): @login_required @user_passes_test(is_edadmin) -def _hx_submission_edadmin(request, identifier_w_vn_nr): +def _hx_submission(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_edadmin.html", context) + return render(request, "edadmin/_hx_submission.html", context)