.
This commit is contained in:
@@ -8,7 +8,12 @@
|
|||||||
class="toggle-button">toggle</button></p>
|
class="toggle-button">toggle</button></p>
|
||||||
<p class="pre-whitespace"><b>Region:</b> {{ question.get_regions }}</p>
|
<p class="pre-whitespace"><b>Region:</b> {{ question.get_regions }}</p>
|
||||||
<p class="pre-whitespace"><b>Examination:</b> {{ question.get_examinations }}</p>
|
<p class="pre-whitespace"><b>Examination:</b> {{ question.get_examinations }}</p>
|
||||||
<p class="pre-whitespace"><b>Laterality:</b> {{ question.laterality }}</p>
|
<p class="pre-whitespace"><b>Laterality:</b> {{ question.laterality }}
|
||||||
|
<button class="toggle-laterality-button toggle-button" data-lat="LEFT">Left</button>
|
||||||
|
<button class="toggle-laterality-button toggle-button" data-lat="RIGHT">Right</button>
|
||||||
|
<button class="toggle-laterality-button toggle-button" data-lat="BILAT">Bilateral</button>
|
||||||
|
<button class="toggle-laterality-button toggle-button" data-lat="NONE">None</button>
|
||||||
|
</p>
|
||||||
<p class="pre-whitespace"><b>Abnormality:</b> {{ question.get_abnormalities }}</p>
|
<p class="pre-whitespace"><b>Abnormality:</b> {{ question.get_abnormalities }}</p>
|
||||||
<div class="pre-whitespace multi-image-block"><b>Images:</b>
|
<div class="pre-whitespace multi-image-block"><b>Images:</b>
|
||||||
{% for image in question.images.all %}
|
{% for image in question.images.all %}
|
||||||
@@ -106,11 +111,34 @@
|
|||||||
})
|
})
|
||||||
.done(function (data) {
|
.done(function (data) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
toastr.info('Answer saved')
|
toastr.info('Answer updated')
|
||||||
})
|
})
|
||||||
.fail(function () {
|
.fail(function () {
|
||||||
alert('Error updating this model instance.');
|
alert('Error updating this model instance.');
|
||||||
//chk_status_field.prop('checked', !chk_status_field.prop('checked'));
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$(".toggle-laterality-button").each((n, el) => {
|
||||||
|
$(el).click(function () {
|
||||||
|
$.ajax({
|
||||||
|
url: "{% url 'rapid-detail' question.id %}",
|
||||||
|
type: 'PATCH',
|
||||||
|
headers: {
|
||||||
|
"X-CSRFToken": "{{ csrf_token }}"
|
||||||
|
},
|
||||||
|
timeout: 3000,
|
||||||
|
data: {
|
||||||
|
csrfmiddlewaretoken: "{{ csrf_token }}",
|
||||||
|
laterality: el.dataset.lat,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.done(function (data) {
|
||||||
|
console.log(data);
|
||||||
|
toastr.info('Answer updated')
|
||||||
|
})
|
||||||
|
.fail(function () {
|
||||||
|
alert('Error updating this model instance.');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user