From bc21dd6ebdb9f853e4380589fb10a6ca1e7b8d2a Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 20 Oct 2025 13:53:08 +0100 Subject: [PATCH] Add ordering by created date to QuestionTable and update import preview layout for better readability --- sbas/tables.py | 1 + .../sbas/partials/import_preview.html | 51 ++++++++++--------- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/sbas/tables.py b/sbas/tables.py index 1427eeb8..3b925f16 100644 --- a/sbas/tables.py +++ b/sbas/tables.py @@ -46,6 +46,7 @@ class QuestionTable(tables.Table): ) sequence = ("view", "stem", "answers")#, "exams") attrs = {"class": "table row-selector"} + order_by = "-created_date" def __init__(self, data=None, *args, **kwargs): super().__init__( diff --git a/sbas/templates/sbas/partials/import_preview.html b/sbas/templates/sbas/partials/import_preview.html index 36185b86..3d11c3ba 100644 --- a/sbas/templates/sbas/partials/import_preview.html +++ b/sbas/templates/sbas/partials/import_preview.html @@ -32,19 +32,20 @@ {% endif %} -

-

Feedback: {{ item.payload.feedback|default:''|safe }}

-

Sources: - {% if item.payload.sources %} -

- {% else %} - None - {% endif %} -

+

Best Answer: {{ item.payload.best_answer|default:'' }} +

+

Feedback: {{ item.payload.feedback|default:''|safe }}

+

Sources: + {% if item.payload.sources %} +

+ {% else %} + None + {% endif %} +

{% endif %}

M2M fields (click to exclude)

Green = will be created/attached. Click a value to exclude it (grey).

@@ -141,23 +142,23 @@
Category: - {{ item.payload.category|default:'(none)' }} + {{ item.payload.category|default:'(none)' }} -
+ - +
+ +
-
- +
+ {% endfor %}