2021-08-14 01:42:49 -07:00
|
|
|
<template>
|
2021-10-03 07:37:00 -07:00
|
|
|
<div v-if="year">
|
2021-10-03 07:56:07 -07:00
|
|
|
<CommunityNav v-if="!basic"/>
|
2021-08-14 01:42:49 -07:00
|
|
|
|
2021-12-03 15:04:07 -08:00
|
|
|
<h2 class="d-flex justify-content-between flex-column flex-md-row">
|
2021-10-03 07:56:07 -07:00
|
|
|
<span>
|
|
|
|
<Icon v="calendar-star"/>
|
|
|
|
<T>calendar.headerLong</T> <small class="text-muted">({{year.year}})</small>
|
|
|
|
</span>
|
|
|
|
<span v-if="basic" class="h4 mt-2">
|
|
|
|
<nuxt-link :to="`/${ config.calendar.route }`">
|
|
|
|
<Icon v="tags"/>
|
|
|
|
<T>domain</T>/{{ config.calendar.route }}
|
|
|
|
</nuxt-link>
|
|
|
|
</span>
|
2021-12-03 15:04:07 -08:00
|
|
|
<span v-else class="btn-group">
|
|
|
|
<button :class="['btn', labels ? 'btn-outline-primary' : 'btn-primary']" @click="labels = false">
|
|
|
|
<Icon v="table"/>
|
|
|
|
<T>calendar.view.grid</T>
|
|
|
|
</button>
|
|
|
|
<button :class="['btn', labels ? 'btn-primary' : 'btn-outline-primary']" @click="labels = true">
|
|
|
|
<Icon v="list"/>
|
|
|
|
<T>calendar.view.list</T>
|
|
|
|
</button>
|
|
|
|
</span>
|
2021-08-14 01:42:49 -07:00
|
|
|
</h2>
|
|
|
|
|
2021-10-04 14:00:54 -07:00
|
|
|
<CalendarBanner v-if="!basic && year.isCurrent()"/>
|
2021-08-14 01:42:49 -07:00
|
|
|
|
2021-12-03 06:04:44 -08:00
|
|
|
<template v-if="basic">
|
|
|
|
<section v-if="labels" class="columns-4 pb-4">
|
|
|
|
<div v-for="i in 12" class="py-3">
|
|
|
|
<h3 class="text-center"><T>calendar.months.{{i}}</T></h3>
|
|
|
|
<CalendarMonthEvents :year="year" :month="i" class="small my-3"/>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
<section v-else class="row pb-4">
|
|
|
|
<div v-for="i in 12" class="col-12 col-lg-3 py-3">
|
|
|
|
<h3 class="text-center"><T>calendar.months.{{i}}</T></h3>
|
|
|
|
<Calendar :year="year" :month="i"/>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</template>
|
|
|
|
<template v-else>
|
|
|
|
<section v-if="labels" class="columns-3">
|
|
|
|
<div v-for="i in 12" class="py-3">
|
|
|
|
<h3 class="text-center"><T>calendar.months.{{i}}</T></h3>
|
|
|
|
<CalendarMonthEvents :year="year" :month="i" class="small my-3"/>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
<section v-else class="row">
|
|
|
|
<div v-for="i in 12" class="col-12 col-sm-6 col-lg-4 py-3">
|
|
|
|
<h3 class="text-center"><T>calendar.months.{{i}}</T></h3>
|
|
|
|
<Calendar :year="year" :month="i" :mark="today" tooltips/>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</template>
|
2021-08-14 01:42:49 -07:00
|
|
|
|
2021-10-03 07:56:07 -07:00
|
|
|
<template v-if="!basic">
|
2021-10-03 15:19:23 -07:00
|
|
|
<CalendarExtra :year="year"/>
|
2021-08-18 11:19:24 -07:00
|
|
|
|
2021-10-03 07:56:07 -07:00
|
|
|
<Support/>
|
2021-08-18 11:19:24 -07:00
|
|
|
|
2021-10-03 07:56:07 -07:00
|
|
|
<section>
|
|
|
|
<Share :title="$t('calendar.header')"/>
|
|
|
|
</section>
|
|
|
|
</template>
|
2021-08-14 01:42:49 -07:00
|
|
|
</div>
|
2021-10-03 07:37:00 -07:00
|
|
|
<NotFound v-else/>
|
2021-08-14 01:42:49 -07:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { head } from "../src/helpers";
|
2021-10-03 07:37:00 -07:00
|
|
|
import { calendar } from '../src/calendar/calendar';
|
|
|
|
import { Day } from '../src/calendar/helpers';
|
2021-08-14 01:42:49 -07:00
|
|
|
|
|
|
|
export default {
|
2021-10-03 07:56:07 -07:00
|
|
|
layout({route}) {
|
|
|
|
return route.query.layout === 'basic' ? 'basic' : 'default';
|
|
|
|
},
|
2021-08-14 01:42:49 -07:00
|
|
|
data() {
|
|
|
|
return {
|
2021-10-03 07:37:00 -07:00
|
|
|
year: this.$route.params.year
|
|
|
|
? calendar.getYear(this.$route.params.year)
|
|
|
|
: calendar.getCurrentYear(),
|
|
|
|
today: Day.today(),
|
2021-10-03 07:56:07 -07:00
|
|
|
basic: this.$route.query.layout === 'basic',
|
|
|
|
labels: this.$route.query.labels === 'true',
|
2021-08-14 01:42:49 -07:00
|
|
|
}
|
|
|
|
},
|
|
|
|
head() {
|
2021-10-03 15:19:23 -07:00
|
|
|
if (!this.year) {
|
|
|
|
return {};
|
|
|
|
}
|
2021-08-14 01:42:49 -07:00
|
|
|
return head({
|
|
|
|
title: this.$t('calendar.headerLong'),
|
2021-10-03 15:19:23 -07:00
|
|
|
banner: `calendar/${this.year.year}-overview.png`,
|
2021-08-14 01:42:49 -07:00
|
|
|
});
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
2021-12-03 06:04:44 -08:00
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2021-12-03 06:15:19 -08:00
|
|
|
@import "assets/variables";
|
2021-12-03 06:04:44 -08:00
|
|
|
|
|
|
|
@for $i from 3 to 5 {
|
|
|
|
@include media-breakpoint-up('lg', $grid-breakpoints) {
|
|
|
|
.columns-#{$i} {
|
|
|
|
column-count: $i;
|
|
|
|
> * {
|
|
|
|
break-inside: avoid-column;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|