new navbar, loading component

This commit is contained in:
lesion
2022-11-09 10:18:42 +01:00
parent 31cfef1d89
commit 305e9a52ae
6 changed files with 300 additions and 138 deletions

View File

@@ -13,10 +13,25 @@ li {
background-color: #434343; background-color: #434343;
} }
.v-application {
font-family: sans-serif;
}
.v-application .p-description.text-body-1 { .v-application .p-description.text-body-1 {
letter-spacing: normal !important; letter-spacing: normal !important;
} }
.v-main {
padding-top: 176px !important;
}
.v-toolbar .v-list-item__subtitle,
.v-toolbar h4 {
white-space: break-spaces;
word-wrap: break-word;
word-break: break-word;
}
#home { #home {
max-width: 1400px; max-width: 1400px;
padding: 0px; padding: 0px;
@@ -27,10 +42,17 @@ li {
margin: 0 auto; margin: 0 auto;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 16px;
justify-content: center; justify-content: center;
} }
#calh { @media only screen and (max-width: 600px) {
#events {
gap: 8px;
}
}
.calh {
/* this is to avoid content shift layout as v-calendar does not support SSR */ /* this is to avoid content shift layout as v-calendar does not support SSR */
height: 268px; height: 268px;
} }
@@ -81,8 +103,8 @@ li {
width: 330px; width: 330px;
max-width: 500px !important; max-width: 500px !important;
flex-grow: 1; flex-grow: 1;
margin-top: .4em; /* margin-top: 16px;
margin-right: .4em; margin-right: 16px; */
transition: all .5s; transition: all .5s;
overflow: hidden; overflow: hidden;
} }
@@ -96,7 +118,7 @@ li {
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
font-size: 1.1em !important; font-size: 1.1em !important;
line-height: 1.2em !important; line-height: 1.2em !important;
text-decoration: none; /* text-decoration: none; */
} }
.event .body { .event .body {
@@ -113,6 +135,11 @@ li {
text-decoration: none; text-decoration: none;
} }
.event a:hover,
.event a:focus {
text-decoration: underline;
}
.vc-past { .vc-past {
opacity: 0.4; opacity: 0.4;
} }

View File

@@ -4,7 +4,7 @@
v-model='selectedDate' v-model='selectedDate'
title-position='left' title-position='left'
:is-dark="settings['theme.is_dark']" :is-dark="settings['theme.is_dark']"
:columns="$screens({ sm: 2 }, 1)" :columns="!$vuetify.breakpoint.smAndDown ? 2 : 1"
@input='click' @input='click'
@update:from-page='updatePage' @update:from-page='updatePage'
:locale='$i18n.locale' :locale='$i18n.locale'

View File

@@ -15,16 +15,17 @@ v-col(cols=12)
.datePicker.mt-3 .datePicker.mt-3
v-input(:value='fromDate' :rules="[$validators.required('common.when')]") v-input(:value='fromDate' :rules="[$validators.required('common.when')]")
vc-date-picker( vc-date-picker(
v-model='fromDate' :value='fromDate'
:is-range='type === "multidate"' :is-range='type === "multidate"'
@input="date => change('date', date)" @input="date => change('date', date)"
:timezone='settings.instance_timezone'
:attributes='attributes' :attributes='attributes'
:locale='$i18n.locale' :locale='$i18n.locale'
:is-dark="settings['theme.is_dark']" :is-dark="settings['theme.is_dark']"
is-inline is-inline
is-expanded is-expanded
:min-date='type !== "recurrent" && new Date()') :min-date='type !== "recurrent" && new Date()')
template(#placeholder)
span.calc Loading
div.text-center.mb-2(v-if='type === "recurrent"') div.text-center.mb-2(v-if='type === "recurrent"')
span(v-if='value.recurrent.frequency !== "1m" && value.recurrent.frequency !== "2m"') {{ whenPatterns }} span(v-if='value.recurrent.frequency !== "1m" && value.recurrent.frequency !== "2m"') {{ whenPatterns }}
@@ -37,7 +38,7 @@ v-col(cols=12)
v-model="menuFromHour" v-model="menuFromHour"
:close-on-content-click="false" :close-on-content-click="false"
offset-y offset-y
:value="fromHour" :value="value.fromHour"
transition="scale-transition") transition="scale-transition")
template(v-slot:activator="{ on, attrs }") template(v-slot:activator="{ on, attrs }")
v-text-field( v-text-field(
@@ -45,7 +46,7 @@ v-col(cols=12)
:clear-icon='mdiClose' :clear-icon='mdiClose'
@click:clear='() => change("fromHour")' @click:clear='() => change("fromHour")'
:label="$t('event.from')" :label="$t('event.from')"
:value="fromHour" :value="value.fromHour"
:disabled='!value.from' :disabled='!value.from'
readonly readonly
:prepend-icon="mdiClockTimeFourOutline" :prepend-icon="mdiClockTimeFourOutline"
@@ -54,7 +55,7 @@ v-col(cols=12)
v-on="on") v-on="on")
v-time-picker( v-time-picker(
v-if="menuFromHour" v-if="menuFromHour"
v-model="fromHour" :value="value.fromHour"
:allowedMinutes='allowedMinutes' :allowedMinutes='allowedMinutes'
format='24hr' format='24hr'
@click:minute='menuFromHour = false' @click:minute='menuFromHour = false'
@@ -66,7 +67,7 @@ v-col(cols=12)
v-model="menuDueHour" v-model="menuDueHour"
:close-on-content-click="false" :close-on-content-click="false"
offset-y offset-y
:value="dueHour" :value="value.dueHour"
transition="scale-transition") transition="scale-transition")
template(v-slot:activator="{ on, attrs }") template(v-slot:activator="{ on, attrs }")
v-text-field( v-text-field(
@@ -74,15 +75,15 @@ v-col(cols=12)
:clear-icon='mdiClose' :clear-icon='mdiClose'
@click:clear='() => change("dueHour")' @click:clear='() => change("dueHour")'
:label="$t('event.due')" :label="$t('event.due')"
:value="dueHour" :value="value.dueHour"
:disabled='!fromHour' :disabled='!value.fromHour'
readonly readonly
:prepend-icon="mdiClockTimeEightOutline" :prepend-icon="mdiClockTimeEightOutline"
v-bind="attrs" v-bind="attrs"
v-on="on") v-on="on")
v-time-picker( v-time-picker(
v-if="menuDueHour" v-if="menuDueHour"
v-model="dueHour" :value="value.dueHour"
:allowedMinutes='allowedMinutes' :allowedMinutes='allowedMinutes'
format='24hr' format='24hr'
@click:minute='menuDueHour = false' @click:minute='menuDueHour = false'
@@ -102,7 +103,7 @@ export default {
name: 'DateInput', name: 'DateInput',
components: { List }, components: { List },
props: { props: {
value: { type: Object, default: () => ({ from: null, due: null, recurrent: null }) }, value: { type: Object, default: () => ({ from: null, due: null, recurrent: null, fromHour: null, dueHour: null }) },
event: { type: Object, default: () => null } event: { type: Object, default: () => null }
}, },
data() { data() {
@@ -122,26 +123,15 @@ export default {
}, },
computed: { computed: {
...mapState(['settings']), ...mapState(['settings']),
fromDate: { fromDate () {
set: () => {}, if (this.value.from) {
get: function () { if (this.value.multidate) {
if (this.value.from) { return ({ start: dayjs(this.value.from).toDate(), end: dayjs(this.value.due).toDate() })
if (this.value.multidate) { } else {
return ({ start: dayjs(this.value.from).toDate(), end: dayjs(this.value.due).toDate() }) return new Date(this.value.from)
} else {
return new Date(this.value.from)
}
} }
} }
}, },
fromHour: {
set: () => {},
get () { return this.value.from && dayjs.tz(this.value.from).format('HH:mm') || '' }
},
dueHour: {
set: () => {},
get () { return this.value.due && dayjs.tz(this.value.due).format('HH:mm') || '' }
},
todayEvents() { todayEvents() {
const start = dayjs.tz(this.value.from).startOf('day').unix() const start = dayjs.tz(this.value.from).startOf('day').unix()
const end = dayjs.tz(this.value.from).endOf('day').unix() const end = dayjs.tz(this.value.from).endOf('day').unix()
@@ -236,56 +226,39 @@ export default {
} else if (what === 'recurrentType') { } else if (what === 'recurrentType') {
this.$emit('input', { ...this.value, recurrent: { ...this.value.recurrent, type: value } }) this.$emit('input', { ...this.value, recurrent: { ...this.value.recurrent, type: value } })
} else if (what === 'fromHour') { } else if (what === 'fromHour') {
const [hour, minute] = value ? value.split(':') : [0, 0] if (value) {
let from = dayjs.tz(this.value.from).hour(hour).minute(minute).second(0).toDate() this.$emit('input', { ...this.value, fromHour: value })
this.$emit('input', { ...this.value, from }) } else {
if (!value) { this.$emit('input', { ...this.value, fromHour: null, dueHour: null })
this.fromHour = null
} }
} else if (what === 'dueHour') { } else if (what === 'dueHour') {
if (value) { this.$emit('input', { ...this.value, dueHour: value })
const [hour, minute] = value.split(':')
let due = dayjs.tz(this.value.due || this.value.from).hour(Number(hour)).minute(Number(minute)).second(0)
// add a day // if (value) {
if (dayjs(this.value.from).hour() > Number(hour) && !this.value.multidate) { // // const [hour, minute] = value.split(':')
due = due.add(1, 'day') // // let due = dayjs.tz(this.value.due || this.value.from).hour(Number(hour)).minute(Number(minute)).second(0)
}
due = due.hour(hour).minute(minute).second(0) // // add a day
this.$emit('input', { ...this.value, due: due.toDate() }) // // if (dayjs(this.value.from).hour() > Number(hour) && !this.value.multidate) {
} else { // // due = due.add(1, 'day')
this.$emit('input', { ...this.value, due: null }) // // }
this.dueHour = null // // due = due.hour(hour).minute(minute).second(0)
} // } else {
// this.$emit('input', { ...this.value, dueHour: null })
// }
// change date in calendar (could be a range or a recurrent event...) // change date in calendar (could be a range or a recurrent event...)
} else if (what === 'date') { } else if (what === 'date') {
if (value === null) { if (value === null) {
this.$emit('input', { ...this.value, from: null, due: null }) this.$emit('input', { ...this.value, from: null, due: null, fromHour: null, dueHour: null })
return return
} }
if (this.value.multidate) { if (this.value.multidate) {
let from = value.start let from = value.start
let due = value.end let due = value.end
if (this.fromHour) {
const [hour, minute] = this.fromHour.split(':')
from = dayjs.tz(from).hour(hour).minute(minute).second(0).toDate()
}
if (this.dueHour) {
const [hour, minute] = this.dueHour.split(':')
due = dayjs.tz(due).hour(hour).minute(minute).second(0).toDate()
}
this.$emit('input', { ...this.value, from, due }) this.$emit('input', { ...this.value, from, due })
} else { } else {
let from = value let from = value
let due = this.value.due let due = this.value.due
if (this.fromHour) {
const [hour, minute] = this.fromHour.split(':')
from = dayjs.tz(value).hour(hour).minute(minute).second(0).toDate()
}
if (this.dueHour) {
const [hour, minute] = this.dueHour.split(':')
due = dayjs.tz(value).hour(hour).minute(minute).second(0).toDate()
}
this.$emit('input', { ...this.value, from, due }) this.$emit('input', { ...this.value, from, due })
} }
} }

View File

@@ -1,87 +1,241 @@
<template lang="pug"> <template>
v-app-bar(app aria-label='Menu' height=64) <v-app-bar prominent fade-img-on-scroll app hide-on-scroll
src="/headerimage.png">
<template v-slot:img="{ props }">
<v-img
v-bind="props"
:gradient="gradient"
></v-img>
</template>
<v-app-bar-nav-icon to='/'>
<img src='/logo.png' height='40' />
</v-app-bar-nav-icon>
<v-list-item class='align-self-end' two-line>
<v-list-item-content>
<h4 v-text='settings.title'></h4>
<v-list-item-subtitle v-text='settings.description'></v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
//- logo, title and description
v-list-item(:to='$route.name==="index"?"/about":"/"')
v-list-item-avatar.ma-xs-1(tile)
img(src='/logo.png' height='40')
v-list-item-content
v-list-item-title.d-flex
h2 {{settings.title}}
v-list-item-subtitle.d-none.d-sm-flex {{settings.description}}
v-spacer <client-only>
v-btn(v-if='loggedIn || settings.allow_anon_event' icon nuxt to='/add' :aria-label='$t("common.add_event")' :title='$t("common.add_event")') <v-menu offset-y transition="slide-y-transition">
v-icon(large color='primary' v-text='mdiPlus') <template v-slot:activator="{ on, attrs }">
<v-btn icon v-bind='attrs' v-on='on' aria-label='Language' v-text="$i18n.locale" />
</template>
<v-list>
<v-list-item v-for='locale in $i18n.locales' @click.prevent.stop="$i18n.setLocale(locale.code)" :key='locale.code'>
<v-list-item-content>
<v-list-item-title v-text='locale.name' />
</v-list-item-content>
</v-list-item>
<v-list-item nuxt target='_blank' href='https://hosted.weblate.org/engage/gancio/'>
<v-list-item-content>
<v-list-item-subtitle v-text='$t("common.help_translate")' />
</v-list-item-content>
</v-list-item>
</v-list>
</v-menu>
<v-btn slot='placeholder' icon arial-label='Language'>{{$i18n.locale}}</v-btn>
</client-only>
v-btn(icon nuxt to='/export' :title='$t("common.share")' :aria-label='$t("common.share")') <client-only>
v-icon(v-text='mdiShareVariant') <v-menu v-if='loggedIn' offset-y transition="slide-y-transition">
<template v-slot:activator="{ on, attrs }">
<v-btn class='mr-0' icon v-bind='attrs' v-on='on' title='Menu' aria-label='Menu'>
<v-icon v-text='mdiDotsVertical' />
</v-btn>
</template>
<v-list>
<v-list-item nuxt to='/settings'>
<v-list-item-icon><v-icon v-text='mdiCog'></v-icon></v-list-item-icon>
<v-list-item-content>
<v-list-item-title v-text="$t('common.settings')"/>
</v-list-item-content>
</v-list-item>
v-btn(v-if='!loggedIn' icon nuxt to='/login' :title='$t("common.login")' :aria-label='$t("common.login")') <v-list-item v-if='$auth.user.is_admin' nuxt to='/admin'>
v-icon(v-text='mdiLogin') <v-list-item-icon>
<v-icon v-text='mdiAccount' />
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title v-text="$t('common.admin')" />
</v-list-item-content>
</v-list-item>
client-only <v-list-item @click='logout'>
v-menu(v-if='loggedIn' offset-y transition="slide-y-transition") <v-list-item-icon>
template(v-slot:activator="{ on, attrs }") <v-icon v-text='mdiLogout' />
v-btn(icon v-bind='attrs' v-on='on' title='Menu' aria-label='Menu') </v-list-item-icon>
v-icon(v-text='mdiDotsVertical')
v-list
v-list-item(nuxt to='/settings')
v-list-item-icon
v-icon(v-text='mdiCog')
v-list-item-content
v-list-item-title {{$t('common.settings')}}
v-list-item(v-if='$auth.user.is_admin' nuxt to='/admin') <v-list-item-content>
v-list-item-icon <v-list-item-title v-text="$t('common.logout')" />
v-icon(v-text='mdiAccount') </v-list-item-content>
v-list-item-content </v-list-item>
v-list-item-title {{$t('common.admin')}} </v-list>
</v-menu>
<template #placeholder>
<v-btn v-if='loggedIn' icon aria-label='Menu' title='Menu'>
<v-icon v-text='mdiDotsVertical' />
</v-btn>
</template>
</client-only>
v-list-item(@click='logout') <!-- login button -->
v-list-item-icon <v-btn class='mr-0' v-if='!loggedIn' icon nuxt to='/login' :title='$t("common.login")' :aria-label='$t("common.login")'>
v-icon(v-text='mdiLogout') <v-icon v-text='mdiLogin' />
v-list-item-content </v-btn>
v-list-item-title {{$t('common.logout')}}
template(#placeholder)
v-btn(v-if='loggedIn' icon aria-label='Menu' title='Menu')
v-icon(v-text='mdiDotsVertical')
client-only <!-- <nuxt-link v-if='loggedIn || settings.allow_anon_event' link text nuxt to='/add' :aria-label='$t("common.add_event")' :title='$t("common.add_event")'>
v-menu(offset-y transition="slide-y-transition" min-width='200px' max-height='400px') <v-icon large v-text='mdiPlus' />
template(v-slot:activator="{ on, attrs }") <small v-text="$t('common.add_event')" />
v-btn(icon v-bind='attrs' v-on='on' aria-label='Language') {{$i18n.locale}} </nuxt-link> -->
v-list
v-list-item(v-for='locale in $i18n.locales' @click.prevent.stop="$i18n.setLocale(locale.code)" :key='locale.code')
v-list-item-content
v-list-item-title {{locale.name}}
v-list-item(nuxt target='_blank' href='https://hosted.weblate.org/engage/gancio/')
v-list-item-content
v-list-item-subtitle(v-text='$t("common.help_translate")')
template(#placeholder)
v-btn(icon aria-label='Language') {{$i18n.locale}}
v-btn(icon target='_blank' :href='`${settings.baseurl}/feed/rss`' title='RSS' aria-label='RSS') <!-- //- v-btn(icon nuxt to='/export' :title='$t("common.share")' :aria-label='$t("common.share")')
v-icon(color='orange' v-text='mdiRss') //- v-icon(v-text='mdiShareVariant')
//- v-btn(v-if='!loggedIn' icon nuxt to='/login' :title='$t("common.login")' :aria-label='$t("common.login")')
//- v-icon(v-text='mdiLogin')
//- client-only
//- v-menu(offset-y transition="slide-y-transition" min-width='200px' max-height='400px')
//- template(v-slot:activator="{ on, attrs }")
//- v-btn(icon v-bind='attrs' v-on='on' aria-label='Language') {{$i18n.locale}}
//- v-list
//- v-list-item(v-for='locale in $i18n.locales' @click.prevent.stop="$i18n.setLocale(locale.code)" :key='locale.code')
//- v-list-item-content
//- v-list-item-title {{locale.name}}
//- v-list-item(nuxt target='_blank' href='https://hosted.weblate.org/engage/gancio/')
//- v-list-item-content
//- v-list-item-subtitle(v-text='$t("common.help_translate")')
//- template(#placeholder)
//- v-btn(icon aria-label='Language') {{$i18n.locale}}
//- v-btn(icon target='_blank' :href='`${settings.baseurl}/feed/rss`' title='RSS' aria-label='RSS')
//- v-icon(color='orange' v-text='mdiRss') -->
<!--
<v-menu left bottom>
<template v-slot:activator="{ on, attrs }">
<v-btn icon v-bind="attrs" v-on="on">
<v-icon>mdi-dots-vertical</v-icon>
</v-btn>
</template>
</v-menu> -->
<!-- .v-application--is-ltr .v-tabs--align-with-title > .v-tabs-bar:not(.v-tabs-bar--show-arrows):not(.v-slide-group--is-overflowing) > .v-slide-group__wrapper > .v-tabs-bar__content > .v-tab:first-child,
.v-application--is-ltr .v-tabs--align-with-title > .v-tabs-bar:not(.v-tabs-bar--show-arrows):not(.v-slide-group--is-overflowing) > .v-slide-group__wrapper > .v-tabs-bar__content > .v-tabs-slider-wrapper + .v-tab -->
<template v-slot:extension>
<v-tabs dense icons-and-text :align-with-title='$vuetify.breakpoint.smAndUp' optional>
<v-tab to='/'>
<span class='d-none d-sm-flex'>Home</span>
<v-icon v-text='mdiHome' />
</v-tab>
<v-tab v-if='loggedIn || settings.allow_anon_event' to='/add'>
<span class='d-none d-sm-flex'>{{$t('common.add_event')}}</span>
<v-icon color='primary' v-text='mdiPlus' />
</v-tab>
<v-tab to='/export' >
<span class='d-none d-sm-flex'>{{$t('common.share')}}</span>
<v-icon v-text='mdiShareVariant' />
</v-tab>
<v-tab to='/about'>
<span class='d-none d-sm-flex'>About</span>
<v-icon v-text='mdiInformation' />
</v-tab>
</v-tabs>
</template>
</v-app-bar>
<!-- //- v-app-bar(app aria-label='Menu' height=64)
//- //- logo, title and description
//- v-list-item(:to='$route.name==="index"?"/about":"/"')
//- v-list-item-avatar.ma-xs-1(tile)
//- img(src='/logo.png' height='40')
//- v-list-item-content
//- v-list-item-title.d-flex
//- h2 {{settings.title}}
//- v-list-item-subtitle.d-none.d-sm-flex {{settings.description}}
//- v-spacer
//- v-btn(v-if='loggedIn || settings.allow_anon_event' icon nuxt to='/add' :aria-label='$t("common.add_event")' :title='$t("common.add_event")')
//- v-icon(large color='primary' v-text='mdiPlus')
//- v-btn(icon nuxt to='/export' :title='$t("common.share")' :aria-label='$t("common.share")')
//- v-icon(v-text='mdiShareVariant')
//- v-btn(v-if='!loggedIn' icon nuxt to='/login' :title='$t("common.login")' :aria-label='$t("common.login")')
//- v-icon(v-text='mdiLogin')
//- client-only
//- v-menu(v-if='loggedIn' offset-y transition="slide-y-transition")
//- template(v-slot:activator="{ on, attrs }")
//- v-btn(icon v-bind='attrs' v-on='on' title='Menu' aria-label='Menu')
//- v-icon(v-text='mdiDotsVertical')
//- v-list
//- v-list-item(nuxt to='/settings')
//- v-list-item-icon
//- v-icon(v-text='mdiCog')
//- v-list-item-content
//- v-list-item-title {{$t('common.settings')}}
//- v-list-item(v-if='$auth.user.is_admin' nuxt to='/admin')
//- v-list-item-icon
//- v-icon(v-text='mdiAccount')
//- v-list-item-content
//- v-list-item-title {{$t('common.admin')}}
//- v-list-item(@click='logout')
//- v-list-item-icon
//- v-icon(v-text='mdiLogout')
//- v-list-item-content
//- v-list-item-title {{$t('common.logout')}}
//- template(#placeholder)
//- v-btn(v-if='loggedIn' icon aria-label='Menu' title='Menu')
//- v-icon(v-text='mdiDotsVertical')
//- client-only
//- v-menu(offset-y transition="slide-y-transition" min-width='200px' max-height='400px')
//- template(v-slot:activator="{ on, attrs }")
//- v-btn(icon v-bind='attrs' v-on='on' aria-label='Language') {{$i18n.locale}}
//- v-list
//- v-list-item(v-for='locale in $i18n.locales' @click.prevent.stop="$i18n.setLocale(locale.code)" :key='locale.code')
//- v-list-item-content
//- v-list-item-title {{locale.name}}
//- v-list-item(nuxt target='_blank' href='https://hosted.weblate.org/engage/gancio/')
//- v-list-item-content
//- v-list-item-subtitle(v-text='$t("common.help_translate")')
//- template(#placeholder)
//- v-btn(icon aria-label='Language') {{$i18n.locale}}
//- v-btn(icon target='_blank' :href='`${settings.baseurl}/feed/rss`' title='RSS' aria-label='RSS')
//- v-icon(color='orange' v-text='mdiRss') -->
</template> </template>
<script> <script>
const locales = require('../locales/index') const locales = require('../locales/index')
import { mapState } from 'vuex' import { mapState } from 'vuex'
import clipboard from '../assets/clipboard' import clipboard from '../assets/clipboard'
import { mdiPlus, mdiShareVariant, mdiLogin, mdiDotsVertical, mdiLogout, mdiAccount, mdiCog, mdiRss } from '@mdi/js' import { mdiPlus, mdiShareVariant, mdiLogin, mdiDotsVertical, mdiLogout, mdiAccount, mdiCog, mdiRss, mdiHome, mdiInformation } from '@mdi/js'
export default { export default {
name: 'Nav', name: 'Nav',
data () { data () {
return { mdiPlus, mdiShareVariant, mdiLogout, mdiLogin, mdiDotsVertical, mdiAccount, mdiCog, mdiRss, locales } return { mdiPlus, mdiShareVariant, mdiLogout, mdiLogin, mdiDotsVertical, mdiAccount, mdiCog, mdiRss, mdiHome, mdiInformation, locales }
}, },
mixins: [clipboard], mixins: [clipboard],
computed: { computed: {
loggedIn () { loggedIn () {
return this.$auth.loggedIn return this.$auth.loggedIn
}, },
gradient () {
if (this.$vuetify.theme.dark) {
return 'to bottom, rgba(59,0,0,.9), rgba(0,0,0,.9)'
} else {
return 'to bottom, rgba(255,230,230,.95), rgba(250,250,250,.95)'
}
},
...mapState(['settings']), ...mapState(['settings']),
}, },
methods: { methods: {

View File

@@ -31,7 +31,10 @@ module.exports = {
/* /*
** Customize the progress-bar component ** Customize the progress-bar component
*/ */
loading: '~/components/Loading.vue', loading: {
color: 'orangered',
height: '3px'
}, //'~/components/Loading.vue',
/* /*
** Plugins to load before mounting the App ** Plugins to load before mounting the App
*/ */

View File

@@ -109,13 +109,15 @@ export default {
data.event.place.name = event.place.name data.event.place.name = event.place.name
data.event.place.address = event.place.address || '' data.event.place.address = event.place.address || ''
const from = dayjs.unix(event.start_datetime)
const due = event.end_datetime && dayjs.unix(event.end_datetime)
data.date = { data.date = {
recurrent: event.recurrent, recurrent: event.recurrent,
from: dayjs.unix(event.start_datetime).toDate(), from: from.toDate(),
due: event.end_datetime && dayjs.unix(event.end_datetime).toDate(), due: due && due.toDate(),
multidate: event.multidate, multidate: event.multidate,
fromHour: true, fromHour: from.format('HH:mm'),
dueHour: true dueHour: due && due.format('HH:mm')
} }
data.event.title = event.title data.event.title = event.title
@@ -174,14 +176,15 @@ export default {
this.event = Object.assign(this.event, event) this.event = Object.assign(this.event, event)
this.$refs.where.selectPlace({ name: event.place.name || event.place, address: event.place.address }) this.$refs.where.selectPlace({ name: event.place.name || event.place, address: event.place.address })
const from = dayjs.unix(this.event.start_datetime)
const due = this.event.end_datetime && dayjs.unix(this.event.end_datetime)
this.date = { this.date = {
recurrent: this.event.recurrent || null, recurrent: this.event.recurrent || null,
from: dayjs.unix(this.event.start_datetime).toDate(), from: from.toDate(),
due: this.event.end_datetime && dayjs.unix(this.event.end_datetime).toDate(), due: due && due.toDate(),
multidate: event.multidate, multidate: event.multidate,
fromHour: true, fromHour: from.format('HH:mm'),
dueHour: true dueHour: due && due.format('HH:mm')
} }
this.openImportDialog = false this.openImportDialog = false
}, },
@@ -218,9 +221,11 @@ export default {
formData.append('place_address', this.event.place.address) formData.append('place_address', this.event.place.address)
formData.append('description', this.event.description) formData.append('description', this.event.description)
formData.append('multidate', !!this.date.multidate) formData.append('multidate', !!this.date.multidate)
formData.append('start_datetime', dayjs(this.date.from).unix()) let [hour, minute] = this.date.fromHour.split(':')
if (this.date.due) { formData.append('start_datetime', dayjs(this.date.from).hour(Number(hour)).minute(Number(minute)).second(0).unix())
formData.append('end_datetime', dayjs(this.date.due).unix()) if (this.date.dueHour) {
[hour, minute] = this.date.dueHour.split(':')
formData.append('end_datetime', dayjs(this.date.due).hour(Number(hour)).minute(Number(minute)).second(0).unix())
} }
if (this.edit) { if (this.edit) {