From d88a626a76c0c2ddb0db1fc14109ca965aa4076f Mon Sep 17 00:00:00 2001 From: Ross Date: Tue, 11 Nov 2025 13:42:34 +0000 Subject: [PATCH] Implement quick add functionality for incorrect answers; return collapsed partial for quick suggestions in the answers table. --- .../templates/anatomy/question_detail.html | 98 +++++++++++++++++++ anatomy/views.py | 4 + 2 files changed, 102 insertions(+) diff --git a/anatomy/templates/anatomy/question_detail.html b/anatomy/templates/anatomy/question_detail.html index 2573decf..9fb171ce 100644 --- a/anatomy/templates/anatomy/question_detail.html +++ b/anatomy/templates/anatomy/question_detail.html @@ -50,6 +50,12 @@
{{ answer.answer }}
+ {% if answer.status == "0" %} +
+ + +
+ {% endif %} {{ answer.get_status_display|default:answer.status }} @@ -182,6 +188,98 @@ } + {% endblock %} {% block css %} diff --git a/anatomy/views.py b/anatomy/views.py index f5e8899e..3bc96761 100644 --- a/anatomy/views.py +++ b/anatomy/views.py @@ -1469,6 +1469,10 @@ def question_suggest_incorrect_answers(request, pk): existing.append(suggestion) question.answer_suggest_incorrect = existing question.save() + # If this is a quick add (from the answers table) return the collapsed partial + if request.POST.get("quick"): + return render(request, "anatomy/partials/suggest_incorrect_collapsed.html", {"question": question}) + # Recompute candidates and render the edit fragment form = SuggestIncorrectAnswerForm(instance=question) candidates = build_candidates(question)