Skip to content

Commit

Permalink
Event registration - email field
Browse files Browse the repository at this point in the history
  • Loading branch information
szymsza committed Jan 24, 2021
1 parent b4bb078 commit 1542316
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 7 deletions.
12 changes: 8 additions & 4 deletions src/components/Event/CheckoutPersonCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@
<dt>{{ $tr("fields.diet") }}:</dt>
<dd>{{ dietaryRequirement }}</dd>
</div>

<div v-if="person.person.email && person.person.email">
<dt>{{ $tr("auth.fields.email", null, false) }}:</dt>
<dd>{{ person.person.email }}</dd>
</div>
</q-card-section>

<q-separator v-if="person.registration.accommodation" inset />
Expand All @@ -89,16 +94,15 @@
v-if="
value &&
fieldName.substr(-4) !== 'name' &&
fieldName !== 'dietary_requirement'
fieldName !== 'dietary_requirement' &&
fieldName !== 'email'
"
>
<dt>{{ $tr("fields." + fieldName) }}:</dt>
<dd v-if="fieldName === 'birthdate'">
{{ value | moment("D. M. Y") }}
</dd>
<dd
v-else-if="value != null && fieldName !== 'dietary_requirement'"
>
<dd v-else-if="value != null">
{{ value }}
</dd>
</template>
Expand Down
24 changes: 23 additions & 1 deletion src/components/Event/FormFields.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,25 @@
/>
</div>

<q-input
v-if="requireEmail"
v-model="values.email"
class="q-mt-sm"
type="email"
outlined
:label="$tr('auth.fields.email', null, false) + ' *'"
lazy-rules
:rules="[
val =>
(val !== null && val !== '') ||
$tr(`general.form.fieldError`, null, false)
]"
>
<template v-slot:prepend>
<q-icon name="fas fa-at" />
</template>
</q-input>

<div
class="block"
v-if="accommodationType !== 'required' && accommodationType !== 'none'"
Expand Down Expand Up @@ -471,7 +490,8 @@ export default {
accommodationType: String,
mealType: String,
possibleDiets: Array,
role: Number
role: Number,
requireEmail: Boolean
},
data() {
Expand All @@ -494,6 +514,7 @@ export default {
// parentPhone: "+420",
// parentEmail: null,
note: null,
email: null,
accept: false,
birthDay: null,
birthMonth: null,
Expand Down Expand Up @@ -759,6 +780,7 @@ export default {
name: this.values.name ? this.values.name.trim() : null,
surname: this.values.surname ? this.values.surname.trim() : null,
note: this.values.note,
email: this.values.email,
meals: this.values.meals,
dietary_requirement: this.values.dietary_requirement
? this.values.dietary_requirement.value
Expand Down
4 changes: 3 additions & 1 deletion src/components/Event/TeamForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
:possibleDiets="possibleDiets"
:accommodationType="accommodationType"
:mealType="mealType"
:requireEmail="requireEmail"
/>
<g-d-p-r-checkbox v-model="accept" :error="acceptError" />
<div class="text-center">
Expand Down Expand Up @@ -105,7 +106,8 @@ export default {
accommodationType: String,
mealType: String,
possibleDiets: Array,
eventId: Number
eventId: Number,
requireEmail: Boolean
},
data() {
return {
Expand Down
4 changes: 3 additions & 1 deletion src/components/Event/TeamPersonCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
:mealType="mealType"
:possibleDiets="possibleDiets"
:role="1"
:requireEmail="requireEmail"
/>
</q-card-section>
</slide-up-down>
Expand All @@ -68,7 +69,8 @@ export default {
error: Boolean,
accommodationType: String,
mealType: String,
possibleDiets: Array
possibleDiets: Array,
requireEmail: Boolean
},
data() {
return {
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Event.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
:mealType="mealType"
:possibleDiets="possibleDiets"
:role="role"
:requireEmail="event.email_required"
@goToRolePick="goTo('role')"
/>
<team-form
Expand All @@ -148,6 +149,7 @@
:mealType="mealType"
:possibleDiets="possibleDiets"
:eventId="event.id"
:requireEmail="event.email_required"
></team-form>
</div>
</div>
Expand Down

0 comments on commit 1542316

Please sign in to comment.