Support oft parent groups
This commit is contained in:
@@ -11,6 +11,9 @@ const props = defineProps({
|
||||
})
|
||||
const emit = defineEmits(['next'])
|
||||
|
||||
// Bezeichnung der Auswahl (z. B. „Stamm" oder „Bund"), je nach Einstellung der Veranstaltung.
|
||||
const localGroupLabel = props.event?.participantGroupLabel ?? 'Stamm'
|
||||
|
||||
const errors = reactive({
|
||||
vorname: '',
|
||||
nachname: '',
|
||||
@@ -46,7 +49,7 @@ const next = () => {
|
||||
}
|
||||
|
||||
if (props.needsLocalGroup && (!props.formData.localGroup || props.formData.localGroup === '-1')) {
|
||||
errors.localGroup = 'Bitte einen Stamm auswählen.'
|
||||
errors.localGroup = 'Bitte bei „' + localGroupLabel + '" eine Auswahl treffen.'
|
||||
hasError = true
|
||||
}
|
||||
|
||||
@@ -122,7 +125,7 @@ const next = () => {
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="needsLocalGroup">
|
||||
<td>Stamm:</td>
|
||||
<td>{{ localGroupLabel }}:</td>
|
||||
<td>
|
||||
<select v-model="formData.localGroup">
|
||||
<option value="-1">Bitte wählen</option>
|
||||
|
||||
@@ -43,9 +43,9 @@ const selectedParticipationOptions = computed(() =>
|
||||
}).filter(entry => entry.value !== '')
|
||||
)
|
||||
|
||||
// Der Stamm steht entweder fest (genau ein teilnehmender Stamm) oder wurde auf Seite 1 gewählt.
|
||||
// Die Gruppe (Stamm oder Bund) steht entweder fest (genau eine Option) oder wurde auf Seite 1 gewählt.
|
||||
const localGroupName = computed(() =>
|
||||
(props.event.contributingLocalGroups ?? []).find(g => g.id === props.formData.localGroup)?.name ?? null
|
||||
(props.event.participantGroupOptions ?? []).find(g => g.id === props.formData.localGroup)?.name ?? null
|
||||
)
|
||||
|
||||
const permissionName = (list, slug) =>
|
||||
@@ -84,7 +84,7 @@ const canSubmit = computed(() =>
|
||||
<td>{{ formData.telefon_1 }}</td>
|
||||
</tr>
|
||||
<tr v-if="localGroupName">
|
||||
<td>Stamm:</td>
|
||||
<td>{{ event.participantGroupLabel ?? 'Stamm' }}:</td>
|
||||
<td>{{ localGroupName }}</td>
|
||||
</tr>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user