.
This commit is contained in:
@@ -32,7 +32,8 @@
|
|||||||
<p><b>Scrapped:</b> {{ question.scrapped }} <a href="{% url 'rapids:rapid_scrap' pk=question.pk %}">(toggle)</a>
|
<p><b>Scrapped:</b> {{ question.scrapped }} <a href="{% url 'rapids:rapid_scrap' pk=question.pk %}">(toggle)</a>
|
||||||
<p class="pre-whitespace">
|
<p class="pre-whitespace">
|
||||||
Answers (score): {% for answer in question.answers.all %}
|
Answers (score): {% for answer in question.answers.all %}
|
||||||
<span {% if answer.proposed %}class="proposed-answer" data-aid="{{answer.pk}}" data-question-type="rapid" {% endif %}>
|
<span {% if answer.proposed %}class="proposed-answer" data-aid="{{answer.pk}}" data-question-type="rapid"
|
||||||
|
{% endif %}>
|
||||||
{{ answer }} ({{answer.status}}),
|
{{ answer }} ({{answer.status}}),
|
||||||
</span>
|
</span>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -85,8 +86,18 @@
|
|||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
||||||
$("#toggle-normal-button").click(function () {
|
$("#toggle-normal-button").click(function () {
|
||||||
$.ajax({url: "{% url 'rapid-detail' question.id %}",
|
$.ajax({
|
||||||
type: 'PATCH', timeout: 3000, data: { normal: {{question.normal|lower}} }
|
url: "{% url 'rapid-detail' question.id %}",
|
||||||
|
type: 'PATCH',
|
||||||
|
timeout: 3000,
|
||||||
|
data: {
|
||||||
|
normal: {
|
||||||
|
{
|
||||||
|
question.normal | lower
|
||||||
|
}
|
||||||
|
},
|
||||||
|
csrfmiddlewaretoken: "{{ csrf_token }}",
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.fail(function () {
|
.fail(function () {
|
||||||
alert('Error updating this model instance.');
|
alert('Error updating this model instance.');
|
||||||
|
|||||||
Reference in New Issue
Block a user