Elemente: Aufgabe/Lösung-Felder entfernt
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,7 @@ const query = ref('')
|
||||
const creating = ref(false)
|
||||
const selected = ref(null)
|
||||
const tab = ref('overview') // 'overview' | 'chat' | 'edit'
|
||||
const edit = ref({ title: '', description: '', examples: [], hints: [], aufgabe: '', loesung: '' })
|
||||
const edit = ref({ title: '', description: '', examples: [], hints: [] })
|
||||
const savingEdit = ref(false)
|
||||
|
||||
watch(() => props.topic, load, { immediate: true })
|
||||
@@ -93,8 +93,6 @@ function loadEdit() {
|
||||
description: selected.value.description,
|
||||
examples: [...selected.value.examples],
|
||||
hints: [...selected.value.hints],
|
||||
aufgabe: selected.value.aufgabe || '',
|
||||
loesung: selected.value.loesung || '',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,8 +110,6 @@ async function saveEdit() {
|
||||
description: edit.value.description,
|
||||
examples: edit.value.examples.filter((s) => s.trim()),
|
||||
hints: edit.value.hints.filter((s) => s.trim()),
|
||||
aufgabe: edit.value.aufgabe,
|
||||
loesung: edit.value.loesung,
|
||||
})
|
||||
selected.value = updated
|
||||
const idx = elements.value.findIndex((e) => e.id === updated.id)
|
||||
@@ -250,19 +246,17 @@ async function applyStyleChange(i) {
|
||||
const c = styleChanges.value[i]
|
||||
applyingStyle.value = true
|
||||
try {
|
||||
const STRING_TARGETS = ['title', 'description', 'aufgabe', 'loesung']
|
||||
const STRING_TARGETS = ['title', 'description']
|
||||
const fields = {
|
||||
title: selected.value.title,
|
||||
description: selected.value.description,
|
||||
examples: [...selected.value.examples],
|
||||
hints: [...selected.value.hints],
|
||||
aufgabe: selected.value.aufgabe || '',
|
||||
loesung: selected.value.loesung || '',
|
||||
}
|
||||
if (c.action === 'entfernen') fields[c.target].splice(c.index, 1)
|
||||
else if (c.action === 'hinzufuegen') {
|
||||
if (c.target === 'title') fields.title = c.content
|
||||
else if (c.target === 'description' || c.target === 'aufgabe' || c.target === 'loesung')
|
||||
else if (c.target === 'description')
|
||||
fields[c.target] = fields[c.target] ? fields[c.target] + '\n\n' + c.content : c.content
|
||||
else fields[c.target].push(c.content)
|
||||
} else if (STRING_TARGETS.includes(c.target)) fields[c.target] = c.content
|
||||
@@ -448,25 +442,6 @@ async function send() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div v-if="selected.aufgabe || styleAt('aufgabe').length || styleAdds('aufgabe').length" class="el-task-block">
|
||||
<h4>Aufgabe</h4>
|
||||
<div v-if="selected.aufgabe" class="el-entry markdown" v-html="renderMarkdown(selected.aufgabe)"></div>
|
||||
<ElementSuggestion
|
||||
v-for="[ci, c] in [...styleAt('aufgabe'), ...styleAdds('aufgabe')]"
|
||||
:key="'sga' + ci" :change="c" :busy="suggBusy(ci)"
|
||||
@apply="applyStyleChange(ci)" @dismiss="dismissStyleChange(ci)" @refine="(t) => refineChange(ci, t)"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="selected.loesung || styleAt('loesung').length || styleAdds('loesung').length" class="el-task-block">
|
||||
<h4>Lösung</h4>
|
||||
<div v-if="selected.loesung" class="el-entry markdown" v-html="renderMarkdown(selected.loesung)"></div>
|
||||
<ElementSuggestion
|
||||
v-for="[ci, c] in [...styleAt('loesung'), ...styleAdds('loesung')]"
|
||||
:key="'sgl' + ci" :change="c" :busy="suggBusy(ci)"
|
||||
@apply="applyStyleChange(ci)" @dismiss="dismissStyleChange(ci)" @refine="(t) => refineChange(ci, t)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div v-if="checking || styling || statusMsg" class="el-check">
|
||||
<p v-if="checking" class="check-empty busy-text">Prüft auf fehlende Infos…</p>
|
||||
<p v-if="styling" class="check-empty busy-text">Prüft den Stil…</p>
|
||||
@@ -522,12 +497,6 @@ async function send() {
|
||||
<button class="edit-del" title="Entfernen" @click="edit.hints.splice(i, 1)">×</button>
|
||||
</div>
|
||||
<button class="edit-add" @click="edit.hints.push('')">+ Hinweis</button>
|
||||
|
||||
<label>Aufgabenstellung</label>
|
||||
<textarea v-model="edit.aufgabe" placeholder="Aufgabenstellung"></textarea>
|
||||
|
||||
<label>Aufgabenlösung</label>
|
||||
<textarea v-model="edit.loesung" placeholder="Aufgabenlösung"></textarea>
|
||||
</div>
|
||||
</template>
|
||||
</aside>
|
||||
@@ -786,13 +755,11 @@ async function send() {
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.el-hints-block,
|
||||
.el-task-block {
|
||||
.el-hints-block {
|
||||
margin-top: 0.9rem;
|
||||
}
|
||||
|
||||
.el-hints-block h4,
|
||||
.el-task-block h4 {
|
||||
.el-hints-block h4 {
|
||||
margin: 0 0 0.35rem;
|
||||
font-size: 0.72rem;
|
||||
font-weight: 700;
|
||||
|
||||
Reference in New Issue
Block a user