2020-03-12 14:29:21 +01:00
|
|
|
<template>
|
2020-02-18 08:57:00 +01:00
|
|
|
<div v-if="loggedUser">
|
2020-06-05 15:37:45 +02:00
|
|
|
<div class="setting-title">
|
|
|
|
<h2>{{ $t("Participation notifications") }}</h2>
|
|
|
|
</div>
|
2020-02-18 08:57:00 +01:00
|
|
|
<div class="field">
|
2020-06-05 15:37:45 +02:00
|
|
|
<strong>{{
|
|
|
|
$t("We'll always send you emails to notifiy about important event updates")
|
|
|
|
}}</strong>
|
|
|
|
<p>
|
|
|
|
{{
|
|
|
|
$t(
|
|
|
|
"Like title or physical address update, start or end date change or event being confirmed or cancelled."
|
|
|
|
)
|
|
|
|
}}
|
|
|
|
</p>
|
2020-03-12 14:29:21 +01:00
|
|
|
</div>
|
2020-02-18 08:57:00 +01:00
|
|
|
<div class="field">
|
|
|
|
<b-checkbox v-model="notificationOnDay" @input="updateSetting({ notificationOnDay })">
|
|
|
|
<strong>{{ $t("Notification on the day of the event") }}</strong>
|
|
|
|
<p>
|
|
|
|
{{ $t("We'll use your timezone settings to send a recap of the morning of the event.") }}
|
|
|
|
</p>
|
|
|
|
<span v-if="loggedUser.settings.timezone">{{
|
|
|
|
$t("Your timezone is currently set to {timezone}.", {
|
|
|
|
timezone: loggedUser.settings.timezone,
|
|
|
|
})
|
|
|
|
}}</span>
|
|
|
|
<span v-else>{{ $t("You can pick your timezone into your preferences.") }}</span>
|
|
|
|
</b-checkbox>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<b-checkbox v-model="notificationEachWeek" @input="updateSetting({ notificationEachWeek })">
|
|
|
|
<strong>{{ $t("Recap every week") }}</strong>
|
|
|
|
<p>
|
|
|
|
{{ $t("You'll get a weekly recap every Monday for upcoming events, if you have any.") }}
|
|
|
|
</p>
|
|
|
|
</b-checkbox>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<b-checkbox
|
|
|
|
v-model="notificationBeforeEvent"
|
|
|
|
@input="updateSetting({ notificationBeforeEvent })"
|
|
|
|
>
|
|
|
|
<strong>{{ $t("Notification before the event") }}</strong>
|
|
|
|
<p>
|
|
|
|
{{
|
|
|
|
$t(
|
|
|
|
"We'll send you an email one hour before the event begins, to be sure you won't forget about it."
|
|
|
|
)
|
|
|
|
}}
|
|
|
|
</p>
|
|
|
|
</b-checkbox>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-03-12 14:29:21 +01:00
|
|
|
</template>
|
|
|
|
<script lang="ts">
|
2020-02-18 08:57:00 +01:00
|
|
|
import { Component, Vue, Watch } from "vue-property-decorator";
|
|
|
|
import { USER_SETTINGS, SET_USER_SETTINGS } from "../../graphql/user";
|
|
|
|
import { ICurrentUser } from "../../types/current-user.model";
|
2020-03-12 14:29:21 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
@Component({
|
|
|
|
apollo: {
|
|
|
|
loggedUser: USER_SETTINGS,
|
|
|
|
},
|
|
|
|
})
|
2020-03-12 14:29:21 +01:00
|
|
|
export default class Notifications extends Vue {
|
2020-02-18 08:57:00 +01:00
|
|
|
loggedUser!: ICurrentUser;
|
|
|
|
|
|
|
|
notificationOnDay = true;
|
|
|
|
|
|
|
|
notificationEachWeek = false;
|
|
|
|
|
|
|
|
notificationBeforeEvent = false;
|
2020-03-12 14:29:21 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
async updateSetting(variables: object) {
|
|
|
|
await this.$apollo.mutate<{ setUserSettings: string }>({
|
|
|
|
mutation: SET_USER_SETTINGS,
|
|
|
|
variables,
|
|
|
|
});
|
|
|
|
}
|
2020-03-12 14:29:21 +01:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
</script>
|