cleaning export
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
html, body {
|
html, body {
|
||||||
scrollbar-width: thin;
|
scrollbar-width: thin;
|
||||||
|
scrollbar-color: orange;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<template lang='pug'>
|
<template lang='pug'>
|
||||||
v-card(color='secondary')
|
v-card(:color='isDialog ? "secondary" : null')
|
||||||
v-card-title(v-text="$t('common.follow_me_title')")
|
v-card-title(v-text="$t('common.follow_me_title')")
|
||||||
v-card-text
|
v-card-text
|
||||||
p(v-html="$t('event.follow_me_description', { title: settings.title, account: `@${settings.instance_name}@${domain}`})")
|
p(v-html="$t('event.follow_me_description', { title: settings.title, account: `@${settings.instance_name}@${domain}`})")
|
||||||
@@ -22,9 +22,8 @@ import url from 'url'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'FollowMe',
|
name: 'FollowMe',
|
||||||
props: [
|
props:
|
||||||
{ isDialog: { type: Boolean, default: false }}
|
{ isDialog: { type: Boolean, default: false } },
|
||||||
],
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
instance_hostname: '',
|
instance_hostname: '',
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ div#list
|
|||||||
p(v-if='title') {{title}}
|
p(v-if='title') {{title}}
|
||||||
v-timeline(dense)
|
v-timeline(dense)
|
||||||
v-timeline-item(
|
v-timeline-item(
|
||||||
v-for='event in events'
|
v-for='event in computedEvents'
|
||||||
:key='`${event.id}_${event.start_datetime}`')
|
:key='`${event.id}_${event.start_datetime}`')
|
||||||
div {{event|when}}
|
.text-subtitle {{event|when}}
|
||||||
a(:href='`/event/${event.id}`' target='_blank') {{event.title}}
|
.text-subtitle.float-right @{{event.place.name}}
|
||||||
small.float-right @{{event.place.name}}
|
a.text-h5(:href='`/event/${event.id}`' target='_blank') {{event.title}}
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
@@ -44,6 +44,12 @@ export default {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
computedEvents () {
|
||||||
|
if (!this.maxEvents) { return this.events }
|
||||||
|
return this.events.slice(0, this.maxEvents)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -6,11 +6,6 @@
|
|||||||
:label="$t('event.show_recurrent')"
|
:label="$t('event.show_recurrent')"
|
||||||
@change="v => $emit('showrecurrent', v)")
|
@change="v => $emit('showrecurrent', v)")
|
||||||
|
|
||||||
v-switch.mt-0(
|
|
||||||
v-if='pastFilter' inset color='primary'
|
|
||||||
:label="$t('event.show_past')"
|
|
||||||
@change="v => $emit('showpast', v)")
|
|
||||||
|
|
||||||
v-autocomplete.mt-0(
|
v-autocomplete.mt-0(
|
||||||
:label='$t("common.search")'
|
:label='$t("common.search")'
|
||||||
:items='keywords'
|
:items='keywords'
|
||||||
@@ -36,7 +31,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapState, mapActions } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
export default {
|
export default {
|
||||||
name: 'Search',
|
name: 'Search',
|
||||||
props: {
|
props: {
|
||||||
@@ -51,20 +46,20 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['tags', 'places', , 'settings']),
|
...mapState(['tags', 'places', 'settings']),
|
||||||
selectedFilters () {
|
selectedFilters () {
|
||||||
const tags = this.tags.filter(t => this.filters.tags.includes(t.tag)).map(t => ({ type: 'tag', label: t.tag, weigth: t.weigth, id: t.tag }))
|
const tags = this.tags.filter(t => this.filters.tags.includes(t.tag)).map(t => ({ type: 'tag', label: t.tag, weigth: t.weigth, id: t.tag }))
|
||||||
const places = this.places.filter(p => this.filters.places.includes(p.id))
|
const places = this.places.filter(p => this.filters.places.includes(p.id))
|
||||||
.map(p => ({ type: 'place', label: p.name, weigth: p.weigth, id: p.id }))
|
.map(p => ({ type: 'place', label: p.name, weigth: p.weigth, id: p.id }))
|
||||||
const keywords = tags.concat(places).sort((a, b) => b.weigth - a.weigth)
|
const keywords = tags.concat(places).sort((a, b) => b.weigth - a.weigth)
|
||||||
return keywords
|
return keywords
|
||||||
},
|
},
|
||||||
keywords () {
|
keywords () {
|
||||||
const tags = this.tags.map(t => ({ type: 'tag', label: t.tag, weigth: t.weigth, id: t.tag }))
|
const tags = this.tags.map(t => ({ type: 'tag', label: t.tag, weigth: t.weigth, id: t.tag }))
|
||||||
const places = this.places.map(p => ({ type: 'place', label: p.name, weigth: p.weigth, id: p.id }))
|
const places = this.places.map(p => ({ type: 'place', label: p.name, weigth: p.weigth, id: p.id }))
|
||||||
const keywords = tags.concat(places).sort((a, b) => b.weigth - a.weigth)
|
const keywords = tags.concat(places).sort((a, b) => b.weigth - a.weigth)
|
||||||
return keywords
|
return keywords
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
change (filters) {
|
change (filters) {
|
||||||
@@ -73,7 +68,7 @@ export default {
|
|||||||
places: filters.filter(p => p.type === 'place').map(p => p.id)
|
places: filters.filter(p => p.type === 'place').map(p => p.id)
|
||||||
}
|
}
|
||||||
this.$emit('update', filters)
|
this.$emit('update', filters)
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.navigation-list-item {
|
/* .navigation-list-item {
|
||||||
font-size: 18px !important;
|
font-size: 18px !important;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
}
|
}
|
||||||
@@ -10,3 +10,7 @@ html, body {
|
|||||||
.page-content h1:first-of-type {
|
.page-content h1:first-of-type {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
margin-left: 10px;
|
||||||
|
} */
|
||||||
@@ -165,8 +165,8 @@
|
|||||||
"user_create_ok": "Utente creato",
|
"user_create_ok": "Utente creato",
|
||||||
"allow_registration_description": "Vuoi abilitare la registrazione?",
|
"allow_registration_description": "Vuoi abilitare la registrazione?",
|
||||||
"allow_anon_event": "Si possono inserire eventi anonimi (previa conferma)?",
|
"allow_anon_event": "Si possono inserire eventi anonimi (previa conferma)?",
|
||||||
"allow_recurrent_event": "Abilita eventi fissi",
|
"allow_recurrent_event": "Abilita eventi ricorrenti",
|
||||||
"recurrent_event_visible": "Appuntamenti fissi visibili di default",
|
"recurrent_event_visible": "Appuntamenti ricorrenti visibili di default",
|
||||||
"federation": "Federazione / ActivityPub",
|
"federation": "Federazione / ActivityPub",
|
||||||
"enable_federation": "Abilita la federazione",
|
"enable_federation": "Abilita la federazione",
|
||||||
"enable_federation_help": "Sarà possibile seguire questa istanza dal fediverso",
|
"enable_federation_help": "Sarà possibile seguire questa istanza dal fediverso",
|
||||||
|
|||||||
12
package.json
12
package.json
@@ -39,7 +39,7 @@
|
|||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"cross-env": "^7.0.2",
|
"cross-env": "^7.0.2",
|
||||||
"date-fns": "^2.16.1",
|
"date-fns": "^2.16.1",
|
||||||
"dayjs": "^1.9.5",
|
"dayjs": "^1.9.6",
|
||||||
"dompurify": "^2.2.2",
|
"dompurify": "^2.2.2",
|
||||||
"email-templates": "^7.1.2",
|
"email-templates": "^7.1.2",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
"multer": "^1.4.2",
|
"multer": "^1.4.2",
|
||||||
"nuxt": "^2.14.7",
|
"nuxt": "^2.14.7",
|
||||||
"nuxt-express-module": "^0.0.11",
|
"nuxt-express-module": "^0.0.11",
|
||||||
"pg": "^8.4.2",
|
"pg": "^8.5.0",
|
||||||
"sequelize": "^6.3.5",
|
"sequelize": "^6.3.5",
|
||||||
"sequelize-cli": "^6.2.0",
|
"sequelize-cli": "^6.2.0",
|
||||||
"sharp": "^0.26.2",
|
"sharp": "^0.26.2",
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
"@nuxtjs/eslint-config": "^4.0.0",
|
"@nuxtjs/eslint-config": "^4.0.0",
|
||||||
"@nuxtjs/vuetify": "^1.11.2",
|
"@nuxtjs/vuetify": "^1.11.2",
|
||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
"eslint": "^7.12.1",
|
"eslint": "^7.13.0",
|
||||||
"eslint-config-prettier": "^6.15.0",
|
"eslint-config-prettier": "^6.15.0",
|
||||||
"eslint-config-standard": "^16.0.1",
|
"eslint-config-standard": "^16.0.1",
|
||||||
"eslint-loader": "^4.0.2",
|
"eslint-loader": "^4.0.2",
|
||||||
@@ -88,14 +88,14 @@
|
|||||||
"eslint-plugin-nuxt": "^1.0.0",
|
"eslint-plugin-nuxt": "^1.0.0",
|
||||||
"eslint-plugin-prettier": "^3.1.4",
|
"eslint-plugin-prettier": "^3.1.4",
|
||||||
"eslint-plugin-promise": ">=4.0.1",
|
"eslint-plugin-promise": ">=4.0.1",
|
||||||
"eslint-plugin-standard": "^4.0.2",
|
"eslint-plugin-standard": "^4.1.0",
|
||||||
"eslint-plugin-vue": "^7.1.0",
|
"eslint-plugin-vue": "^7.1.0",
|
||||||
"less-loader": "^7.0.2",
|
"less-loader": "^7.1.0",
|
||||||
"nodemon": "^2.0.6",
|
"nodemon": "^2.0.6",
|
||||||
"prettier": "^2.1.2",
|
"prettier": "^2.1.2",
|
||||||
"pug-plain-loader": "^1.0.0",
|
"pug-plain-loader": "^1.0.0",
|
||||||
"sass": "^1.29.0",
|
"sass": "^1.29.0",
|
||||||
"sass-loader": "^10.0.5",
|
"sass-loader": "^10.1.0",
|
||||||
"vue-cli-plugin-vuetify": "~2.0.7",
|
"vue-cli-plugin-vuetify": "~2.0.7",
|
||||||
"vuetify-loader": "^1.3.0",
|
"vuetify-loader": "^1.3.0",
|
||||||
"webpack-cli": "^4.2.0"
|
"webpack-cli": "^4.2.0"
|
||||||
|
|||||||
@@ -144,6 +144,7 @@ const htmlToText = require('html-to-text')
|
|||||||
export default {
|
export default {
|
||||||
name: 'Event',
|
name: 'Event',
|
||||||
components: { EventAdmin, EmbedEvent, FollowMe },
|
components: { EventAdmin, EmbedEvent, FollowMe },
|
||||||
|
transition: null,
|
||||||
async asyncData ({ $axios, params, error, store }) {
|
async asyncData ({ $axios, params, error, store }) {
|
||||||
try {
|
try {
|
||||||
const event = await $axios.$get(`/event/${params.id}`)
|
const event = await $axios.$get(`/event/${params.id}`)
|
||||||
|
|||||||
146
pages/export.vue
146
pages/export.vue
@@ -1,87 +1,109 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
v-container
|
v-container
|
||||||
p {{$t('export.intro')}}
|
p {{$t('export.intro')}}
|
||||||
//- Search
|
Search(
|
||||||
v-tabs(v-model='type')
|
:filters='filters'
|
||||||
|
@update='updateFilters')
|
||||||
|
v-card(outlined)
|
||||||
|
v-tabs(v-model='type')
|
||||||
|
|
||||||
//- TOFIX
|
//- TOFIX
|
||||||
//- v-tab.pt-1(label='email' name='email')
|
//- v-tab.pt-1(label='email' name='email')
|
||||||
//- v-tab-item
|
//- v-tab-item
|
||||||
//- p(v-html='$t(`export.email_description`)')
|
//- p(v-html='$t(`export.email_description`)')
|
||||||
//- el-form(@submit.native.prevent)
|
//- el-form(@submit.native.prevent)
|
||||||
//- //- el-switch(v-model='notification.notify_on_add' :active-text="$t('notify_on_insert')")
|
//- //- el-switch(v-model='notification.notify_on_add' :active-text="$t('notify_on_insert')")
|
||||||
//- //- br
|
//- //- br
|
||||||
//- //- el-switch.mt-2(v-model='notification.send_notification' :active-text="$t('send_notification')")
|
//- //- el-switch.mt-2(v-model='notification.send_notification' :active-text="$t('send_notification')")
|
||||||
//- el-input.mt-2(v-model='notification.email' :placeholder="$t('export.insert_your_address')" ref='email')
|
//- el-input.mt-2(v-model='notification.email' :placeholder="$t('export.insert_your_address')" ref='email')
|
||||||
//- el-button.mt-2.float-right(native-type= 'submit' type='success' @click='add_notification') {{$t('common.send')}}
|
//- el-button.mt-2.float-right(native-type= 'submit' type='success' @click='add_notification') {{$t('common.send')}}
|
||||||
|
|
||||||
v-tab {{$t('common.feed')}}
|
v-tab {{$t('common.feed')}}
|
||||||
v-tab-item
|
v-tab-item
|
||||||
v-card
|
v-card
|
||||||
v-card-text
|
v-card-text
|
||||||
p(v-html='$t(`export.feed_description`)')
|
p(v-html='$t(`export.feed_description`)')
|
||||||
v-text-field(v-model='link' readonly)
|
v-text-field(v-model='link' readonly)
|
||||||
v-btn(slot='append' plain text color='primary'
|
v-btn(slot='prepend' plain text color='primary'
|
||||||
v-clipboard:copy='link'
|
v-clipboard:copy='link'
|
||||||
v-clipboard:success='copyLink') {{$t("common.copy")}}
|
v-clipboard:success='copyLink') {{$t("common.copy")}}
|
||||||
v-icon.ml-1 mdi-content-copy
|
v-icon.ml-1 mdi-content-copy
|
||||||
|
|
||||||
v-tab(v-if='settings.enable_federation') {{$t('common.fediverse')}}
|
v-tab(v-if='settings.enable_federation') {{$t('common.fediverse')}}
|
||||||
v-tab-item
|
v-tab-item
|
||||||
FollowMe
|
FollowMe
|
||||||
|
|
||||||
v-tab ics/ical
|
v-tab ics/ical
|
||||||
v-tab-item
|
v-tab-item
|
||||||
v-card
|
v-card
|
||||||
v-card-text
|
v-card-text
|
||||||
p(v-html='$t(`export.ical_description`)')
|
p(v-html='$t(`export.ical_description`)')
|
||||||
v-text-field(v-model='link')
|
v-text-field(v-model='link')
|
||||||
v-btn(slot='append' v-clipboard:copy='link' v-clipboard:success='copyLink') {{$t("common.copy")}}
|
v-btn(slot='prepend' plain text color='primary'
|
||||||
|
v-clipboard:copy='link' v-clipboard:success='copyLink') {{$t("common.copy")}}
|
||||||
|
v-icon.ml-1 mdi-content-copy
|
||||||
|
|
||||||
v-tab List
|
v-tab List
|
||||||
v-tab-item
|
v-tab-item
|
||||||
v-container
|
v-container
|
||||||
p(v-html='$t(`export.list_description`)')
|
p(v-html='$t(`export.list_description`)')
|
||||||
|
|
||||||
v-row
|
v-row
|
||||||
v-col.mr-2(:span='11')
|
v-col.mr-2(:span='11')
|
||||||
v-text-field(v-model='list.title') Title
|
v-text-field(v-model='list.title' )
|
||||||
v-col.float-right(:span='12')
|
v-text-field(v-model='list.maxEvents' type='number')
|
||||||
List(
|
v-col.float-right(:span='12')
|
||||||
:title='list.title'
|
List(
|
||||||
:events='filteredEvents')
|
:title='list.title'
|
||||||
v-text-field.mb-1(type='textarea' v-model='listScript' readonly )
|
:maxEvents='list.maxEvents'
|
||||||
v-btn(plain v-clipboard:copy='listScript' v-clipboard:success='copyLink') {{$t('common.copy')}}
|
:events='events')
|
||||||
|
v-text-field.mb-1(type='textarea' v-model='listScript' readonly )
|
||||||
|
v-btn(slot='prepend' plain text
|
||||||
|
color='primary' v-clipboard:copy='listScript' v-clipboard:success='copyLink') {{$t('common.copy')}}
|
||||||
|
v-icon.ml-1 mdi-content-copy
|
||||||
|
|
||||||
//- TOFIX
|
//- TOFIX
|
||||||
//- v-tab.pt-1(label='calendar' name='calendar')
|
//- v-tab.pt-1(label='calendar' name='calendar')
|
||||||
//- v-tab-item
|
//- v-tab-item
|
||||||
//- p(v-html='$t(`export.calendar_description`)')
|
//- p(v-html='$t(`export.calendar_description`)')
|
||||||
//- //- no-ssr
|
//- //- no-ssr
|
||||||
//- Calendar.mb-1
|
//- Calendar.mb-1
|
||||||
//- v-text-field.mb-1(type='textarea' v-model='script')
|
//- v-text-field.mb-1(type='textarea' v-model='script')
|
||||||
//- el-button.float-right(plain type="primary" icon='el-icon-document') Copy
|
//- el-button.float-right(plain type="primary" icon='el-icon-document') Copy
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { mapState, mapGetters } from 'vuex'
|
import dayjs from 'dayjs'
|
||||||
|
import { mapState } from 'vuex'
|
||||||
import List from '@/components/List'
|
import List from '@/components/List'
|
||||||
import FollowMe from '../components/FollowMe'
|
import FollowMe from '../components/FollowMe'
|
||||||
|
import Search from '@/components/Search'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Exports',
|
name: 'Exports',
|
||||||
components: { List, FollowMe },
|
components: { List, FollowMe, Search },
|
||||||
async asyncData ({ $axios, params, store }) {
|
async asyncData ({ $axios, params, store, $api }) {
|
||||||
|
const events = await $api.getEvents({
|
||||||
|
start: dayjs().unix()
|
||||||
|
})
|
||||||
|
return { events }
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
type: 'rss',
|
type: 'rss',
|
||||||
notification: { email: '' },
|
notification: { email: '' },
|
||||||
list: { title: 'Gancio' }
|
list: { title: 'Gancio', maxEvents: 3 },
|
||||||
|
filters: { tags: [], places: [] },
|
||||||
|
events: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
head () {
|
||||||
|
return {
|
||||||
|
title: `${this.settings.title} - ${this.$t('common.export')}`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['filters', 'settings']),
|
...mapState(['settings']),
|
||||||
domain () {
|
domain () {
|
||||||
const URL = url.parse(this.settings.baseurl)
|
const URL = url.parse(this.settings.baseurl)
|
||||||
return URL.hostname
|
return URL.hostname
|
||||||
@@ -123,6 +145,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
updateFilters (filters) {
|
||||||
|
this.filters = filters
|
||||||
|
},
|
||||||
copyLink () {
|
copyLink () {
|
||||||
this.$root.$message('common.feed_url_copied')
|
this.$root.$message('common.feed_url_copied')
|
||||||
},
|
},
|
||||||
@@ -138,11 +163,6 @@ export default {
|
|||||||
imgPath (event) {
|
imgPath (event) {
|
||||||
return event.image_path && event.image_path
|
return event.image_path && event.image_path
|
||||||
}
|
}
|
||||||
},
|
|
||||||
head () {
|
|
||||||
return {
|
|
||||||
title: `${this.settings.title} - ${this.$t('common.export')}`
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
|
|
||||||
export default ({ $axios, store }, inject) => {
|
export default ({ $axios, store }, inject) => {
|
||||||
|
|
||||||
const api = {
|
const api = {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get events
|
* Get events
|
||||||
*
|
*
|
||||||
* filter: {
|
* filter: {
|
||||||
* start_datetime: unix_timestamp (default now)
|
* start_datetime: unix_timestamp (default now)
|
||||||
* end_datetime: unix_timestamp
|
* end_datetime: unix_timestamp
|
||||||
@@ -13,16 +12,18 @@ export default ({ $axios, store }, inject) => {
|
|||||||
* places: [place_id],
|
* places: [place_id],
|
||||||
* limit: (default ∞)
|
* limit: (default ∞)
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
async getEvents (params) {
|
async getEvents (params) {
|
||||||
try {
|
try {
|
||||||
const events = await $axios.$get(`/events`, { params: {
|
const events = await $axios.$get('/events', {
|
||||||
start: params.start,
|
params: {
|
||||||
end: params.end,
|
start: params.start,
|
||||||
places: params.places && params.places.join(','),
|
end: params.end,
|
||||||
tags: params.tags && params.tags.join(',')
|
places: params.places && params.places.join(','),
|
||||||
}} )
|
tags: params.tags && params.tags.join(',')
|
||||||
|
}
|
||||||
|
})
|
||||||
return events
|
return events
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
@@ -31,4 +32,4 @@ export default ({ $axios, store }, inject) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
inject('api', api)
|
inject('api', api)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
const settingsController = require('./api/controller/settings')
|
const settingsController = require('./api/controller/settings')
|
||||||
const acceptLanguage = require('accept-language')
|
const acceptLanguage = require('accept-language')
|
||||||
const moment = require('moment-timezone')
|
const dayjs = require('dayjs')
|
||||||
const config = require('config')
|
const config = require('config')
|
||||||
const debug = require('debug')('helpers')
|
const debug = require('debug')('helpers')
|
||||||
const pkg = require('../package.json')
|
const pkg = require('../package.json')
|
||||||
@@ -66,8 +66,8 @@ module.exports = {
|
|||||||
acceptLanguage.languages(Object.keys(locales))
|
acceptLanguage.languages(Object.keys(locales))
|
||||||
req.settings.locale = acceptLanguage.get(acceptedLanguages)
|
req.settings.locale = acceptLanguage.get(acceptedLanguages)
|
||||||
req.settings.user_locale = settingsController.user_locale[req.settings.locale]
|
req.settings.user_locale = settingsController.user_locale[req.settings.locale]
|
||||||
moment.locale(req.settings.locale)
|
dayjs.locale(req.settings.locale)
|
||||||
moment.tz.setDefault(req.settings.instance_timezone)
|
dayjs.tz.setDefault(req.settings.instance_timezone)
|
||||||
next()
|
next()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -72,21 +72,12 @@ export const actions = {
|
|||||||
const { tags, places } = await this.$axios.$get('/event/meta')
|
const { tags, places } = await this.$axios.$get('/event/meta')
|
||||||
commit('update', { tags, places })
|
commit('update', { tags, places })
|
||||||
},
|
},
|
||||||
async addEvent ({ commit }, formData) {
|
|
||||||
await this.$axios.$post('/event', formData)
|
|
||||||
},
|
|
||||||
async updateEvent ({ commit }, formData) {
|
|
||||||
await this.$axios.$put('/event', formData)
|
|
||||||
},
|
|
||||||
setFilters ({ commit }, filters) {
|
setFilters ({ commit }, filters) {
|
||||||
commit('setFilters', filters)
|
commit('setFilters', filters)
|
||||||
},
|
},
|
||||||
setAnnouncements ({ commit }, announcements) {
|
setAnnouncements ({ commit }, announcements) {
|
||||||
commit('setAnnouncements', announcements)
|
commit('setAnnouncements', announcements)
|
||||||
},
|
},
|
||||||
delEvent ({ commit }, eventId) {
|
|
||||||
commit('delEvent', eventId)
|
|
||||||
},
|
|
||||||
async setSetting ({ commit }, setting) {
|
async setSetting ({ commit }, setting) {
|
||||||
await this.$axios.$post('/settings', setting)
|
await this.$axios.$post('/settings', setting)
|
||||||
commit('setSetting', setting)
|
commit('setSetting', setting)
|
||||||
|
|||||||
Reference in New Issue
Block a user