From 432ffbcdb93a2dcba7721492106bcb35f3ae5d13 Mon Sep 17 00:00:00 2001 From: dwindown Date: Tue, 28 Apr 2026 22:15:11 +0700 Subject: [PATCH] Add inline full-content review panel for child variants before approval --- app/admin_web.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/app/admin_web.py b/app/admin_web.py index c3ef9cc..96e746d 100644 --- a/app/admin_web.py +++ b/app/admin_web.py @@ -663,6 +663,26 @@ def _basis_item_workspace_body( variant_rows = [] for item in variants: usage = usage_by_item.get(item.id, {"impressions": 0.0, "unique_users": 0.0, "frequency": 0.0}) + options = item.options if isinstance(item.options, dict) else {} + options_rows = "".join( + f"{escape(str(key))}" + f"{escape(str(value))}" + for key, value in options.items() + ) or "No options" + review_html = ( + "
" + "Review full content" + f"
" + f"

Full Stem
{escape(_html_to_text(item.stem))}

" + "" + "" + f"{options_rows}" + "
OptionText
" + f"

Correct Answer: {escape(item.correct_answer or '-')}

" + f"

Explanation: {escape(_html_to_text(item.explanation) or '-')}

" + "
" + "
" + ) variant_rows.append( "" f"" @@ -674,7 +694,7 @@ def _basis_item_workspace_body( f"{int(usage['impressions'])}" f"{int(usage['unique_users'])}" f"{usage['frequency']:.2f}" - f"{escape(_truncate(item.stem, 130))}" + f"{escape(_truncate(_html_to_text(item.stem), 130))}{review_html}" f"{escape(str(item.created_at))}" "" )