Web check-in: Show subevent with check result

This commit is contained in:
Raphael Michel
2021-10-14 18:48:19 +02:00
parent 01d9574ddf
commit 9ac705cd88

View File

@@ -32,6 +32,7 @@
<h4>{{ checkResult.position.order }}-{{ checkResult.position.positionid }} {{ checkResult.position.attendee_name }}</h4>
<strong v-if="checkResult.reason_explanation">{{ checkResult.reason_explanation }}<br></strong>
<span>{{ checkResultItemvar }}</span><br>
<span v-if="checkResultSubevent">{{ checkResultSubevent }}<br></span>
<span class="secret">{{ checkResult.position.secret }}</span>
<span v-if="checkResult.position.seat"><br>{{ checkResult.position.seat.name }}</span>
</div>
@@ -254,6 +255,13 @@ export default {
const date = moment.utc(this.checkinlist.subevent.date_from).tz(this.$root.timezone).format(this.$root.datetime_format)
return `${name} · ${date}`
},
checkResultSubevent() {
if (!this.checkResult) return ''
if (!this.checkResult.position.subevent) return ''
const name = i18nstring_localize(this.checkResult.position.subevent.name)
const date = moment.utc(this.checkResult.position.subevent.date_from).tz(this.$root.timezone).format(this.$root.datetime_format)
return `${name} · ${date}`
},
checkResultItemvar() {
if (!this.checkResult) return ''
if (this.checkResult.position.variation) {
@@ -331,7 +339,7 @@ export default {
this.$refs.input.blur()
})
fetch(this.$root.api.lists + this.checkinlist.id + '/positions/' + encodeURIComponent(id) + '/redeem/?expand=item&expand=variation', {
fetch(this.$root.api.lists + this.checkinlist.id + '/positions/' + encodeURIComponent(id) + '/redeem/?expand=item&expand=subevent&expand=variation', {
method: 'POST',
headers: {
'X-CSRFToken': document.querySelector("input[name=csrfmiddlewaretoken]").value,