From 0bbbaf63be13248ca2589445f8a4f5326bcad179 Mon Sep 17 00:00:00 2001 From: Ross Date: Sun, 28 Nov 2021 19:18:51 +0000 Subject: [PATCH] . --- atlas/templates/atlas/series_viewer.html | 31 ++++++++++++++++++++++++ atlas/urls.py | 5 ++++ 2 files changed, 36 insertions(+) diff --git a/atlas/templates/atlas/series_viewer.html b/atlas/templates/atlas/series_viewer.html index d55bbaba..26da05e7 100755 --- a/atlas/templates/atlas/series_viewer.html +++ b/atlas/templates/atlas/series_viewer.html @@ -57,4 +57,35 @@ This series is not associated with any cases. }); }); + + $(document).on('submit', '#series_finding_form', function (e) { + $.ajax({ + type: 'POST', + url: '{% url "series:add_finding" %}', + data: { + description: $('#description').val(), + series: $('#finding-form select[name="series"]').find(":selected").val(), + annotation_json: cornerstoneTools.globalImageIdSpecificToolStateManager.saveToolState(), + findings: $('#finding-form select[name="findings"]').find(":selected").val(), + csrfmiddlewaretoken: $('input[name=csrfmiddlewaretoken]').val(), + action: 'post' + }, + success: function (json) { + document.getElementById("post-form").reset(); + $(".posts").prepend('
' + + '
' + + '
' + + '

' + json.title + '

' + + '

' + json.description + '

' + + '
' + + '
' + + '
' + ) + }, + error: function (xhr, errmsg, err) { + console.log(xhr.status + ": " + xhr + .responseText); // provide a bit more info about the error to the console + } + }); + }); \ No newline at end of file diff --git a/atlas/urls.py b/atlas/urls.py index 75e0088b..0298ee6d 100755 --- a/atlas/urls.py +++ b/atlas/urls.py @@ -71,4 +71,9 @@ urlpatterns = [ views.SeriesUpdate.as_view(), name="series_update", ), + path( + "series/add_finding", + views.create_series_findings, + name="add_finding", + ), ]