Refactor URL patterns: update legacy case_id references to include 'id' for improved clarity and consistency
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
|
||||
|
||||
{% block content %}
|
||||
{% include 'atlas/partials/_viewing_case_as_part_of_collection.html' with nav_link_view="atlas:collection_case_displaysetup" %}
|
||||
<h2>Setup default display for case</h2>
|
||||
{% include 'atlas/partials/_viewing_case_as_part_of_collection.html' with nav_link_view="atlas:collection_case_displaysetup" %}
|
||||
<h2>Setup default display for case</h2>
|
||||
|
||||
<div id="root" class="dicom-viewer-root" data-images="{{casedetail.case.get_series_images_nested}}"
|
||||
style="box-sizing: border-box; background: #222; width: 100vw; height: 800px; max-width: 1600px;"
|
||||
@@ -15,16 +15,16 @@
|
||||
|
||||
></div>
|
||||
|
||||
<button id="save-viewerstate" type="button" class="btn btn-primary mt-3">
|
||||
<button id="save-viewerstate" type="button" class="btn btn-primary mt-3">
|
||||
Save Viewer State
|
||||
</button>
|
||||
<button id="reset-viewerstate" type="button" class="btn btn-secondary mt-3 ms-2">
|
||||
</button>
|
||||
<button id="reset-viewerstate" type="button" class="btn btn-secondary mt-3 ms-2">
|
||||
Reset to Default
|
||||
</button>
|
||||
<div id="viewerstate-save-response" class="mt-2"></div>
|
||||
</button>
|
||||
<div id="viewerstate-save-response" class="mt-2"></div>
|
||||
|
||||
<script>
|
||||
document.getElementById('save-viewerstate').addEventListener('click', function() {
|
||||
<script>
|
||||
document.getElementById('save-viewerstate').addEventListener('click', function() {
|
||||
let viewerState = window.exportViewerState_root();
|
||||
if (!viewerState) {
|
||||
document.getElementById('viewerstate-save-response').innerHTML = "<span class='text-danger'>Viewer state could not be retrieved.</span>";
|
||||
@@ -45,8 +45,8 @@ document.getElementById('save-viewerstate').addEventListener('click', function()
|
||||
.catch(error => {
|
||||
document.getElementById('viewerstate-save-response').innerHTML = "<span class='text-danger'>Error saving viewer state.</span>";
|
||||
});
|
||||
});
|
||||
document.getElementById('reset-viewerstate').addEventListener('click', function() {
|
||||
});
|
||||
document.getElementById('reset-viewerstate').addEventListener('click', function() {
|
||||
fetch({% if case_number %}"{% url 'atlas:collection_case_displaysetup' casedetail.collection.pk case_number=case_number %}"{% else %}"{% url 'atlas:collection_case_displaysetup_legacy' casedetail.collection.pk casedetail.case.pk %}"{% endif %}, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
@@ -63,7 +63,7 @@ document.getElementById('reset-viewerstate').addEventListener('click', function(
|
||||
.catch(error => {
|
||||
document.getElementById('viewerstate-save-response').innerHTML = "<span class='text-danger'>Error resetting viewer state.</span>";
|
||||
});
|
||||
});
|
||||
</script>
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
@@ -1,14 +1,14 @@
|
||||
<div class="btn-group btn-group-sm me-2" role="group" aria-label="management-actions">
|
||||
<a class="btn btn-outline-secondary" href="{% url 'atlas:collection_case_displaysetup' casedetail.collection.pk casedetail.get_case_index %}" title="Setup default display">
|
||||
<a class="btn btn-outline-secondary" href="{% url 'atlas:collection_case_displaysetup_legacy' casedetail.collection.pk casedetail.case.pk %}" title="Setup default display">
|
||||
<i class="bi bi-display"></i>
|
||||
</a>
|
||||
|
||||
<a class="btn btn-outline-secondary" href="{% url 'atlas:collection_case_details' casedetail.collection.pk casedetail.get_case_index %}" title="Case details">
|
||||
<a class="btn btn-outline-secondary" href="{% url 'atlas:collection_case_details_legacy' casedetail.collection.pk casedetail.case.pk %}" title="Case details">
|
||||
<i class="bi bi-info-square"></i>
|
||||
</a>
|
||||
|
||||
{% if collection.collection_type == "QUE" %}
|
||||
<a class="btn btn-outline-secondary" href='{% url "atlas:collection_case_questions" casedetail.collection.pk casedetail.get_case_index %}' title="Manage questions">
|
||||
<a class="btn btn-outline-secondary" href='{% url "atlas:collection_case_questions_legacy" casedetail.collection.pk casedetail.case.pk %}' title="Manage questions">
|
||||
{% if casedetail.question_schema %}
|
||||
<i class="bi bi-question-square text-success"></i>
|
||||
{% else %}
|
||||
|
||||
+10
-10
@@ -174,7 +174,7 @@ urlpatterns = [
|
||||
),
|
||||
# Backwards-compatible redirect from legacy case_id-style URLs
|
||||
path(
|
||||
"collection/<int:exam_id>/case/<int:case_id>/details",
|
||||
"collection/<int:exam_id>/case/id/<int:case_id>/details",
|
||||
views.redirect_collection_case_details_by_id,
|
||||
name="collection_case_details_legacy",
|
||||
),
|
||||
@@ -184,7 +184,7 @@ urlpatterns = [
|
||||
name="collection_case_questions",
|
||||
),
|
||||
path(
|
||||
"collection/<int:exam_id>/case/<int:case_id>/questions",
|
||||
"collection/<int:exam_id>/case/id/<int:case_id>/questions",
|
||||
views.redirect_collection_case_questions_by_id,
|
||||
name="collection_case_questions_legacy",
|
||||
),
|
||||
@@ -194,7 +194,7 @@ urlpatterns = [
|
||||
name="collection_case_priors",
|
||||
),
|
||||
path(
|
||||
"collection/<int:exam_id>/case/<int:case_id>/priors",
|
||||
"collection/<int:exam_id>/case/id/<int:case_id>/priors",
|
||||
views.redirect_collection_case_priors_by_id,
|
||||
name="collection_case_priors_legacy",
|
||||
),
|
||||
@@ -204,7 +204,7 @@ urlpatterns = [
|
||||
name="collection_case_dicom_json",
|
||||
),
|
||||
path(
|
||||
"collection/<int:exam_id>/case/<int:case_id>/dicom_json",
|
||||
"collection/<int:exam_id>/case/id/<int:case_id>/dicom_json",
|
||||
views.redirect_collection_case_dicom_json_by_id,
|
||||
name="collection_case_dicom_json_legacy",
|
||||
),
|
||||
@@ -214,7 +214,7 @@ urlpatterns = [
|
||||
name="collection_case_dicom_json_review",
|
||||
),
|
||||
path(
|
||||
"collection/<int:exam_id>/case/<int:case_id>/dicom_json/review",
|
||||
"collection/<int:exam_id>/case/id/<int:case_id>/dicom_json/review",
|
||||
views.redirect_collection_case_dicom_json_review_by_id,
|
||||
name="collection_case_dicom_json_review_legacy",
|
||||
),
|
||||
@@ -300,7 +300,7 @@ urlpatterns = [
|
||||
),
|
||||
# legacy path that used case PK; redirect to canonical case_number URL
|
||||
path(
|
||||
"collection/<int:pk>/<int:case_id>",
|
||||
"collection/<int:pk>/id/<int:case_id>",
|
||||
views.redirect_collection_case_view_by_id,
|
||||
name="collection_case_view_legacy",
|
||||
),
|
||||
@@ -310,7 +310,7 @@ urlpatterns = [
|
||||
name="collection_case_displaysetup",
|
||||
),
|
||||
path(
|
||||
"collection/<int:collection_id>/<int:case_id>/display_setup",
|
||||
"collection/<int:collection_id>/id/<int:case_id>/display_setup",
|
||||
views.redirect_collection_case_displaysetup_by_id,
|
||||
name="collection_case_displaysetup_legacy",
|
||||
),
|
||||
@@ -320,7 +320,7 @@ urlpatterns = [
|
||||
name="collection_case_view_take",
|
||||
),
|
||||
path(
|
||||
"collection/<int:pk>/<int:case_id>/take/<int:cid>/<str:passcode>",
|
||||
"collection/<int:pk>/id/<int:case_id>/take/<int:cid>/<str:passcode>",
|
||||
views.redirect_collection_case_view_take_by_id,
|
||||
name="collection_case_view_take_legacy",
|
||||
),
|
||||
@@ -330,7 +330,7 @@ urlpatterns = [
|
||||
name="collection_case_view_take_user",
|
||||
),
|
||||
path(
|
||||
"collection/<int:pk>/<int:case_id>/take/",
|
||||
"collection/<int:pk>/id/<int:case_id>/take/",
|
||||
views.redirect_collection_case_view_take_user_by_id,
|
||||
name="collection_case_view_take_user_legacy",
|
||||
),
|
||||
@@ -340,7 +340,7 @@ urlpatterns = [
|
||||
name="collection_case_view_take_user_answers",
|
||||
),
|
||||
path(
|
||||
"collection/<int:pk>/<int:case_id>/take/answers",
|
||||
"collection/<int:pk>/id/<int:case_id>/take/answers",
|
||||
views.redirect_collection_case_view_take_user_answers_by_id,
|
||||
name="collection_case_view_take_user_answers_legacy",
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user