refactoring with vuetify

This commit is contained in:
les 2020-07-31 01:03:19 +02:00
parent 24a99d0eb0
commit 3f49c915ab
25 changed files with 686 additions and 1071 deletions

View file

@ -4,7 +4,6 @@
title-position='left' title-position='left'
:is-dark="settings['theme.is_dark']" :is-dark="settings['theme.is_dark']"
@update:from-page='updatePage' @update:from-page='updatePage'
:columns="$screens({ default: 1, lg: 2 })"
:locale='$i18n.locale' :locale='$i18n.locale'
:attributes='attributes' :attributes='attributes'
transition='fade' transition='fade'
@ -84,7 +83,6 @@ export default {
</script> </script>
<style> <style>
.vc-opacity-0 { .vc-opacity-0 {
opacity: 0.3 !important; opacity: 0.3 !important;
} }

View file

@ -108,7 +108,7 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.event { .event {
width: 300px; width: 330px;
max-width: 450px; max-width: 450px;
flex-grow: 1; flex-grow: 1;
margin: .2em; margin: .2em;

View file

@ -3,7 +3,7 @@
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}`})")
v-text-field(v-model='instance_hostname' ref='instance') v-text-field(v-model='instance_hostname' ref='instance')
a(slot='append' :href='link' target='_blank') a(slot='append' :href='link' target='_blank')
v-btn(:disabled='(!couldGo || !proceed)' plain type="primary" icon='el-icon-document') {{$t("common.follow")}} v-btn(:disabled='(!couldGo || !proceed)' plain type="primary") {{$t("common.follow")}}
p.mt-2 <img class='instance_thumb' :src="instance.thumbnail"/> {{instance.title}} p.mt-2 <img class='instance_thumb' :src="instance.thumbnail"/> {{instance.title}}
</template> </template>
<script> <script>

View file

@ -2,7 +2,7 @@
v-container#home(fluid) v-container#home(fluid)
Announcement(v-for='announcement in announcements' :key='`a_${announcement.id}`' :announcement='announcement') Announcement(v-for='announcement in announcements' :key='`a_${announcement.id}`' :announcement='announcement')
#calbar.row.mt-2.mb-2 #calbar.row.mt-2.mb-2
.col-xl-7.col-lg-7.col-sm-6.col-xs-12 .col-xl-5.col-lg-5.col-sm-5.col-xs-12
client-only client-only
Calendar Calendar
@ -50,16 +50,11 @@ export default {
} }
</script> </script>
<style lang='less'> <style lang='less'>
// #calbar { #home {
// max-width: 1000px; max-width: 1400px;
// // margin: 0 auto; }
// }
// #home {
// max-width: 1600px;
// }
#events { #events {
max-width: 1600px;
margin: 0 auto; margin: 0 auto;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;

View file

@ -51,23 +51,4 @@ export default {
#list { #list {
max-width: 500px; max-width: 500px;
margin: 0 auto; margin: 0 auto;
.el-timeline {
padding-left: 5px;
hr {
margin-top: 4px;
margin-bottom: 4px;
}
}
.el-timeline-item {
padding-bottom: 1px;
}
.el-timeline-item__timestamp {
margin: 0px;
padding: 0px;
}
}
</style> </style>

View file

@ -68,54 +68,6 @@
v-btn(icon v-clipboard:copy='feedLink' v-clipboard:success='copyLink') v-btn(icon v-clipboard:copy='feedLink' v-clipboard:success='copyLink')
v-icon(color='orange') mdi-rss v-icon(color='orange') mdi-rss
//- el-menu-item(type='text' v-clipboard:copy='feedLink' v-clipboard:success='copyLink')
//- v-icon(color='orange' name='rss')
//- el-header#header
//- img(src='/favicon.ico')
//- span.ml-1.hidden-xs-only {{settings.title}}
//- small.hidden-sm-only {{settings.description}}
//- el-menu#menu(mode='horizontal' router )
//- el-menu-item(v-if='could_add' index='/add')
//- i.el-icon-plus
//- span.hidden-xs-only {{$t('common.add_event')}}
//- //- nuxt-link(to='/export')
//- el-menu-item(index='/export')
//- i.el-icon-share
//- span.hidden-xs-only {{$t('common.share')}}
//- el-submenu(v-if='settings.enable_trusted_instances && settings.trusted_instances && settings.trusted_instances.length' index=4)
//- template(slot='title')
//- i.el-icon-guide
//- span.hidden-xs-only {{$t('common.places')}}
//- el-menu-item(v-for='instance in settings.trusted_instances' :key='instance.name')
//- a(:href='instance.url' target='_link')
//- img.mr-1(:src='`${instance.url}/favicon.ico`' style='height: 25px;')
//- span.ml-1 {{instance.label || instance.name}}
//- el-menu-item(v-if='!$auth.loggedIn' index='/login')
//- i.el-icon-user
//- span.hidden-xs-only {{$t('common.login')}}
//- el-submenu(v-if='$auth.loggedIn' index=3)
//- template(slot='title')
//- i.el-icon-user
//- span.hidden-xs-only {{$t('common.user')}}
//- el-menu-item(divided index='/settings')
//- i.el-icon-s-tools
//- span {{$t('common.settings')}}
//- el-menu-item(v-if='$auth.user.is_admin' index='/admin')
//- i.el-icon-s-operation
//- span {{$t('common.admin')}}
//- el-menu-item(@click='logout')
//- i.el-icon-switch-button
//- span {{$t('common.logout')}}
//- el-menu-item(type='text' v-clipboard:copy='feedLink' v-clipboard:success='copyLink')
//- v-icon(color='orange' name='rss')
</template> </template>
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
@ -146,12 +98,12 @@ export default {
}, },
methods: { methods: {
copyLink () { copyLink () {
this.$root.$emit('message', { this.$root.$message({
message: this.$t('common.feed_url_copied') message: this.$t('common.feed_url_copied')
}) })
}, },
logout () { logout () {
this.$root.$emit('message', { this.$root.$message({
message: this.$t('common.logout_ok') message: this.$t('common.logout_ok')
}) })
this.$auth.logout() this.$auth.logout()
@ -172,8 +124,7 @@ export default {
this.setSetting({ key: 'trusted_instances', value: this.settings.trusted_instances.concat(trusted_instance) }) this.setSetting({ key: 'trusted_instances', value: this.settings.trusted_instances.concat(trusted_instance) })
} catch (e) { } catch (e) {
console.error(e) console.error(e)
Message({ this.$root.$message({
showClose: true,
type: 'error', type: 'error',
message: e message: e
}) })
@ -182,34 +133,3 @@ export default {
} }
} }
</script> </script>
<style lang='less'>
// #header {
// display: inline;
// #logo {
// img {
// max-height: 60px;
// }
// float: left;
// line-height: 60px;
// color: white;
// font-size: 1.5em;
// font-weight: 600;
// text-decoration: none;
// small {
// font-size: 0.5em;
// }
// }
// #menu {
// position: absolute;
// right: 10px;
// top: 0px;
// border-bottom: none;
// .el-menu-item {
// padding: 0px 15px;
// }
// }
// }
</style>

View file

@ -11,19 +11,38 @@
:label="$t('event.show_past')" :label="$t('event.show_past')"
v-model='showPast') v-model='showPast')
v-autocomplete#searchInput.mt-0(:placeholder='$t("common.filter")' p {{filter}}
v-model='search' :debounce='200' v-autocomplete.mt-0(
:fetch-suggestions='querySearch' clearable :label='$t("common.filter")'
@select='addFilter') :items='keywords'
template(slot-scope='{ item }') v-model='filter'
span.float-left {{ item.label }} :search-input.sync='search'
i.float-right.el-icon-place(v-if='item.type==="place"') item-text='label'
i.float-right.el-icon-collection-tag(v-if='item.type==="tag"') chips
#filters multiple
v-vtn.mr-1.bg-dark(type='text' round plain v-for='t in filters.tags' size='mini' )
:key='t' @click='removeTag(t)') {{t}} template(v-slot:selection="data")
v-btn.mr-1.bg-dark.text-warning(type='text' round plain v-for='p in selectedPlaces' size='mini' v-chip(v-bind="data.attrs"
:key='p.id' @click='removePlace(p.id)') {{p.name}} :input-value="data.selected"
close
@click="data.select"
@click:close="remove(data.item)")
v-avatar(left)
v-icon
//- <v-img :src="data.item.avatar"></v-img>
//- </v-avatar>
span {{ data.item.name }}
template(v-slot:item='{ item }')
v-list-item-content
v-list-item-title(v-text='item.label')
//- span.float-left {{ item.label }}
//- i.float-right.el-icon-place(v-if='item.type==="place"')
//- i.float-right.el-icon-collection-tag(v-if='item.type==="tag"')
//- #filters
//- v-vtn.mr-1.bg-dark(type='text' round plain v-for='t in filters.tags' size='mini'
//- :key='t' @click='removeTag(t)') {{t}}
//- v-btn.mr-1.bg-dark.text-warning(type='text' round plain v-for='p in selectedPlaces' size='mini'
//- :key='p.id' @click='removePlace(p.id)') {{p.name}}
</template> </template>
<script> <script>
@ -36,14 +55,15 @@ export default {
}, },
data () { data () {
return { return {
filter: null,
search: '' search: ''
} }
}, },
computed: { computed: {
...mapState(['tags', 'places', 'filters', 'settings']), ...mapState(['tags', 'places', 'filters', 'settings']),
selectedPlaces () { // selectedPlaces () {
return this.places.filter(p => this.filters.places.includes(p.id)) // return this.places.filter(p => this.filters.places.includes(p.id))
}, // },
keywords () { keywords () {
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))
@ -58,10 +78,10 @@ export default {
showRecurrent: { showRecurrent: {
set (value) { this.showRecurrentEvents(value) }, set (value) { this.showRecurrentEvents(value) },
get () { return this.filters.show_recurrent_events } get () { return this.filters.show_recurrent_events }
},
filter () {
return this.filters.tags.concat(this.filters.places)
} }
// filter () {
// return this.filters.tags.concat(this.filters.places)
// }
}, },
methods: { methods: {
...mapActions(['setSearchPlaces', 'setSearchTags', ...mapActions(['setSearchPlaces', 'setSearchTags',

View file

@ -1,6 +1,7 @@
<template lang="pug"> <template lang="pug">
v-container v-card
v-card-title {{$t('common.settings')}}
v-card-text
//- select timezone //- select timezone
v-autocomplete(v-model='instance_timezone' v-autocomplete(v-model='instance_timezone'
:label="$t('admin.select_instance_timezone')" :label="$t('admin.select_instance_timezone')"

View file

@ -1,6 +1,8 @@
<template lang="pug"> <template lang="pug">
v-container v-card
v-card-title {{$t('common.theme')}}
v-card-text
p {{settings['theme.primary']}}
//- LOGO //- LOGO
v-file-input.mt-5(ref='upload' v-file-input.mt-5(ref='upload'
:label="$t('admin.favicon')" :label="$t('admin.favicon')"
@ -15,11 +17,27 @@
inset inset
:label="$t('admin.is_dark')") :label="$t('admin.is_dark')")
v-row
v-col
v-menu(v-model='primaryMenu'
:close-on-content-click="false"
transition="slide-x-transition"
offset-y
absolute
bottom
max-width="290px"
min-width="290px")
template(v-slot:activator='{ on }')
v-text-field(
:label="$t('event.from')"
:value='primary_color'
v-on='on'
clearable
readonly)
v-color-picker( v-color-picker(
mode='hexa' mode='hexa'
:label="$t('common.primary_color')" :label="$t('common.primary_color')"
v-model='primary_color') v-model='primary_color')
</template> </template>
<script> <script>
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
@ -27,7 +45,8 @@ export default {
name: 'Theme', name: 'Theme',
data () { data () {
return { return {
logoKey: 0 logoKey: 0,
primaryMenu: false
} }
}, },
computed: { computed: {
@ -43,13 +62,12 @@ export default {
get () { return this.settings['theme.primary'] }, get () { return this.settings['theme.primary'] },
set (value) { set (value) {
if (!value) { return } if (!value) { return }
this.setSetting({ key: 'theme.primary', value })
if (this.settings['theme.is_dark']) { if (this.settings['theme.is_dark']) {
this.$vuetify.theme.themes.dark.primary = value this.$vuetify.theme.themes.dark.primary = value
} else { } else {
this.$vuetify.theme.themes.light.primary = value this.$vuetify.theme.themes.light.primary = value
} }
// this.$vuetify.theme.themes.light.primary = value.hex
// this.setSetting({ key: 'theme.primary', value: value.hex })
} }
} }
}, },

View file

@ -5,7 +5,7 @@
Nav Nav
v-main(app) v-main(app)
v-scroll-y-transition(hide-on-leave) v-fade-transition(hide-on-leave)
nuxt nuxt
Footer Footer
@ -26,6 +26,7 @@ export default {
created () { created () {
this.$vuetify.theme.dark = this.settings['theme.is_dark'] this.$vuetify.theme.dark = this.settings['theme.is_dark']
this.$vuetify.theme.themes.dark.primary = this.settings['theme.primary'] this.$vuetify.theme.themes.dark.primary = this.settings['theme.primary']
this.$vuetify.theme.themes.light.primary = this.settings['theme.primary']
} }
} }
</script> </script>

View file

@ -1,7 +1,7 @@
<template lang='pug'> <template lang='pug'>
v-container.p-4.text-center#error v-container.p-4.text-center
h1(v-if="error.statusCode === 404") <i class='el-icon-warning'></i> {{error.message}} v-alert(v-if="error.statusCode === 404") ¯\_()_/¯ {{error.message}}
h1(v-else) <i name='el-icon-warning'></i> An error occurred: {{error.message}} v-calert(v-else) <i>warning</i> An error occurred: {{error.message}}
nuxt-link(to='/') Back to home nuxt-link(to='/') Back to home
</template> </template>
@ -16,10 +16,3 @@ export default {
} }
} }
</script> </script>
<style lang="less">
#error {
margin-top: 20px;
color: orange;
i { color: orangered }
}
</style>

View file

@ -80,7 +80,9 @@
"delete": "Elimina", "delete": "Elimina",
"announcements": "Annunci", "announcements": "Annunci",
"url": "Indirizzo URL", "url": "Indirizzo URL",
"place": "Luogo" "place": "Luogo",
"tags": "Tags",
"theme": "Tema"
}, },
"login": { "login": {
"description": "Entrando puoi pubblicare nuovi eventi.", "description": "Entrando puoi pubblicare nuovi eventi.",

View file

@ -24,13 +24,14 @@ module.exports = {
/* /*
** Global CSS ** Global CSS
*/ */
// css: [ css: [
'@mdi/font/css/materialdesignicons.css'
// 'bootstrap/dist/css/bootstrap.min.css', // 'bootstrap/dist/css/bootstrap.min.css',
// 'element-ui/lib/theme-chalk/index.css', // 'element-ui/lib/theme-chalk/index.css',
// 'element-ui/lib/theme-chalk/display.css', // 'element-ui/lib/theme-chalk/display.css',
// '@/assets/theme/index.css' // '@/assets/theme/index.css'
// '@/assets/style.less' // '@/assets/style.less'
// ], ],
/* /*
** Plugins to load before mounting the App ** Plugins to load before mounting the App
@ -98,6 +99,7 @@ module.exports = {
'@nuxtjs/vuetify' '@nuxtjs/vuetify'
], ],
vuetify: { vuetify: {
defaultAssets: false,
optionsPath: './vuetify.options.js' optionsPath: './vuetify.options.js'
/* module options */ /* module options */
}, },

View file

@ -33,16 +33,14 @@
"axios": "^0.19.2", "axios": "^0.19.2",
"bcryptjs": "^2.4.3", "bcryptjs": "^2.4.3",
"body-parser": "^1.18.3", "body-parser": "^1.18.3",
"bootstrap": "^4.5.0",
"config": "^3.3.1", "config": "^3.3.1",
"consola": "^2.13.0", "consola": "^2.13.0",
"cookie-parser": "^1.4.5", "cookie-parser": "^1.4.5",
"cors": "^2.8.5", "cors": "^2.8.5",
"cross-env": "^7.0.2", "cross-env": "^7.0.2",
"date-fns": "^2.15.0", "date-fns": "^2.15.0",
"dayjs": "^1.8.30", "dayjs": "^1.8.31",
"dompurify": "^2.0.11", "dompurify": "^2.0.11",
"element-ui": "^2.13.2",
"email-templates": "^7.1.0", "email-templates": "^7.1.0",
"express": "^4.17.1", "express": "^4.17.1",
"express-oauth-server": "^2.0.0", "express-oauth-server": "^2.0.0",
@ -58,26 +56,25 @@
"moment-timezone": "^0.5.31", "moment-timezone": "^0.5.31",
"morgan": "^1.10.0", "morgan": "^1.10.0",
"multer": "^1.4.2", "multer": "^1.4.2",
"nominatim-geocoder": "^0.1.4", "nuxt": "^2.14.0",
"nuxt": "^2.13.3",
"nuxt-express-module": "^0.0.11", "nuxt-express-module": "^0.0.11",
"pg": "^8.3.0", "pg": "^8.3.0",
"sequelize": "^6.3.3", "sequelize": "^6.3.3",
"sequelize-cli": "^6.2.0", "sequelize-cli": "^6.2.0",
"sharp": "^0.25.4", "sharp": "^0.25.4",
"sqlite3": "^5.0.0", "sqlite3": "^5.0.0",
"tiptap": "^1.29.1", "tiptap": "^1.29.3",
"tiptap-extensions": "^1.31.1", "tiptap-extensions": "^1.31.3",
"to-ico": "^1.1.5", "to-ico": "^1.1.5",
"url": "^0.11.0", "url": "^0.11.0",
"v-calendar": "^1.0.8", "v-calendar": "^1.0.8",
"vue-awesome": "^4.1.0",
"vue-clipboard2": "^0.3.1", "vue-clipboard2": "^0.3.1",
"vue-i18n": "^8.18.2", "vue-i18n": "^8.20.0",
"yargs": "^15.4.1" "yargs": "^15.4.1"
}, },
"devDependencies": { "devDependencies": {
"@nuxtjs/eslint-config": "^3.0.0", "@mdi/font": "^5.4.55",
"@nuxtjs/eslint-config": "^3.1.0",
"@nuxtjs/vuetify": "^1.11.2", "@nuxtjs/vuetify": "^1.11.2",
"babel-eslint": "^10.1.0", "babel-eslint": "^10.1.0",
"eslint": "^7.5.0", "eslint": "^7.5.0",
@ -124,8 +121,5 @@
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://framagit.org/les/gancio" "url": "https://framagit.org/les/gancio"
},
"resolutions": {
"prosemirror-model": "1.10.0"
} }
} }

View file

@ -52,7 +52,6 @@
</template> </template>
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
import { Message } from 'element-ui'
import Users from '../components/admin/Users' import Users from '../components/admin/Users'
import Places from '../components/admin/Places' import Places from '../components/admin/Places'
import Settings from '../components/admin/Settings' import Settings from '../components/admin/Settings'
@ -99,9 +98,8 @@ export default {
this.loading = true this.loading = true
await this.$axios.$get(`/event/confirm/${id}`) await this.$axios.$get(`/event/confirm/${id}`)
this.loading = false this.loading = false
Message({ this.$root.$message({
message: this.$t('event.confirmed'), message: this.$t('event.confirmed'),
showClose: true,
type: 'success' type: 'success'
}) })
this.events = this.events.filter(e => e.id !== id) this.events = this.events.filter(e => e.id !== id)

View file

@ -19,19 +19,24 @@
:placeholder='$t("common.password")') :placeholder='$t("common.password")')
v-card-actions v-card-actions
v-spacer v-btn(text
v-btn(text @click='forgot' small) {{$t('login.forgot_password')}} tabindex="1"
@click='forgot' small) {{$t('login.forgot_password')}}
v-card-actions v-card-actions
v-btn(color='success' v-spacer
:disabled='!valid'
@click='submit') {{$t('common.login')}}
v-btn(v-if='settings.allow_registration' v-btn(v-if='settings.allow_registration'
to='/register' to='/register'
text text
tabindex="1"
color='orange') {{$t('login.not_registered')}} color='orange') {{$t('login.not_registered')}}
v-btn(color='success'
tabindex="0"
:disabled='!valid || loading' :loading='loading'
@click='submit') {{$t('common.login')}}
</template> </template>
<script> <script>

View file

@ -1,6 +1,6 @@
<template lang='pug'> <template lang='pug'>
v-row.mt-5(align='center' justify='center') v-row.mt-5(align='center' justify='center')
v-col(cols='12' sm='10' md="6") v-col(cols='12' md="6" lg="5" xl="4")
v-card v-card
v-card-title {{$t('common.register')}} v-card-title {{$t('common.register')}}
@ -24,7 +24,9 @@
v-card-actions v-card-actions
v-spacer v-spacer
v-btn(@click='register' :disabled='!valid' color='primary') {{$t('common.send')}} v-btn(@click='register'
:disabled='!valid || loading' :loading='loading'
color='primary') {{$t('common.send')}}
v-icon mdi-chevron-right v-icon mdi-chevron-right
</template> </template>
@ -40,7 +42,7 @@ export default {
validators, validators,
loading: false, loading: false,
user: {}, user: {},
valid: false valid: true
} }
}, },
// https://nuxtjs.org/api/pages-validate/ // https://nuxtjs.org/api/pages-validate/
@ -49,7 +51,7 @@ export default {
return store.state.settings.allow_registration return store.state.settings.allow_registration
}, },
computed: { computed: {
...mapState(['settings']), ...mapState(['settings'])
// disabled () { // disabled () {
// if (process.server) { return false } // if (process.server) { return false }
// return !this.user.password || !this.user.email || !this.user.description // return !this.user.password || !this.user.email || !this.user.description

View file

@ -10,7 +10,6 @@
<script> <script>
import Editor from '@/components/Editor' import Editor from '@/components/Editor'
import { mapState, mapActions } from 'vuex' import { mapState, mapActions } from 'vuex'
import { Message } from 'element-ui'
export default { export default {
components: { Editor }, components: { Editor },
@ -23,8 +22,7 @@ export default {
methods: { methods: {
...mapActions(['setSetting']), ...mapActions(['setSetting']),
save () { save () {
Message({ this.$root.$message({
showClose: true,
type: 'success', type: 'success',
message: this.$t('common.done') message: this.$t('common.done')
}) })

View file

@ -151,7 +151,8 @@
v-card-actions v-card-actions
v-spacer v-spacer
v-btn(@click='done' color='primary') {{edit?$t('common.edit'):$t('common.send')}} v-btn(@click='done' :loading='loading' :disabled='!valid || loading'
color='primary') {{edit?$t('common.edit'):$t('common.send')}}
</template> </template>
<script> <script>

View file

@ -24,7 +24,7 @@
v-icon mdi-arrow-right v-icon mdi-arrow-right
v-card-text v-card-text
v-dialog.embedDialog(:visible.sync='showEmbed') //- v-dialog.embedDialog(:visible.sync='showEmbed')
h4(slot='title') {{$t('common.embed_title')}} h4(slot='title') {{$t('common.embed_title')}}
EmbedEvent(:event='event') EmbedEvent(:event='event')
@ -33,13 +33,20 @@
//- event image //- event image
v-img.main_image.mb-3( v-img.main_image.mb-3(
lazy
contain contain
lazy
:src='imgPath' :src='imgPath'
:lazy-src='thumbImgPath' :lazy-src='thumbImgPath'
v-if='event.image_path') v-if='event.image_path')
template(v-slot:placeholder)
v-row(
class="fill-height ma-0"
align="center"
justify="center")
v-progress-circular(indeterminate
color="grey lighten-5")
p.p-description(v-html='event.description') div.p-description(v-html='event.description')
v-chip.p-category.ml-1(small v-for='tag in event.tags' color='primary' outlined :key='tag') {{tag}} v-chip.p-category.ml-1(small v-for='tag in event.tags' color='primary' outlined :key='tag') {{tag}}
//- info & actions //- info & actions
@ -304,15 +311,9 @@ export default {
</script> </script>
<style lang='less'> <style lang='less'>
.eventDetail { .eventDetail {
.toolbar {
height: auto !important;
padding: 1em 0;
box-sizing: content-box;
}
.main_image { .main_image {
width: 100%; width: 100%;
transition: height .100s; transition: all 1s;
margin: 0 auto; margin: 0 auto;
max-height: 83vh; max-height: 83vh;
} }

View file

@ -1,18 +1,17 @@
<template lang='pug'> <template lang='pug'>
el-row(:gutter='10') v-row(:gutter='10')
el-col(:span='12' :xs='24') v-col(:span='12' :xs='24')
el-alert.mb-1.mt-1(type='info' show-icon) {{$t('common.embed_help')}} v-alert.mb-1.mt-1(type='info' show-icon) {{$t('common.embed_help')}}
el-input(v-model='code') v-text-field(v-model='code')
el-button(slot='append' v-clipboard:copy='code' v-clipboard:success='copyLink' el-button(slot='append' v-clipboard:copy='code' v-clipboard:success='copyLink'
plain type="primary" icon='el-icon-document') {{$t("common.copy")}} plain type="primary" icon='el-icon-document') {{$t("common.copy")}}
el-col.mt-2(:span='12' :xs='24' v-html='code') v-col.mt-2(:span='12' :xs='24' v-html='code')
</template> </template>
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
import { Message } from 'element-ui'
export default { export default {
name: 'embedEvent', name: 'EmbedEvent',
props: ['event'], props: ['event'],
computed: { computed: {
...mapState(['settings']), ...mapState(['settings']),
@ -25,7 +24,7 @@ export default {
}, },
methods: { methods: {
copyLink () { copyLink () {
Message({ message: this.$t('common.copied'), type: 'success', showClose: true }) this.$root.$message({ message: this.$t('common.copied'), type: 'success' })
} }
} }
} }

View file

@ -13,7 +13,6 @@
</template> </template>
<script> <script>
import { mapState } from 'vuex' import { mapState } from 'vuex'
import { MessageBox } from 'element-ui'
import url from 'url' import url from 'url'
export default { export default {
@ -56,9 +55,7 @@ export default {
// }) // })
// }, // },
remove_account () { remove_account () {
MessageBox.confirm(this.$t('settings.remove_account_confirm'), this.$t('common.confirm'), { this.$root.$confirm(this.$t('settings.remove_account_confirm'), this.$t('common.confirm'), {
confirmButtonText: this.$t('common.ok'),
cancelButtonText: this.$t('common.cancel'),
type: 'error' type: 'error'
}).then(() => { }).then(() => {
this.$axios.$delete('/user') this.$axios.$delete('/user')

View file

@ -13,7 +13,6 @@
</template> </template>
<script> <script>
import { Message } from 'element-ui'
export default { export default {
name: 'Recover', name: 'Recover',
@ -33,15 +32,13 @@ export default {
async change_password () { async change_password () {
try { try {
await this.$axios.$post('/user/recover_password', { recover_code: this.code, password: this.new_password }) await this.$axios.$post('/user/recover_password', { recover_code: this.code, password: this.new_password })
Message({ this.$root.$message({
showClose: true,
type: 'success', type: 'success',
message: this.$t('common.password_updated') message: this.$t('common.password_updated')
}) })
this.$router.replace('/login') this.$router.replace('/login')
} catch (e) { } catch (e) {
Message({ this.$root.$message({
showClose: true,
type: 'warning', type: 'warning',
message: e message: e
}) })

View file

@ -14,7 +14,6 @@
</template> </template>
<script> <script>
import { Message } from 'element-ui'
export default { export default {
name: 'Recover', name: 'Recover',
@ -34,15 +33,13 @@ export default {
async change_password () { async change_password () {
try { try {
await this.$axios.$post('/user/recover_password', { recover_code: this.code, password: this.new_password }) await this.$axios.$post('/user/recover_password', { recover_code: this.code, password: this.new_password })
Message({ this.$root.$message({
showClose: true,
type: 'success', type: 'success',
message: this.$t('common.password_updated') message: this.$t('common.password_updated')
}) })
this.$router.replace('/login') this.$router.replace('/login')
} catch (e) { } catch (e) {
Message({ this.$root.$message({
showClose: true,
type: 'warning', type: 'warning',
message: e message: e
}) })

1371
yarn.lock

File diff suppressed because it is too large Load diff