locale via config
This commit is contained in:
@@ -25,7 +25,7 @@ html, body {
|
||||
// }
|
||||
|
||||
.el-card {
|
||||
max-width: 650px;
|
||||
max-width: 670px;
|
||||
margin: 30px auto;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
el-popover(
|
||||
placement="bottom"
|
||||
trigger="click")
|
||||
Search
|
||||
Search(past-filter)
|
||||
el-menu-item(slot='reference')
|
||||
v-icon(color='lightblue' name='search')
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
<template lang="pug">
|
||||
div.ml-2.mt-1
|
||||
el-switch.mb-1(v-if='$auth.loggedIn'
|
||||
active-text='solo miei'
|
||||
inactive-text='tutti'
|
||||
inactive-color='lightgreen'
|
||||
v-model='onlyMine'
|
||||
)
|
||||
div.ml-2.mt-1.text-center
|
||||
//- el-switch.mb-1(v-if='$auth.loggedIn'
|
||||
//- active-text='solo miei'
|
||||
//- inactive-text='tutti'
|
||||
//- inactive-color='lightgreen'
|
||||
//- v-model='onlyMine'
|
||||
//- )
|
||||
el-switch.mt-1.mb-1.ml-2.d-block(
|
||||
v-if='pastFilter'
|
||||
inactive-text='futuri'
|
||||
active-text='anche passati'
|
||||
inactive-color='lightgreen'
|
||||
@@ -30,6 +31,9 @@ export default {
|
||||
}
|
||||
},
|
||||
name :'Search',
|
||||
props: {
|
||||
pastFilter: Boolean
|
||||
},
|
||||
methods: mapActions(['setSearchPlaces', 'setSearchTags', 'showPastEvents']),
|
||||
computed: {
|
||||
...mapState(['tags', 'places', 'filters', 'show_past_events']),
|
||||
|
||||
@@ -5,5 +5,7 @@
|
||||
"register.request": "register.request",
|
||||
"email.registration": "email.registration",
|
||||
"email.register.subject": "email.register.subject",
|
||||
"email.register": "email.register"
|
||||
"email.register": "email.register",
|
||||
"confirm_email": "confirm_email",
|
||||
"email.confirm": "email.confirm"
|
||||
}
|
||||
@@ -5,5 +5,7 @@
|
||||
"register.request": "register.request",
|
||||
"email.registration": "email.registration",
|
||||
"email.register.subject": "email.register.subject",
|
||||
"email.register": "email.register"
|
||||
"email.register": "email.register",
|
||||
"confirm_email": "confirm_email",
|
||||
"email.confirm": "email.confirm"
|
||||
}
|
||||
@@ -3,5 +3,5 @@
|
||||
"press here": "press here",
|
||||
"email.register.subject": "Richiesta registrazione ricevuta",
|
||||
"email.register": "Abbiamo ricevuto la richiesta di registrazione. La confermeremo quanto prima.\n Ciao",
|
||||
"email.registration": "email.registration"
|
||||
"email.confirm": "Il tuo account su gancio è stato attivato e quindi puoi cominciare a pubblicare eventi"
|
||||
}
|
||||
@@ -5,5 +5,7 @@
|
||||
"register.request": "register.request",
|
||||
"email.registration": "email.registration",
|
||||
"email.register.subject": "email.register.subject",
|
||||
"email.register": "email.register"
|
||||
"email.register": "email.register",
|
||||
"confirm_email": "confirm_email",
|
||||
"email.confirm": "email.confirm"
|
||||
}
|
||||
@@ -38,7 +38,8 @@ module.exports = {
|
||||
env: {
|
||||
baseurl: config.baseurl,
|
||||
title: config.title,
|
||||
description: config.description
|
||||
description: config.description,
|
||||
locale: config.locale
|
||||
},
|
||||
/*
|
||||
** Plugins to load before mounting the App
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<template lang="pug">
|
||||
el-card
|
||||
nuxt-link.float-right(to='/')
|
||||
v-icon(name='times' color='red')
|
||||
el-button
|
||||
v-icon(name='times' color='red')
|
||||
h5 {{edit?$t('common.edit_event'):$t('common.add_event')}}
|
||||
|
||||
el-form(v-loading='loading')
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<template lang="pug">
|
||||
el-card
|
||||
nuxt-link.float-right(to='/')
|
||||
v-icon(name='times' color='red')
|
||||
el-button
|
||||
v-icon(name='times' color='red')
|
||||
h5 {{$t('common.admin')}}
|
||||
|
||||
el-tabs(tabPosition='left' v-model='tab')
|
||||
el-tabs(tabPosition='lef' v-model='tab')
|
||||
|
||||
//- USERS
|
||||
el-tab-pane.pt-1
|
||||
@@ -94,11 +95,11 @@
|
||||
//- el-input(v-model="settings.description")
|
||||
//- el-button(slot='append' @click='associate' :disabled='!mastodon_instance.length') {{$t('common.associate')}}
|
||||
|
||||
el-form(inline @submit.prevent.stop='associatemastodon_instance')
|
||||
span {{$t('admin.mastodon_description')}}
|
||||
el-input(v-model="settings.mastodon_instance")
|
||||
span(slot='prepend') {{$t('admin.mastodon_instance')}}
|
||||
el-button(slot='append' @click='associate' :disabled='!mastodon_instance.length') {{$t('common.associate')}}
|
||||
el-form(inline @submit.native.prevent='associate_mastondon_instance' label-width='140px')
|
||||
p {{$t('admin.mastodon_description')}}
|
||||
el-form-item {{$t('admin.mastodon_instance')}}
|
||||
el-input(v-model="mastodon_instance")
|
||||
el-button(slot='append' native-type='submit' type='success' :disabled='!mastodon_instance.length') {{$t('common.associate')}}
|
||||
|
||||
</template>
|
||||
<script>
|
||||
@@ -125,9 +126,8 @@ export default {
|
||||
events: [],
|
||||
loading: false,
|
||||
settings: {
|
||||
mastodon_instance: '',
|
||||
},
|
||||
settings: {},
|
||||
mastodon_instance: '',
|
||||
tab: "0",
|
||||
open: true
|
||||
}
|
||||
@@ -146,7 +146,7 @@ export default {
|
||||
const events = await $axios.$get('/event/unconfirmed')
|
||||
const settings = await $axios.$get('/settings')
|
||||
|
||||
return { users, events, settings, mastodon_instance: settings && settings.mastodon_auth && settings.mastodon_auth.instance || ''}
|
||||
return { users, events, settings}
|
||||
} catch ( e ) {
|
||||
console.error(e)
|
||||
}
|
||||
@@ -185,28 +185,23 @@ export default {
|
||||
this.tag = { color: tag.color, tag: tag.tag }
|
||||
},
|
||||
async savePlace () {
|
||||
// const place = await api.updatePlace(this.place)
|
||||
const place = await this.$axios.$put('/place', this.place)
|
||||
},
|
||||
async toggle(user) {
|
||||
user.is_active = !user.is_active
|
||||
this.$axios.$put('/user', user)
|
||||
// const newuser = await api.updateUser(user)
|
||||
},
|
||||
async toggleAdmin(user) {
|
||||
user.is_admin = !user.is_admin
|
||||
this.$axios.$put('/user', user)
|
||||
// const newuser = await api.updateUser(user)
|
||||
},
|
||||
async updateColor () {
|
||||
// try {
|
||||
// const newTag = await this.$axios.$put('/tag', this.tag)
|
||||
// } catch (e) {
|
||||
// console.log(e)
|
||||
// }
|
||||
},
|
||||
preview (id) {
|
||||
this.$router.push(`/event/${id}`)
|
||||
},
|
||||
async associate () {
|
||||
if (!this.mastodon_instance) return
|
||||
async associate_mastondon_instance () {
|
||||
if (!this.mastodon_instance) return false
|
||||
|
||||
const url = await this.$axios.$post('/settings/getauthurl', {instance: this.mastodon_instance})
|
||||
setTimeout( () => window.location.href=url, 100);
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
el-card
|
||||
|
||||
nuxt-link.float-right(to='/')
|
||||
v-icon(name='times' color='red')
|
||||
el-button
|
||||
v-icon(name='times' color='red')
|
||||
h5 {{$t('common.export')}}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<template lang="pug">
|
||||
el-card
|
||||
nuxt-link.float-right(to='/')
|
||||
v-icon(name='times' color='red')
|
||||
el-button
|
||||
v-icon(name='times' color='red')
|
||||
h5 {{$t('common.settings')}}
|
||||
|
||||
//- el-form
|
||||
@@ -34,10 +35,6 @@ export default {
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
close (done) {
|
||||
this.$router.back()
|
||||
done()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Vue from 'vue'
|
||||
import moment from 'dayjs'
|
||||
import 'dayjs/locale/it'
|
||||
moment.locale('it')
|
||||
moment.locale(process.env.locale)
|
||||
|
||||
function short_hour(datetime) {
|
||||
if (datetime.minute() === 0) {
|
||||
|
||||
@@ -8,18 +8,10 @@ export default ({ app, store }) => {
|
||||
// Set i18n instance on app
|
||||
// This way we can use it in middleware and pages asyncData/fetch
|
||||
app.i18n = new VueI18n({
|
||||
locale: store.state.locale,
|
||||
fallbackLocale: 'it',
|
||||
locale: process.env.locale,
|
||||
fallbackLocale: process.env.locale,
|
||||
messages: {
|
||||
it
|
||||
}
|
||||
})
|
||||
|
||||
// app.i18n.path = (link) => {
|
||||
// if (app.i18n.locale === app.i18n.fallbackLocale) {
|
||||
// return `/${link}`
|
||||
// }
|
||||
|
||||
// return `/${app.i18n.locale}/${link}`
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@ const fs = require('fs')
|
||||
const path = require('path')
|
||||
const moment = require('moment')
|
||||
const { event: Event, comment: Comment } = require('../models')
|
||||
const config = require('../../config').SHARED_CONF
|
||||
const config = require('../../config')
|
||||
const Mastodon = require('mastodon-api')
|
||||
const settingsController = require('./settings')
|
||||
moment.locale('it')
|
||||
moment.locale(process.env.locale)
|
||||
|
||||
const botController = {
|
||||
bot: null,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
p= t('confirm_email')
|
||||
p= t('email.confirm')
|
||||
|
||||
hr
|
||||
small #{config.baseurl}
|
||||
|
||||
Reference in New Issue
Block a user