diff --git a/aleksis/apps/paweljong/frontend/components/event_registration/EventRegistrationForm.vue b/aleksis/apps/paweljong/frontend/components/event_registration/EventRegistrationForm.vue index febebeb3761cbfa8cfc9bc796e1d06d7b2db00f9..10140973028279434ac263f75783e499a275e85e 100644 --- a/aleksis/apps/paweljong/frontend/components/event_registration/EventRegistrationForm.vue +++ b/aleksis/apps/paweljong/frontend/components/event_registration/EventRegistrationForm.vue @@ -32,585 +32,602 @@ import SecondaryActionButton from "aleksis.core/components/generic/buttons/Secon <v-divider v-if="index + 1 < steps.length" ></v-divider> </template> </v-stepper-header> - <v-stepper-items> - <v-stepper-content v-if="isStepEnabled('email')" :step="getStepIndex('email')"> - <h2 class="text-h6 mb-4">{{ $t(getStepTitleKey('email')) }}</h2> - <div class="mb-4"> - <v-form v-if="emailMode" v-model="validationStatuses['email']"> - <v-row v-if="emailMode == 'postbuero'"> - <v-col> - <div aria-required="true"> - <v-text-field - outlined - v-model="data.email.localPart" - :label="$t('postbuero.mail_addresses.data_table.local_part')" - :rules="$rules().required.build(rules.emailLocalPart)" - required - ></v-text-field> - </div> - </v-col> - <v-col> - <div aria-required="true"> - <v-autocomplete - outlined - hide-no-data - :items="mailDomains" - item-text="domain" - item-value="id" - :loading="$apollo.queries.mailDomains.loading" - prepend-icon="mdi-at" - v-model="data.email.domain" - :label="$t('postbuero.mail_addresses.data_table.domain')" - required - :rules="$rules().required.build()" - /> - </div> - </v-col> - </v-row> - <v-row v-else-if="emailMode == 'own'"> - <v-col> - <div aria-required="true"> - <v-text-field - outlined - v-model="data.user.email" - :label="$t('paweljong.event_registration.form.steps.email.fields.email.label')" - required - :rules="$rules().required.build(rules.email)" - prepend-icon="mdi-email-outline" - ></v-text-field> - </div> - </v-col> - <v-col> - <div aria-required="true"> - <v-text-field - outlined - v-model="data.user.confirmEmail" - :label="$t('paweljong.event_registration.form.steps.email.fields.confirm_email.label')" - required - :rules="$rules().required.build(rules.confirmEmail)" - prepend-icon="mdi-email-outline" - ></v-text-field> - </div> - </v-col> - </v-row> - <v-card-actions> + <v-stepper-items> + <v-stepper-content v-if="isStepEnabled('email')" :step="getStepIndex('email')"> + <h2 class="text-h6 mb-4">{{ $t(getStepTitleKey('email')) }}</h2> + <div class="mb-4"> + <v-form v-if="emailMode" v-model="validationStatuses['email']"> + <v-row v-if="emailMode == 'postbuero'"> + <v-col> + <div aria-required="true"> + <v-text-field + outlined + v-model="data.email.localPart" + :label="$t('postbuero.mail_addresses.data_table.local_part')" + :rules="$rules().required.build(rules.emailLocalPart)" + required + ></v-text-field> + </div> + </v-col> + <v-col> + <div aria-required="true"> + <v-autocomplete + outlined + hide-no-data + :items="mailDomains" + item-text="domain" + item-value="id" + :loading="$apollo.queries.mailDomains.loading" + prepend-icon="mdi-at" + v-model="data.email.domain" + :label="$t('postbuero.mail_addresses.data_table.domain')" + required + :rules="$rules().required.build()" + /> + </div> + </v-col> + </v-row> + <v-row v-else-if="emailMode == 'own'"> + <v-col> + <div aria-required="true"> + <v-text-field + outlined + v-model="data.user.email" + :label="$t('paweljong.event_registration.form.steps.email.fields.email.label')" + required + :rules="$rules().required.build(rules.email)" + prepend-icon="mdi-email-outline" + ></v-text-field> + </div> + </v-col> + <v-col> + <div aria-required="true"> + <v-text-field + outlined + v-model="data.user.confirmEmail" + :label="$t('paweljong.event_registration.form.steps.email.fields.confirm_email.label')" + required + :rules="$rules().required.build(rules.confirmEmail)" + prepend-icon="mdi-email-outline" + ></v-text-field> + </div> + </v-col> + </v-row> + <v-card-actions> + <v-row> + <v-col> + <secondary-action-button + @click="emailMode = null" + i18n-key="paweljong.event_registration.form.steps.email.choose_mode.back" + /> + </v-col> + <v-spacer /> + </v-row> + </v-card-actions> + </v-form> + <template v-else> + <v-card-text> + {{ $t("paweljong.event_registration.form.steps.email.choose_mode.help_text") }} + </v-card-text> + <v-card-actions> + <v-row justify="end"> + <v-col> + <primary-action-button + @click="emailMode = 'postbuero'" + i18n-key="paweljong.event_registration.form.steps.email.choose_mode.continue_aleksis" + /> + </v-col> + <v-col> + <primary-action-button + @click="emailMode = 'own'" + i18n-key="paweljong.event_registration.form.steps.email.choose_mode.continue_own" + /> + </v-col> + </v-row> + </v-card-actions> + </template> + </div> + <v-divider class="mb-4" /> + <control-row + :step="step" + @set-step="setStep" + :next-disabled="!validationStatuses['email']" + /> + </v-stepper-content> + + <v-stepper-content v-if="isStepEnabled('register')" :step="getStepIndex('register')"> + <h2 class="text-h6 mb-4">{{ $t(getStepTitleKey("register")) }}</h2> + <div class="mb-4"> + <v-form v-model="validationStatuses['register']"> <v-row> <v-col> - <secondary-action-button - @click="emailMode = null" - i18n-key="paweljong.event_registration.form.steps.email.choose_mode.back" - /> + <div aria-required="true"> + <v-text-field + outlined + v-model="data.person.firstName" + :label="$t('paweljong.event_registration.form.steps.register.fields.first_name.label')" + required + :rules="$rules().required.build()" + ></v-text-field> + </div> + </v-col> + <v-col> + <div aria-required="true"> + <v-text-field + outlined + v-model="data.person.lastName" + :label="$t('paweljong.event_registration.form.steps.register.fields.last_name.label')" + required + :rules="$rules().required.build()" + ></v-text-field> + </div> </v-col> - <v-spacer /> </v-row> - </v-card-actions> - </v-form> - <template v-else> - <v-card-text> - {{ $t("paweljong.event_registration.form.steps.email.choose_mode.help_text") }} - </v-card-text> - <v-card-actions> <v-row> - <v-spacer /> <v-col> - <primary-action-button - @click="emailMode = 'postbuero'" - i18n-key="paweljong.event_registration.form.steps.email.choose_mode.continue_aleksis" - /> + <div aria-required="true"> + <v-text-field + outlined + v-model="data.user.username" + :label="$t('paweljong.event_registration.form.steps.register.fields.username.label')" + required + :rules="$rules().required.build()" + prepend-icon="mdi-account-outline" + ></v-text-field> + </div> + </v-col> + <v-col> + <div aria-required="true"> + <v-text-field + outlined + v-model="data.user.password" + :label="$t('paweljong.event_registration.form.steps.register.fields.password.label')" + required + :rules="$rules().required.build()" + type="password" + prepend-icon="mdi-form-textbox-password" + ></v-text-field> + </div> </v-col> <v-col> - <primary-action-button - @click="emailMode = 'own'" - i18n-key="paweljong.event_registration.form.steps.email.choose_mode.continue_own" - /> + <div aria-required="true"> + <v-text-field + outlined + v-model="data.user.confirmPassword" + :label="$t('paweljong.event_registration.form.steps.register.fields.confirm_password.label')" + required + :rules="$rules().required.build(rules.confirmPassword)" + type="password" + prepend-icon="mdi-form-textbox-password" + ></v-text-field> + </div> </v-col> </v-row> - </v-card-actions> - </template> - </div> - <v-divider class="mb-4" /> - <control-row - :step="step" - @set-step="setStep" - :next-disabled="!validationStatuses['email']" - /> - </v-stepper-content> + </v-form> + </div> + <v-divider class="mb-4" /> + <control-row + :step="step" + @set-step="setStep" + :next-disabled="!validationStatuses['register']" + /> + </v-stepper-content> - <v-stepper-content v-if="isStepEnabled('register')" :step="getStepIndex('register')"> - <h2 class="text-h6 mb-4">{{ $t(getStepTitleKey("register")) }}</h2> - <div class="mb-4"> - <v-form v-model="validationStatuses['register']"> - <v-row> - <v-col> - <div aria-required="true"> - <v-text-field - outlined - v-model="data.person.firstName" - :label="$t('paweljong.event_registration.form.steps.register.fields.first_name.label')" - required - :rules="$rules().required.build()" - ></v-text-field> - </div> - </v-col> - <v-col> - <div aria-required="true"> - <v-text-field - outlined - v-model="data.person.lastName" - :label="$t('paweljong.event_registration.form.steps.register.fields.last_name.label')" - required - :rules="$rules().required.build()" - ></v-text-field> - </div> - </v-col> - </v-row> - <v-row> - <v-col> - <div aria-required="true"> - <v-text-field - outlined - v-model="data.user.username" - :label="$t('paweljong.event_registration.form.steps.register.fields.username.label')" - required - :rules="$rules().required.build()" - prepend-icon="mdi-account-outline" - ></v-text-field> - </div> - </v-col> - <v-col> - <div aria-required="true"> + <v-stepper-content v-if="isStepEnabled('contact_details')" :step="getStepIndex('contact_details')"> + <h2 class="text-h6 mb-4">{{ $t(getStepTitleKey('contact_details')) }}</h2> + <div class="mb-4"> + <v-form v-model="validationStatuses['contact_details']"> + <v-row> + <v-col v-if="isFieldVisible('date_of_birth')"> + <div aria-required="true"> + <date-field + outlined + v-model="data.person.dateOfBirth" + :label="$t('paweljong.event_registration.form.steps.contact_details.fields.date_of_birth.label')" + required + :rules="$rules().required.build()" + prepend-icon="mdi-cake-variant-outline" + /> + </div> + </v-col> + <v-col v-if="isFieldVisible('sex')"> + <div aria-required="true"> + <!-- FIXME: Prefilling data does not work due to upper-/lowercase situation; will be fixed with core person form refactoring --> + <sex-select + outlined + v-model="data.person.sex" + :label="$t('paweljong.event_registration.form.steps.contact_details.fields.sex.label')" + :hint="$t('paweljong.event_registration.form.steps.contact_details.fields.sex.help_text')" + persistent-hint + required + :rules="$rules().required.build()" + /> + </div> + </v-col> + <v-col v-if="isFieldVisible('mobile_number')"> <v-text-field outlined - v-model="data.user.password" - :label="$t('paweljong.event_registration.form.steps.register.fields.password.label')" - required - :rules="$rules().required.build()" - type="password" - prepend-icon="mdi-form-textbox-password" + v-model="data.person.mobileNumber" + :label="$t('paweljong.event_registration.form.steps.contact_details.fields.mobile_number.label')" + prepend-icon="mdi-phone-outline" ></v-text-field> - </div> - </v-col> + </v-col> + </v-row> + <v-row> + <v-col v-if="isFieldVisible('street')"> + <div aria-required="true"> + <v-text-field + outlined + v-model="data.person.address.street" + :label="$t('paweljong.event_registration.form.steps.contact_details.fields.street.label')" + required + :rules="$rules().required.build()" + ></v-text-field> + </div> + </v-col> + <v-col v-if="isFieldVisible('housenumber')"> + <div aria-required="true"> + <v-text-field + outlined + v-model="data.person.address.housenumber" + :label="$t('paweljong.event_registration.form.steps.contact_details.fields.housenumber.label')" + required + :rules="$rules().required.build()" + ></v-text-field> + </div> + </v-col> + </v-row> + <v-row> + <v-col v-if="isFieldVisible('postal_code')"> + <div aria-required="true"> + <v-text-field + outlined + v-model="data.person.address.postalCode" + :label="$t('paweljong.event_registration.form.steps.contact_details.fields.postal_code.label')" + required + :rules="$rules().required.build()" + ></v-text-field> + </div> + </v-col> + <v-col v-if="isFieldVisible('place')"> + <div aria-required="true"> + <v-text-field + outlined + v-model="data.person.address.place" + :label="$t('paweljong.event_registration.form.steps.contact_details.fields.place.label')" + required + :rules="$rules().required.build()" + ></v-text-field> + </div> + </v-col> + </v-row> + <v-row v-if="isFieldVisible('school_details')"> + <v-col> + <div aria-required="true"> + <v-text-field + outlined + v-model="data.school" + :label="$t('paweljong.event_registration.form.steps.contact_details.fields.school.label')" + :hint="$t('paweljong.event_registration.form.steps.contact_details.fields.school.help_text')" + required + :rules="$rules().required.build()" + ></v-text-field> + </div> + </v-col> + <v-col> + <div aria-required="true"> + <v-text-field + outlined + v-model="data.schoolPlace" + :label="$t('paweljong.event_registration.form.steps.contact_details.fields.school_place.label')" + :hint="$t('paweljong.event_registration.form.steps.contact_details.fields.school_place.help_text')" + required + :rules="$rules().required.build()" + ></v-text-field> + </div> + </v-col> + <v-col> + <div aria-required="true"> + <v-text-field + outlined + v-model="data.schoolClass" + :label="$t('paweljong.event_registration.form.steps.contact_details.fields.school_class.label')" + :hint="$t('paweljong.event_registration.form.steps.contact_details.fields.school_class.help_text')" + required + :rules="$rules().required.build()" + ></v-text-field> + </div> + </v-col> + </v-row> + </v-form> + </div> + <v-divider class="mb-4" /> + <control-row + :step="step" + @set-step="setStep" + :next-disabled="!validationStatuses['contact_details']" + /> + </v-stepper-content> + + <v-stepper-content :step="getStepIndex('guardians')"> + <h2 class="text-h6 mb-4">{{ $t(getStepTitleKey('guardians')) }}</h2> + <div class="mb-4"> + <v-form v-model="validationStatuses['guardians']"> + <v-card v-for="(guardian, index) in data.person.guardians" :key="index" class="mb-4"> + <v-card-title> + {{ $tc("paweljong.event_registration.form.steps.guardians.counter", { i: index+1 }) }} + </v-card-title> + <v-card-text> + <v-row> + <v-col> + <div :aria-required="index === 0 ? 'true' : 'false'"> + <v-text-field + outlined + v-model="guardian.firstName" + :label="$t('paweljong.event_registration.form.steps.guardians.fields.first_name.label')" + :hint="$t('paweljong.event_registration.form.steps.guardians.fields.first_name.help_text')" + required + :rules="index === 0 ? $rules().required.build() : []" + ></v-text-field> + </div> + </v-col> + <v-col> + <div :aria-required="index === 0 ? 'true' : 'false'"> + <v-text-field + outlined + v-model="guardian.lastName" + :label="$t('paweljong.event_registration.form.steps.guardians.fields.last_name.label')" + :hint="$t('paweljong.event_registration.form.steps.guardians.fields.last_name.help_text')" + required + :rules="index === 0 ? $rules().required.build() : []" + ></v-text-field> + </div> + </v-col> + </v-row> + <v-row> + <v-col> + <div :aria-required="index === 0 ? 'true' : 'false'"> + <v-text-field + outlined + v-model="guardian.email" + :label="$t('paweljong.event_registration.form.steps.guardians.fields.email.label')" + required + :rules="index === 0 ? $rules().required.build(rules.email) : []" + ></v-text-field> + </div> + </v-col> + <v-col> + <div :aria-required="index === 0 ? 'true' : 'false'"> + <v-text-field + outlined + v-model="guardian.mobileNumber" + :label="$t('paweljong.event_registration.form.steps.guardians.fields.mobile_number.label')" + :hint="$t('paweljong.event_registration.form.steps.guardians.fields.mobile_number.help_text')" + required + :rules="index === 0 ? $rules().required.build() : []" + ></v-text-field> + </div> + </v-col> + </v-row> + </v-card-text> + </v-card> + </v-form> + <v-row class="mb-4"> <v-col> - <div aria-required="true"> - <v-text-field - outlined - v-model="data.user.confirmPassword" - :label="$t('paweljong.event_registration.form.steps.register.fields.confirm_password.label')" - required - :rules="$rules().required.build(rules.confirmPassword)" - type="password" - prepend-icon="mdi-form-textbox-password" - ></v-text-field> - </div> + <v-spacer /> + <secondary-action-button + @click="addGuardian" + i18n-key="paweljong.event_registration.form.steps.guardians.add" + > + </secondary-action-button> </v-col> </v-row> - </v-form> - </div> - <v-divider class="mb-4" /> - <control-row - :step="step" - @set-step="setStep" - :next-disabled="!validationStatuses['register']" - /> - </v-stepper-content> + </div> + <v-divider class="mb-4" /> + <control-row + :step="step" + @set-step="setStep" + :next-disabled="!validationStatuses['guardians']" + /> + </v-stepper-content> - <v-stepper-content v-if="isStepEnabled('contact_details')" :step="getStepIndex('contact_details')"> - <h2 class="text-h6 mb-4">{{ $t(getStepTitleKey('contact_details')) }}</h2> - <div class="mb-4"> - <v-form v-model="validationStatuses['contact_details']"> - <v-row> - <v-col v-if="isFieldVisible('date_of_birth')"> - <div aria-required="true"> - <date-field - outlined - v-model="data.person.dateOfBirth" - :label="$t('paweljong.event_registration.form.steps.contact_details.fields.date_of_birth.label')" - required - :rules="$rules().required.build()" - prepend-icon="mdi-cake-variant-outline" - /> - </div> - </v-col> - <v-col v-if="isFieldVisible('sex')"> - <div aria-required="true"> - <!-- FIXME: Prefilling data does not work due to upper-/lowercase situation; will be fixed with core person form refactoring --> - <sex-select - outlined - v-model="data.person.sex" - :label="$t('paweljong.event_registration.form.steps.contact_details.fields.sex.label')" - :hint="$t('paweljong.event_registration.form.steps.contact_details.fields.sex.help_text')" - persistent-hint - required - :rules="$rules().required.build()" - /> - </div> - </v-col> - <v-col v-if="isFieldVisible('mobile_number')"> - <v-text-field - outlined - v-model="data.person.mobileNumber" - :label="$t('paweljong.event_registration.form.steps.contact_details.fields.mobile_number.label')" - prepend-icon="mdi-phone-outline" - ></v-text-field> - </v-col> - </v-row> - <v-row> - <v-col v-if="isFieldVisible('street')"> - <div aria-required="true"> - <v-text-field - outlined - v-model="data.person.address.street" - :label="$t('paweljong.event_registration.form.steps.contact_details.fields.street.label')" - required - :rules="$rules().required.build()" - ></v-text-field> - </div> - </v-col> - <v-col v-if="isFieldVisible('housenumber')"> - <div aria-required="true"> - <v-text-field - outlined - v-model="data.person.address.housenumber" - :label="$t('paweljong.event_registration.form.steps.contact_details.fields.housenumber.label')" - required - :rules="$rules().required.build()" - ></v-text-field> - </div> - </v-col> - </v-row> - <v-row> - <v-col v-if="isFieldVisible('postal_code')"> - <div aria-required="true"> - <v-text-field - outlined - v-model="data.person.address.postalCode" - :label="$t('paweljong.event_registration.form.steps.contact_details.fields.postal_code.label')" - required - :rules="$rules().required.build()" - ></v-text-field> - </div> - </v-col> - <v-col v-if="isFieldVisible('place')"> - <div aria-required="true"> - <v-text-field - outlined - v-model="data.person.address.place" - :label="$t('paweljong.event_registration.form.steps.contact_details.fields.place.label')" - required - :rules="$rules().required.build()" - ></v-text-field> - </div> - </v-col> - </v-row> - <v-row v-if="isFieldVisible('school_details')"> - <v-col> - <div aria-required="true"> - <v-text-field - outlined - v-model="data.school" - :label="$t('paweljong.event_registration.form.steps.contact_details.fields.school.label')" - :hint="$t('paweljong.event_registration.form.steps.contact_details.fields.school.help_text')" - required - :rules="$rules().required.build()" - ></v-text-field> - </div> - </v-col> - <v-col> - <div aria-required="true"> - <v-text-field - outlined - v-model="data.schoolPlace" - :label="$t('paweljong.event_registration.form.steps.contact_details.fields.school_place.label')" - :hint="$t('paweljong.event_registration.form.steps.contact_details.fields.school_place.help_text')" - required - :rules="$rules().required.build()" - ></v-text-field> - </div> - </v-col> - <v-col> - <div aria-required="true"> + <v-stepper-content :step="getStepIndex('additional')"> + <h2 class="text-h6 mb-4">{{ $t(getStepTitleKey('additional')) }}</h2> + <div class="mb-4"> + <v-form v-model="validationStatuses['additional']"> + <v-row> + <v-col> <v-text-field outlined - v-model="data.schoolClass" - :label="$t('paweljong.event_registration.form.steps.contact_details.fields.school_class.label')" - :hint="$t('paweljong.event_registration.form.steps.contact_details.fields.school_class.help_text')" - required - :rules="$rules().required.build()" + v-model="data.medicalInformation" + :label="$t('paweljong.event_registration.form.steps.additional.fields.medical_information.label')" + :hint="$t('paweljong.event_registration.form.steps.additional.fields.medical_information.help_text')" ></v-text-field> - </div> - </v-col> - </v-row> - </v-form> - </div> - <v-divider class="mb-4" /> - <control-row - :step="step" - @set-step="setStep" - :next-disabled="!validationStatuses['contact_details']" - /> - </v-stepper-content> + </v-col> + </v-row> + <v-row v-for="additionalField in event.additionalFields" :key="`additional-field-${additionalField.id}`"> + <v-col> + <div :aria-required="additionalField.required ? 'true' : 'false'"> + <component + :is="fieldComponentForAdditionalField(additionalField)" + v-model="data.additionalFields[additionalField.id]" + outlined + :label="additionalField.title" + :hint="additionalField.helpText" + persistent-hint + :required="additionalField.required" + :rules="additionalField.required ? $rules().required.build() : []" + /> + </div> + </v-col> + </v-row> + </v-form> + </div> + <v-divider class="mb-4" /> + <control-row + :step="step" + @set-step="setStep" + :next-disabled="!validationStatuses['additional']" + /> + </v-stepper-content> - <v-stepper-content :step="getStepIndex('guardians')"> - <h2 class="text-h6 mb-4">{{ $t(getStepTitleKey('guardians')) }}</h2> - <div class="mb-4"> - <v-form v-model="validationStatuses['guardians']"> - <v-card v-for="(guardian, index) in data.person.guardians" :key="index" class="mb-4"> + <v-stepper-content v-if="isStepEnabled('financial')" :step="getStepIndex('financial')"> + <h2 class="text-h6 mb-4">{{ $t(getStepTitleKey('financial')) }}</h2> + <div class="mb-4"> + <message-box type="info" class="mb-4"> + {{ $t("paweljong.event_registration.form.steps.financial.help_text.cost_info") }} + </message-box> + <v-simple-table class="mb-4"> + <template v-slot:default> + <tbody> + <tr> + <td>{{ $t("paweljong.event_registration.form.steps.financial.help_text.min_cost") }}</td> + <td>{{ `${event.minCost} €` }}</td> + </tr> + <tr> + <td>{{ $t("paweljong.event_registration.form.steps.financial.help_text.cost") }}</td> + <td>{{ `${event.cost} €` }}</td> + </tr> + <tr v-if="event.maxCost"> + <td>{{ $t("paweljong.event_registration.form.steps.financial.help_text.max_cost") }}</td> + <td>{{ `${event.maxCost} €` }}</td> + </tr> + </tbody> + </template> + </v-simple-table> + <v-form v-model="validationStatuses['financial']"> + <v-row> + <v-col> + <div aria-required="true"> + <v-select + :items="paweljongPaymentChoices" + item-text="text" + item-value="variant" + outlined + v-model="data.payment.paymentMethod" + :label="$t('paweljong.event_registration.form.steps.financial.fields.payment_method.label')" + :hint="$t('paweljong.event_registration.form.steps.financial.fields.payment_method.help_text')" + persistent-hint + required + :disabled="data.payment.amount === 0" + :rules="data.payment.amount === 0 ? [] : $rules().required.build()" + ></v-select> + </div> + </v-col> + <v-col> + <div aria-required="true"> + <positive-small-integer-field + outlined + v-model="data.payment.amount" + :label="$t('paweljong.event_registration.form.steps.financial.fields.amount.label')" + :rules="$rules().build(rules.amount)" + /> + </div> + </v-col> + </v-row> + </v-form> + </div> + <v-divider class="mb-4" /> + <control-row + :step="step" + @set-step="setStep" + :next-disabled="!validationStatuses['financial']" + /> + </v-stepper-content> + + <v-stepper-content :step="getStepIndex('consent')"> + <h2 class="text-h6 mb-4">{{ $t(getStepTitleKey('consent')) }}</h2> + <div class="mb-4"> + <v-card v-for="term in event.terms" :key="`term-card-${term.id}`"> <v-card-title> - {{ $tc("paweljong.event_registration.form.steps.guardians.counter", { i: index+1 }) }} + {{ term.title }} </v-card-title> - <v-card-text> - <v-row> - <v-col> - <div :aria-required="index === 0 ? 'true' : 'false'"> - <v-text-field - outlined - v-model="guardian.firstName" - :label="$t('paweljong.event_registration.form.steps.guardians.fields.first_name.label')" - :hint="$t('paweljong.event_registration.form.steps.guardians.fields.first_name.help_text')" - required - :rules="index === 0 ? $rules().required.build() : []" - ></v-text-field> - </div> - </v-col> - <v-col> - <div :aria-required="index === 0 ? 'true' : 'false'"> - <v-text-field - outlined - v-model="guardian.lastName" - :label="$t('paweljong.event_registration.form.steps.guardians.fields.last_name.label')" - :hint="$t('paweljong.event_registration.form.steps.guardians.fields.last_name.help_text')" - required - :rules="index === 0 ? $rules().required.build() : []" - ></v-text-field> - </div> - </v-col> - </v-row> - <v-row> - <v-col> - <div :aria-required="index === 0 ? 'true' : 'false'"> - <v-text-field - outlined - v-model="guardian.email" - :label="$t('paweljong.event_registration.form.steps.guardians.fields.email.label')" - required - :rules="index === 0 ? $rules().required.build(rules.email) : []" - ></v-text-field> - </div> - </v-col> - <v-col> - <div :aria-required="index === 0 ? 'true' : 'false'"> - <v-text-field - outlined - v-model="guardian.mobileNumber" - :label="$t('paweljong.event_registration.form.steps.guardians.fields.mobile_number.label')" - :hint="$t('paweljong.event_registration.form.steps.guardians.fields.mobile_number.help_text')" - required - :rules="index === 0 ? $rules().required.build() : []" - ></v-text-field> - </div> - </v-col> - </v-row> - </v-card-text> + <v-card-text v-html="term.term" /> </v-card> - </v-form> - <v-row class="mb-4"> - <v-col> - <v-spacer /> - <secondary-action-button - @click="addGuardian" - i18n-key="paweljong.event_registration.form.steps.guardians.add" - > - </secondary-action-button> - </v-col> - </v-row> - </div> - <v-divider class="mb-4" /> - <control-row - :step="step" - @set-step="setStep" - :next-disabled="!validationStatuses['guardians']" - /> - </v-stepper-content> + <v-form v-model="validationStatuses['consent']"> + <div v-for="term in event.terms" :key="`term-checkbox-${term.id}`" aria-required="true"> + <v-checkbox + required + :rules="$rules().required.build()" + :label="term.confirmationText" + v-model="data.terms[term.id]" + /> + </div> + <div aria-required="true"> + <v-checkbox + v-if="event.dateRetraction" + required + :rules="$rules().required.build()" + :label="$tc('paweljong.event_registration.form.steps.consent.fields.retraction_consent.label', { date: $d($parseISODate(event.dateRetraction, 'short')) })" + v-model="data.retractionConsent" + /> + </div> + </v-form> + </div> + <v-divider class="mb-4" /> + <control-row + :step="step" + @set-step="setStep" + :next-disabled="!validationStatuses['consent']" + /> + </v-stepper-content> + + <v-stepper-content :step="getStepIndex('confirm')"> + <h2 class="text-h6 mb-4">{{ $t(getStepTitleKey('confirm')) }}</h2> + <div class="mb-4"> + <v-text-field + outlined + v-model="data.comment" + :label="$t('paweljong.event_registration.form.steps.confirm.fields.comment.label')" + ></v-text-field> + </div> + <v-divider class="my-4" /> - <v-stepper-content :step="getStepIndex('additional')"> - <h2 class="text-h6 mb-4">{{ $t(getStepTitleKey('additional')) }}</h2> - <div class="mb-4"> - <v-form v-model="validationStatuses['additional']"> - <v-row> - <v-col> - <v-text-field - outlined - v-model="data.medicalInformation" - :label="$t('paweljong.event_registration.form.steps.additional.fields.medical_information.label')" - :hint="$t('paweljong.event_registration.form.steps.additional.fields.medical_information.help_text')" - ></v-text-field> - </v-col> - </v-row> - <v-row v-for="additionalField in event.additionalFields" :key="`additional-field-${additionalField.id}`"> - <v-col> - <div :aria-required="additionalField.required ? 'true' : 'false'"> - <component - :is="fieldComponentForAdditionalField(additionalField)" - v-model="data.additionalFields[additionalField.id]" - outlined - :label="additionalField.title" - :hint="additionalField.helpText" - persistent-hint - :required="additionalField.required" - :rules="additionalField.required ? $rules().required.build() : []" - /> - </div> - </v-col> - </v-row> - </v-form> - </div> - <v-divider class="mb-4" /> - <control-row - :step="step" - @set-step="setStep" - :next-disabled="!validationStatuses['additional']" - /> - </v-stepper-content> - - <v-stepper-content v-if="isStepEnabled('financial')" :step="getStepIndex('financial')"> - <h2 class="text-h6 mb-4">{{ $t(getStepTitleKey('financial')) }}</h2> - <div class="mb-4"> + <!-- TODO: Add summary --> + <message-box type="info" class="mb-4"> - {{ $t("paweljong.event_registration.form.steps.financial.help_text.cost_info") }} + {{ $t("paweljong.event_registration.form.steps.confirm.hint") }} </message-box> - <v-simple-table class="mb-4"> - <template v-slot:default> - <tbody> - <tr> - <td>{{ $t("paweljong.event_registration.form.steps.financial.help_text.min_cost") }}</td> - <td>{{ `${event.minCost} €` }}</td> - </tr> - <tr> - <td>{{ $t("paweljong.event_registration.form.steps.financial.help_text.cost") }}</td> - <td>{{ `${event.cost} €` }}</td> - </tr> - <tr v-if="event.maxCost"> - <td>{{ $t("paweljong.event_registration.form.steps.financial.help_text.max_cost") }}</td> - <td>{{ `${event.maxCost} €` }}</td> - </tr> - </tbody> - </template> - </v-simple-table> - <v-form v-model="validationStatuses['financial']"> - <v-row> - <v-col> - <div aria-required="true"> - <v-select - :items="paweljongPaymentChoices" - item-text="text" - item-value="variant" - outlined - v-model="data.payment.paymentMethod" - :label="$t('paweljong.event_registration.form.steps.financial.fields.payment_method.label')" - :hint="$t('paweljong.event_registration.form.steps.financial.fields.payment_method.help_text')" - persistent-hint - required - :disabled="data.payment.amount === 0" - :rules="data.payment.amount === 0 ? [] : $rules().required.build()" - ></v-select> - </div> - </v-col> - <v-col> - <div aria-required="true"> - <positive-small-integer-field - outlined - v-model="data.payment.amount" - :label="$t('paweljong.event_registration.form.steps.financial.fields.amount.label')" - :rules="$rules().build(rules.amount)" - /> - </div> - </v-col> - </v-row> - </v-form> - </div> - <v-divider class="mb-4" /> - <control-row - :step="step" - @set-step="setStep" - :next-disabled="!validationStatuses['financial']" - /> - </v-stepper-content> - - <v-stepper-content :step="getStepIndex('consent')"> - <h2 class="text-h6 mb-4">{{ $t(getStepTitleKey('consent')) }}</h2> - <div class="mb-4"> - <v-card v-for="term in event.terms" :key="`term-card-${term.id}`"> - <v-card-title> - {{ term.title }} - </v-card-title> - <v-card-text v-html="term.term" /> - </v-card> - <v-form v-model="validationStatuses['consent']"> - <div v-for="term in event.terms" :key="`term-checkbox-${term.id}`" aria-required="true"> - <v-checkbox - required - :rules="$rules().required.build()" - :label="term.confirmationText" - v-model="data.terms[term.id]" - /> - </div> - <div aria-required="true"> - <v-checkbox - v-if="event.dateRetraction" - required - :rules="$rules().required.build()" - :label="$tc('paweljong.event_registration.form.steps.consent.fields.retraction_consent.label', { date: $d($parseISODate(event.dateRetraction, 'short')) })" - v-model="data.retractionConsent" + <ApolloMutation + :mutation="require('./eventRegistrationMutation.graphql')" + :variables="{ + event: event.id, + eventRegistration: dataForSubmit, + }" + @done="eventRegistrationDone" + > + <template #default="{ mutate, loading, error }"> + <control-row + :step="step" + final-step + @set-step="setStep" + @confirm="mutate" + :next-loading="loading" /> - </div> - </v-form> - </div> - <v-divider class="mb-4" /> - <control-row - :step="step" - @set-step="setStep" - :next-disabled="!validationStatuses['consent']" - /> - </v-stepper-content> - - <v-stepper-content :step="getStepIndex('confirm')"> - <h2 class="text-h6 mb-4">{{ $t(getStepTitleKey('confirm')) }}</h2> - <div class="mb-4"> - <v-text-field - outlined - v-model="data.comment" - :label="$t('paweljong.event_registration.form.steps.confirm.fields.comment.label')" - ></v-text-field> - </div> - <v-divider class="my-4" /> - - <!-- TODO: Add summary --> - - <message-box type="info" class="mb-4"> - {{ $t("paweljong.event_registration.form.steps.confirm.hint") }} - </message-box> - <ApolloMutation - :mutation="require('./eventRegistrationMutation.graphql')" - :variables="{ - event: event.id, - eventRegistration: dataForSubmit, - }" - @done="eventRegistrationDone" - > - <template #default="{ mutate, loading, error }"> - <control-row - :step="step" - final-step - @set-step="setStep" - @confirm="mutate" - :next-loading="loading" - /> - <v-alert v-if="error" type="error" outlined>{{ error.message }}</v-alert> - </template> - </ApolloMutation> - </v-stepper-content> - </v-stepper-items> - </v-stepper> + <v-alert v-if="error" type="error" outlined>{{ error.message }}</v-alert> + </template> + </ApolloMutation> + </v-stepper-content> + </v-stepper-items> + </v-stepper> + <v-row v-if="currentParticipantHelpText || currentGuardianHelpText"> + <v-col v-if="currentParticipantHelpText" cols="12" md="6"> + <v-card> + <v-card-title> + {{ $t("paweljong.event_registration.form.help_text.participant") }} + </v-card-title> + <v-card-text>{{ currentParticipantHelpText }}</v-card-text> + </v-card> + </v-col> + <v-col v-if="currentGuardianHelpText" cols="12" md="6"> + <v-card> + <v-card-title> + {{ $t("paweljong.event_registration.form.help_text.guardian") }} + </v-card-title> + <v-card-text>{{ currentGuardianHelpText }}</v-card-text> + </v-card> + </v-col> + </v-row> </div> <div v-else-if="$apollo.queries.event.loading"> <v-skeleton-loader type="heading, text, actions" /> @@ -620,7 +637,7 @@ import SecondaryActionButton from "aleksis.core/components/generic/buttons/Secon <script> import { eventBySlug } from "../event/events.graphql"; - import { gqlPaweljongPaymentChoices, whoAmI } from "./helpers.graphql"; + import { gqlPaweljongPaymentChoices, gqlPaweljongSitePreferences, whoAmI } from "./helpers.graphql"; import { mailDomainsForUser, disallowedLocalParts, @@ -641,6 +658,7 @@ import SecondaryActionButton from "aleksis.core/components/generic/buttons/Secon }, }, paweljongPaymentChoices: gqlPaweljongPaymentChoices, + paweljongSitePreferences: gqlPaweljongSitePreferences, mailDomains: mailDomainsForUser, disallowedLocalParts: disallowedLocalParts, whoAmI: { @@ -776,37 +794,59 @@ import SecondaryActionButton from "aleksis.core/components/generic/buttons/Secon ... (this.$root.whoAmI.isAnonymous) ? [{ name: "email", titleKey: "paweljong.event_registration.form.steps.email.title", + participantHelpText: this.paweljongSitePreferences?.eventRegistrationEmailParticipantHelpText, + guardianHelpText: this.paweljongSitePreferences?.eventRegistrationEmailGuardianHelpText, }] : [], ... (this.$root.whoAmI.isAnonymous) ? [{ name: "register", titleKey: "paweljong.event_registration.form.steps.register.title", + participantHelpText: this.paweljongSitePreferences?.eventRegistrationRegisterParticipantHelpText, + guardianHelpText: this.paweljongSitePreferences?.eventRegistrationRegisterGuardianHelpText, }] : [], ... (this.event?.contactInformationVisibleFields.length) ? [{ name: "contact_details", titleKey: "paweljong.event_registration.form.steps.contact_details.title", + participantHelpText: this.paweljongSitePreferences?.eventRegistrationContactDetailsParticipantHelpText, + guardianHelpText: this.paweljongSitePreferences?.eventRegistrationContactDetailsGuardianHelpText, }] : [], { name: "guardians", titleKey: "paweljong.event_registration.form.steps.guardians.title", + participantHelpText: this.paweljongSitePreferences?.eventRegistrationGuardiansParticipantHelpText, + guardianHelpText: this.paweljongSitePreferences?.eventRegistrationGuardiansGuardianHelpText, }, { name: "additional", titleKey: "paweljong.event_registration.form.steps.additional.title", + participantHelpText: this.paweljongSitePreferences?.eventRegistrationAdditionalParticipantHelpText, + guardianHelpText: this.paweljongSitePreferences?.eventRegistrationAdditionalGuardianHelpText, }, ... (this.event.cost !== 0 && this.event.maxCost !== 0) ? [{ name: "financial", titleKey: "paweljong.event_registration.form.steps.financial.title", + participantHelpText: this.paweljongSitePreferences?.eventRegistrationFinancialParticipantHelpText, + guardianHelpText: this.paweljongSitePreferences?.eventRegistrationFinancialGuardianHelpText, }] : [], { name: "consent", titleKey: "paweljong.event_registration.form.steps.consent.title", + participantHelpText: this.paweljongSitePreferences?.eventRegistrationConsentParticipantHelpText, + guardianHelpText: this.paweljongSitePreferences?.eventRegistrationConsentGuardianHelpText, }, { name: "confirm", titleKey: "paweljong.event_registration.form.steps.confirm.title", + participantHelpText: this.paweljongSitePreferences?.eventRegistrationConfirmParticipantHelpText, + guardianHelpText: this.paweljongSitePreferences?.eventRegistrationConfirmGuardianHelpText, }, ]; - } + }, + currentParticipantHelpText() { + return this.steps[this.step - 1].participantHelpText; + }, + currentGuardianHelpText() { + return this.steps[this.step - 1].guardianHelpText; + }, }, data() { return { diff --git a/aleksis/apps/paweljong/frontend/components/event_registration/helpers.graphql b/aleksis/apps/paweljong/frontend/components/event_registration/helpers.graphql index b077505ef1cb88f42c275b7e830436724d2fcf74..a61c1531e473735479da01e11cd1e5d4c0a42339 100644 --- a/aleksis/apps/paweljong/frontend/components/event_registration/helpers.graphql +++ b/aleksis/apps/paweljong/frontend/components/event_registration/helpers.graphql @@ -29,3 +29,25 @@ query gqlPaweljongPaymentChoices { text } } + +query gqlPaweljongSitePreferences { + paweljongSitePreferences { + eventRegistrationEmailParticipantHelpText + eventRegistrationRegisterParticipantHelpText + eventRegistrationContactDetailsParticipantHelpText + eventRegistrationGuardiansParticipantHelpText + eventRegistrationAdditionalParticipantHelpText + eventRegistrationFinancialParticipantHelpText + eventRegistrationConsentParticipantHelpText + eventRegistrationConfirmParticipantHelpText + + eventRegistrationEmailGuardianHelpText + eventRegistrationRegisterGuardianHelpText + eventRegistrationContactDetailsGuardianHelpText + eventRegistrationGuardiansGuardianHelpText + eventRegistrationAdditionalGuardianHelpText + eventRegistrationFinancialGuardianHelpText + eventRegistrationConsentGuardianHelpText + eventRegistrationConfirmGuardianHelpText + } +} diff --git a/aleksis/apps/paweljong/frontend/messages/de.json b/aleksis/apps/paweljong/frontend/messages/de.json index 90c35b394c65da5b706c0af3caccc0733949c307..de2254fd6c51c4fb37a1b5e1f5f56c3e1bace3d2 100644 --- a/aleksis/apps/paweljong/frontend/messages/de.json +++ b/aleksis/apps/paweljong/frontend/messages/de.json @@ -233,6 +233,10 @@ "too_high": "Der Betrag ist höher als der maximal zu zahlende Betrag.", "too_low": "Der Betrag ist niedriger als der minimal zu zahlende Betrag." } + }, + "help_text": { + "guardian": "Für Erziehungsberechtigte", + "participant": "Für Teilnehmende" } } } diff --git a/aleksis/apps/paweljong/frontend/messages/en.json b/aleksis/apps/paweljong/frontend/messages/en.json index ade9ba5129ffe5ab28e2f78a49c01837e0e1c028..84c89b9b80fd11f60da77662e13323b166683776 100644 --- a/aleksis/apps/paweljong/frontend/messages/en.json +++ b/aleksis/apps/paweljong/frontend/messages/en.json @@ -233,6 +233,10 @@ "too_high": "The amount is higher than the maximal payable amount.", "too_low": "The amount is lower than the minimal payable amount." } + }, + "help_text": { + "guardian": "For guardians", + "participant": "For participants" } } } diff --git a/aleksis/apps/paweljong/preferences.py b/aleksis/apps/paweljong/preferences.py index b0b21a8bf7fb7de2be67f813b6e246349ffc79de..f42a0d0fa2c17a7290f82db0c5426989b540b2c8 100644 --- a/aleksis/apps/paweljong/preferences.py +++ b/aleksis/apps/paweljong/preferences.py @@ -3,7 +3,7 @@ from django.forms import EmailField from django.utils.translation import gettext_lazy as _ from dynamic_preferences.preferences import Section -from dynamic_preferences.types import StringPreference +from dynamic_preferences.types import LongStringPreference, StringPreference from aleksis.core.registries import site_preferences_registry @@ -42,3 +42,192 @@ class EventInvoiceGroupName(StringPreference): default = "Hack'n'Fun-Veranstaltungen" verbose_name = _("Name of invoice group used for events.") required = True + + +@site_preferences_registry.register +class EventRegistrationEmailParticipantHelpText(LongStringPreference): + """Help text to be displayed to participants during the email step of the event registration wizard.""" + + section = paweljong + name = "event_registration_email_participant_help_text" + verbose_name = _("Participant help text for email step in event registration wizard.") + default = "" + required = False + + +@site_preferences_registry.register +class EventRegistrationRegisterParticipantHelpText(LongStringPreference): + """Help text to be displayed to participants during the account registration step of the event registration wizard.""" + + section = paweljong + name = "event_registration_register_participant_help_text" + verbose_name = _("Participant help text for account registration step in event registration wizard.") + default = "" + required = False + + + +@site_preferences_registry.register +class EventRegistrationContactDetailsParticipantHelpText(LongStringPreference): + """Help text to be displayed to participants during the contact details step of the event registration wizard.""" + + section = paweljong + name = "event_registration_contact_details_participant_help_text" + verbose_name = _("Participant help text for contact details step in event registration wizard.") + default = "" + required = False + + + +@site_preferences_registry.register +class EventRegistrationGuardiansParticipantHelpText(LongStringPreference): + """Help text to be displayed to participants during the guardians step of the event registration wizard.""" + + section = paweljong + name = "event_registration_guardians_participant_help_text" + verbose_name = _("Participant help text for guardians step in event registration wizard.") + default = "" + required = False + + + +@site_preferences_registry.register +class EventRegistrationAdditionalParticipantHelpText(LongStringPreference): + """Help text to be displayed to participants during the additional information step of the event registration wizard.""" + + section = paweljong + name = "event_registration_additional_participant_help_text" + verbose_name = _("Participant help text for additional information step in event registration wizard.") + default = "" + required = False + + + +@site_preferences_registry.register +class EventRegistrationFinancialParticipantHelpText(LongStringPreference): + """Help text to be displayed to participants during the financial step of the event registration wizard.""" + + section = paweljong + name = "event_registration_financial_participant_help_text" + verbose_name = _("Participant help text for financial step in event registration wizard.") + default = "" + required = False + + + +@site_preferences_registry.register +class EventRegistrationConsentParticipantHelpText(LongStringPreference): + """Help text to be displayed to participants during the consent step of the event registration wizard.""" + + section = paweljong + name = "event_registration_consent_participant_help_text" + verbose_name = _("Participant help text for consent step in event registration wizard.") + default = "" + required = False + + + +@site_preferences_registry.register +class EventRegistrationConfirmParticipantHelpText(LongStringPreference): + """Help text to be displayed to participants during the confirmation step of the event registration wizard.""" + + section = paweljong + name = "event_registration_confirm_participant_help_text" + verbose_name = _("Participant help text for confirmation step in event registration wizard.") + default = "" + required = False + + +@site_preferences_registry.register +class EventRegistrationEmailGuardianHelpText(LongStringPreference): + """Help text to be displayed to guardians during the email step of the event registration wizard.""" + + section = paweljong + name = "event_registration_email_guardian_help_text" + verbose_name = _("Guardian help text for email step in event registration wizard.") + default = "" + required = False + + + +@site_preferences_registry.register +class EventRegistrationRegisterGuardianHelpText(LongStringPreference): + """Help text to be displayed to guardians during the account registration step of the event registration wizard.""" + + section = paweljong + name = "event_registration_register_guardian_help_text" + verbose_name = _("Guardian help text for account registration step in event registration wizard.") + default = "" + required = False + + + +@site_preferences_registry.register +class EventRegistrationContactDetailsGuardianHelpText(LongStringPreference): + """Help text to be displayed to guardians during the contact details step of the event registration wizard.""" + + section = paweljong + name = "event_registration_contact_details_guardian_help_text" + verbose_name = _("Guardian help text for contact details step in event registration wizard.") + default = "" + required = False + + + +@site_preferences_registry.register +class EventRegistrationGuardiansGuardianHelpText(LongStringPreference): + """Help text to be displayed to guardians during the guardians step of the event registration wizard.""" + + section = paweljong + name = "event_registration_guardians_guardian_help_text" + verbose_name = _("Guardian help text for guardians step in event registration wizard.") + default = "" + required = False + + + +@site_preferences_registry.register +class EventRegistrationAdditionalGuardianHelpText(LongStringPreference): + """Help text to be displayed to guardians during the additional information step of the event registration wizard.""" + + section = paweljong + name = "event_registration_additional_guardian_help_text" + verbose_name = _("Guardian help text for additional information step in event registration wizard.") + default = "" + required = False + + + +@site_preferences_registry.register +class EventRegistrationFinancialGuardianHelpText(LongStringPreference): + """Help text to be displayed to guardians during the financial step of the event registration wizard.""" + + section = paweljong + name = "event_registration_financial_guardian_help_text" + verbose_name = _("Guardian help text for financial step in event registration wizard.") + default = "" + required = False + + + +@site_preferences_registry.register +class EventRegistrationConsentGuardianHelpText(LongStringPreference): + """Help text to be displayed to guardians during the consent step of the event registration wizard.""" + + section = paweljong + name = "event_registration_consent_guardian_help_text" + verbose_name = _("Guardian help text for consent step in event registration wizard.") + default = "" + required = False + + + +@site_preferences_registry.register +class EventRegistrationConfirmGuardianHelpText(LongStringPreference): + """Help text to be displayed to guardians during the confirmation step of the event registration wizard.""" + + section = paweljong + name = "event_registration_confirm_guardian_help_text" + verbose_name = _("Guardian help text for confirmation step in event registration wizard.") + default = "" + required = False diff --git a/aleksis/apps/paweljong/schema/__init__.py b/aleksis/apps/paweljong/schema/__init__.py index 75a300fc50d5d91fb1c1af228a761363bc349d63..ae907c9d04c91ad94f0fc47b04259db4fb01c01b 100644 --- a/aleksis/apps/paweljong/schema/__init__.py +++ b/aleksis/apps/paweljong/schema/__init__.py @@ -20,6 +20,7 @@ from .event_additional_field import ( EventAdditionalFieldType, ) from .event_registration import SendEventRegistrationMutation +from .site_preferences import PaweljongSitePreferencesType from .terms import TermsType @@ -33,6 +34,8 @@ class Query(graphene.ObjectType): paweljong_payment_choices = graphene.List(PaymentVariantChoiceType) + paweljong_site_preferences = graphene.Field(PaweljongSitePreferencesType) + @staticmethod def resolve_event_by_id(root, info, id): event = Event.objects.get(pk=id) @@ -60,6 +63,10 @@ class Query(graphene.ObjectType): return group.get_variant_choices() + @staticmethod + def resolve_paweljong_site_preferences(root, info, **kwargs): + return get_site_preferences() + class Mutation(graphene.ObjectType): checkpoint_check_in = CheckpointCheckInMutation.Field() diff --git a/aleksis/apps/paweljong/schema/site_preferences.py b/aleksis/apps/paweljong/schema/site_preferences.py new file mode 100644 index 0000000000000000000000000000000000000000..cddf3d53e66e2fd42a90865467de56172264a239 --- /dev/null +++ b/aleksis/apps/paweljong/schema/site_preferences.py @@ -0,0 +1,70 @@ +import graphene + + +class PaweljongSitePreferencesType(graphene.ObjectType): + event_registration_email_participant_help_text = graphene.String() + event_registration_register_participant_help_text = graphene.String() + event_registration_contact_details_participant_help_text = graphene.String() + event_registration_guardians_participant_help_text = graphene.String() + event_registration_additional_participant_help_text = graphene.String() + event_registration_financial_participant_help_text = graphene.String() + event_registration_consent_participant_help_text = graphene.String() + event_registration_confirm_participant_help_text = graphene.String() + + event_registration_email_guardian_help_text = graphene.String() + event_registration_register_guardian_help_text = graphene.String() + event_registration_contact_details_guardian_help_text = graphene.String() + event_registration_guardians_guardian_help_text = graphene.String() + event_registration_additional_guardian_help_text = graphene.String() + event_registration_financial_guardian_help_text = graphene.String() + event_registration_consent_guardian_help_text = graphene.String() + event_registration_confirm_guardian_help_text = graphene.String() + + + def resolve_event_registration_email_participant_help_text(parent, info, **kwargs): + return parent["paweljong__event_registration_email_participant_help_text"] + + def resolve_event_registration_register_participant_help_text(parent, info, **kwargs): + return parent["paweljong__event_registration_register_participant_help_text"] + + def resolve_event_registration_contact_details_participant_help_text(parent, info, **kwargs): + return parent["paweljong__event_registration_contact_details_participant_help_text"] + + def resolve_event_registration_guardians_participant_help_text(parent, info, **kwargs): + return parent["paweljong__event_registration_guardians_participant_help_text"] + + def resolve_event_registration_additional_participant_help_text(parent, info, **kwargs): + return parent["paweljong__event_registration_additional_participant_help_text"] + + def resolve_event_registration_financial_participant_help_text(parent, info, **kwargs): + return parent["paweljong__event_registration_financial_participant_help_text"] + + def resolve_event_registration_consent_participant_help_text(parent, info, **kwargs): + return parent["paweljong__event_registration_consent_participant_help_text"] + + def resolve_event_registration_confirm_participant_help_text(parent, info, **kwargs): + return parent["paweljong__event_registration_confirm_participant_help_text"] + + def resolve_event_registration_email_guardian_help_text(parent, info, **kwargs): + return parent["paweljong__event_registration_email_guardian_help_text"] + + def resolve_event_registration_register_guardian_help_text(parent, info, **kwargs): + return parent["paweljong__event_registration_register_guardian_help_text"] + + def resolve_event_registration_contact_details_guardian_help_text(parent, info, **kwargs): + return parent["paweljong__event_registration_contact_details_guardian_help_text"] + + def resolve_event_registration_guardians_guardian_help_text(parent, info, **kwargs): + return parent["paweljong__event_registration_guardians_guardian_help_text"] + + def resolve_event_registration_additional_guardian_help_text(parent, info, **kwargs): + return parent["paweljong__event_registration_additional_guardian_help_text"] + + def resolve_event_registration_financial_guardian_help_text(parent, info, **kwargs): + return parent["paweljong__event_registration_financial_guardian_help_text"] + + def resolve_event_registration_consent_guardian_help_text(parent, info, **kwargs): + return parent["paweljong__event_registration_consent_guardian_help_text"] + + def resolve_event_registration_confirm_guardian_help_text(parent, info, **kwargs): + return parent["paweljong__event_registration_confirm_guardian_help_text"]