diff --git a/src/lib/tables.js b/src/lib/tables.js
index 3e6f8d6..e119562 100644
--- a/src/lib/tables.js
+++ b/src/lib/tables.js
@@ -276,9 +276,9 @@ export const TABLES = {
};
export const STATUS_COLORS = {
- published: 'bg-green-100 text-green-800',
+ published: 'bg-violet-100 text-violet-800',
blocked: 'bg-red-100 text-red-800',
- draft: 'bg-gray-100 text-gray-700',
+ draft: 'bg-gray-100 text-gray-600',
uploaded: 'bg-blue-100 text-blue-800',
requested: 'bg-yellow-100 text-yellow-800',
translated: 'bg-indigo-100 text-indigo-800',
diff --git a/src/pages/ContentCreation.jsx b/src/pages/ContentCreation.jsx
index c00f86b..eb36340 100644
--- a/src/pages/ContentCreation.jsx
+++ b/src/pages/ContentCreation.jsx
@@ -181,6 +181,27 @@ function WordTag({ word, onRemove }) {
// ─── PairForm ─────────────────────────────────────────────────────────────────
+// ─── Shared status helpers ────────────────────────────────────────────────────
+
+const LEVEL_LABELS = { 1: 'Leicht', 2: 'Mittel' };
+const LEVEL_COLORS = { 1: 'bg-sky-50 text-sky-700', 2: 'bg-amber-50 text-amber-700' };
+
+function StatusSelect({ value, options, onChange, saving, size = 'sm' }) {
+ const cls = STATUS_COLORS[value] || 'bg-gray-100 text-gray-600';
+ const pad = size === 'xs' ? 'px-1.5 py-0.5 text-[10px]' : 'px-2 py-1 text-xs';
+ return (
+
+ );
+}
+
const PAIR_TYPES = [
{ value: 'text', label: 'Text', hint: 'Nur positives Statement' },
{ value: 'yes_no', label: 'Ja / Nein', hint: 'Frage + Ja/Nein Antwort' },
@@ -448,6 +469,7 @@ function EditPairForm({ pair, allObjects, onSaved, onCancel, onDeleted }) {
const [loading, setLoading] = useState(true);
const [saving, setSaving] = useState(false);
const [type, setType] = useState(pair.answer_type || '');
+ const [pairStatus, setPairStatus] = useState(pair.status || 'draft');
const [question, setQuestion] = useState('');
const [positive, setPositive] = useState('');
const [negative, setNegative] = useState('');
@@ -597,6 +619,7 @@ function EditPairForm({ pair, allObjects, onSaved, onCancel, onDeleted }) {
patchPair.negative_statement_id = s.id;
}
if (pair.answer_type !== type) patchPair.answer_type = type;
+ if (pair.status !== pairStatus) patchPair.status = pairStatus;
if (Object.keys(patchPair).length) await apiPatch('/pairs', pair.id, patchPair);
onSaved();
} catch (e) { alert('Fehler: ' + e.message); }
@@ -609,6 +632,10 @@ function EditPairForm({ pair, allObjects, onSaved, onCancel, onDeleted }) {
return (
+
+
+
+
@@ -1090,10 +1120,15 @@ function PairsPanel({ selectedObject, allObjects, objectPairs, loadingPairs, onP
onDeleted={id => { setEditingId(null); onPairsReload(); }} />
) : (
-
-
#{i + 1}
+
+ #{i + 1}
{pair.status}
{pair.answer_type}
+ {pair.difficulty_level && (
+
+ {LEVEL_LABELS[pair.difficulty_level] || pair.difficulty_level}
+
+ )}
@@ -1378,6 +1413,21 @@ export default function ContentCreation() {
finally { setMarkingDone(false); }
}
+ async function handlePictureStatusChange(newStatus) {
+ if (!currentPicture) return;
+ try {
+ await apiPatch('/pictures', currentPicture.id, { status: newStatus });
+ setPictures(prev => prev.map((p, i) => i === pictureIndex ? { ...p, status: newStatus } : p));
+ } catch (e) { alert('Fehler: ' + e.message); }
+ }
+
+ async function handleObjectStatusChange(objectId, newStatus) {
+ try {
+ await apiPatch('/objects', objectId, { status: newStatus });
+ setObjects(prev => prev.map(o => o.id === objectId ? { ...o, status: newStatus } : o));
+ } catch (e) { alert('Fehler: ' + e.message); }
+ }
+
function reloadPairs() {
if (!selectedObjectId) return;
setLoadingPairs(true);
@@ -1412,8 +1462,13 @@ export default function ContentCreation() {
<>
{currentPicture.id?.slice(0, 8)}…
{currentPicture.design &&
{currentPicture.design}}
+
{currentPicture.objects_created && (
-
✓ Objekte erstellt
+
✓ Objekte
)}
>
)}
@@ -1435,6 +1490,7 @@ export default function ContentCreation() {
onAddObject={handleAddObject}
onSelectObject={handleSelectObject}
currentPicture={currentPicture}
+ onObjectStatusChange={handleObjectStatusChange}
/>