This commit is contained in:
Ross
2021-11-28 19:18:51 +00:00
parent f3632e5738
commit 0bbbaf63be
2 changed files with 36 additions and 0 deletions
+31
View File
@@ -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('<div class="col-md-6">' +
'<div class="row no-gutters border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative">' +
'<div class="col p-4 d-flex flex-column position-static">' +
'<h3 class="mb-0">' + json.title + '</h3>' +
'<p class="mb-auto">' + json.description + '</p>' +
'</div>' +
'</div>' +
'</div>'
)
},
error: function (xhr, errmsg, err) {
console.log(xhr.status + ": " + xhr
.responseText); // provide a bit more info about the error to the console
}
});
});
</script>
+5
View File
@@ -71,4 +71,9 @@ urlpatterns = [
views.SeriesUpdate.as_view(),
name="series_update",
),
path(
"series/add_finding",
views.create_series_findings,
name="add_finding",
),
]