Skip to content
Snippets Groups Projects
Commit 82f27f78 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt :koala:
Browse files

refactor: remove superfluous template wrapper

parent c1de29d6
No related branches found
No related tags found
No related merge requests found
......@@ -78,30 +78,28 @@
<div class="tw-flex tw-gap-6 tw-flex-wrap">
<FormGroup
v-slot="attrs"
:label="t('show.fields.logoId')"
:errors="logoId.errors"
:is-saving="logoId.isSaving"
class="tw-mb-0"
custom-control
>
<template #default="attrs">
<div>
<ImagePicker v-model="logoId.value" v-bind="attrs" />
</div>
</template>
<div>
<ImagePicker v-model="logoId.value" v-bind="attrs" />
</div>
</FormGroup>
<FormGroup
v-slot="attrs"
:label="t('show.fields.imageId')"
:errors="imageId.errors"
:is-saving="imageId.isSaving"
custom-control
>
<template #default="attrs">
<div>
<ImagePicker v-model="imageId.value" v-bind="attrs" />
</div>
</template>
<div>
<ImagePicker v-model="imageId.value" v-bind="attrs" />
</div>
</FormGroup>
</div>
</AFieldset>
......@@ -160,33 +158,31 @@
</FormGroup>
<FormGroup
v-slot="attrs"
:label="t('show.fields.typeId')"
:errors="type.errors"
:is-saving="type.isSaving"
>
<template #default="attrs">
<select v-model="type.valueId" v-bind="attrs">
<option
v-for="choice in type.choices"
:key="choice.id"
:value="choice.id"
:label="choice.name"
:disabled="!choice.isActive"
/>
</select>
</template>
<select v-model="type.valueId" v-bind="attrs">
<option
v-for="choice in type.choices"
:key="choice.id"
:value="choice.id"
:label="choice.name"
:disabled="!choice.isActive"
/>
</select>
</FormGroup>
</AFieldset>
<AFieldset class="tw-bg-white" :title="t('show.section.contact.title')">
<FormGroup
v-slot="attrs"
:label="t('show.fields.email')"
:errors="email.errors"
:is-saving="email.isSaving"
>
<template #default="attrs">
<input v-model="email.value" type="email" v-bind="attrs" @blur="email.save" />
</template>
<input v-model="email.value" type="email" v-bind="attrs" @blur="email.save" />
</FormGroup>
<FormGroup
......@@ -257,56 +253,53 @@
</FormGroup>
<FormGroup
v-slot="attrs"
:label="t('show.fields.cbaSeriesId')"
:errors="cbaSeriesId.errors"
:is-saving="cbaSeriesId.isSaving"
>
<template #default="attrs">
<input
v-model="cbaSeriesId.value"
type="text"
inputmode="numeric"
pattern="[0-9]+"
v-bind="attrs"
@blur="cbaSeriesId.save"
/>
</template>
<input
v-model="cbaSeriesId.value"
type="text"
inputmode="numeric"
pattern="[0-9]+"
v-bind="attrs"
@blur="cbaSeriesId.save"
/>
</FormGroup>
<FormGroup
v-slot="attrs"
:label="t('show.fields.predecessorId')"
:errors="predecessor.errors"
:is-saving="predecessor.isSaving"
>
<template #default="attrs">
<select v-model="predecessor.valueId" v-bind="attrs">
<option
v-for="choice in predecessor.choices"
:key="choice.id"
:value="choice.id"
:label="sanitizeHTML(choice.name)"
:disabled="!choice.isActive"
/>
</select>
</template>
<select v-model="predecessor.valueId" v-bind="attrs">
<option
v-for="choice in predecessor.choices"
:key="choice.id"
:value="choice.id"
:label="sanitizeHTML(choice.name)"
:disabled="!choice.isActive"
/>
</select>
</FormGroup>
<template v-if="authStore.isSuperuser">
<FormGroup
v-slot="attrs"
:label="t('show.fields.internalNote')"
:errors="internalNote.errors"
class="md:tw-col-span-2 tw-order-last"
:is-saving="internalNote.isSaving"
>
<template #default="attrs">
<textarea
ref="internalNoteEl"
v-model="internalNote.value"
class="tw-min-h-[100px]"
v-bind="attrs"
@blur="internalNote.save"
/>
</template>
<textarea
ref="internalNoteEl"
v-model="internalNote.value"
class="tw-min-h-[100px]"
v-bind="attrs"
@blur="internalNote.save"
/>
</FormGroup>
</template>
</AFieldset>
......
<template>
<FormTable class="tw-max-w-3xl">
<FormGroup :label="t('noteEditor.title')" :errors="title.errors" :is-saving="title.isSaving">
<template #default="attrs">
<input
v-model="title.value"
:placeholder="t('noteEditor.titlePlaceholder')"
required
v-bind="attrs"
@blur="title.save()"
/>
<p v-if="note.slug" class="tw-text-xs tw-text-gray-400 tw-mt-1 tw-mb-0">
{{ t('slug') }}: {{ note.slug }}
</p>
</template>
<FormGroup
v-slot="attrs"
:label="t('noteEditor.title')"
:errors="title.errors"
:is-saving="title.isSaving"
>
<input
v-model="title.value"
:placeholder="t('noteEditor.titlePlaceholder')"
required
v-bind="attrs"
@blur="title.save()"
/>
<p v-if="note.slug" class="tw-text-xs tw-text-gray-400 tw-mt-1 tw-mb-0">
{{ t('slug') }}: {{ note.slug }}
</p>
</FormGroup>
<FormGroup
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment