This commit is contained in:
les 2020-08-05 17:30:41 +02:00
parent 41e3e97af7
commit e7b214655f
9 changed files with 108 additions and 109 deletions

View file

@ -1,6 +1,7 @@
<template lang='pug'>
v-container
v-subheader(v-html="$t('admin.place_description')")
v-card-title {{$t('common.places')}}
v-card-subtitle(v-html="$t('admin.place_description')")
v-dialog
v-form.mb-2
@ -18,10 +19,11 @@
v-btn(@click='savePlace') {{$t('common.save')}}
v-data-table(
@click:row='selectPlace'
:headers='headers'
:items='places')
v-card-text
v-data-table(
@click:row='selectPlace'
:headers='headers'
:items='places')
</template>
<script>
import { mapState } from 'vuex'

View file

@ -28,6 +28,7 @@
min-width="290px")
template(v-slot:activator='{ on }')
v-text-field(:value='colors[i]'
:label='i'
v-on='on' clearable readonly)
v-color-picker(light @update:color='c => updateColor(i, c)')

View file

@ -1,11 +1,12 @@
<template lang="pug">
v-card
v-container
v-card-title {{$t('common.users')}}
v-spacer
v-text-field(v-model='search'
append-icon='mdi-magnify'
label='Search',
single-line hide-details)
v-btn(text color='primary' small @click='newUserDialog = true') <v-icon>mdi-plus-user</v-icon> {{$t('common.new_user')}}
//- ADD NEW USER
v-dialog(v-model='newUserDialog' width='500')
@ -16,27 +17,27 @@
v-form
v-text-field(v-model='new_user.email'
:label="$t('common.email')"
:rules="[validators.required('Email')]")
:rules="[validators.required('email')]")
v-switch(v-model='new_user.is_admin' :label="$t('common.admin')" inset)
v-alert(type='info' :closable='false') {{$t('admin.user_add_help')}}
v-card-actions
v-spacer
v-btn(@click='newUserDialog=false' color='error') {{$t('common.cancel')}}
v-btn(@click='createUser' color='primary') {{$t('common.send')}}
v-btn(@click='newUserDialog=false' color='danger' plain) {{$t('common.close')}}
//- USERS LIST
v-data-table(
:headers='headers'
:items='users'
:search='search')
template(v-slot:item.actions='{item}')
v-btn(text small @click='toggle(item)'
:color='item.is_active?"warning":"success"') {{item.is_active?$t('common.deactivate'):$t('common.activate')}}
v-btn(text small @click='toggleAdmin(item)'
:color='item.is_admin?"warning":"error"') {{item.is_admin?$t('common.remove_admin'):$t('common.admin')}}
v-btn(text small @click='deleteUser(item)'
color='error') {{$t('admin.delete_user')}}
v-btn(text color='primary' small @click='newUserDialog = true') <v-icon>mdi-plus-user</v-icon> {{$t('common.new_user')}}
v-card-text
//- USERS LIST
v-data-table(
:headers='headers'
:items='users'
:search='search')
template(v-slot:item.actions='{item}')
v-btn(text small @click='toggle(item)'
:color='item.is_active?"warning":"success"') {{item.is_active?$t('common.deactivate'):$t('common.activate')}}
v-btn(text small @click='toggleAdmin(item)'
:color='item.is_admin?"warning":"error"') {{item.is_admin?$t('common.remove_admin'):$t('common.admin')}}
v-btn(text small @click='deleteUser(item)'
color='error') {{$t('admin.delete_user')}}
</template>
<script>
@ -66,18 +67,14 @@ export default {
},
computed: mapState(['settings']),
methods: {
deleteUser (user) {
this.$root.$confirm(this.$t('admin.delete_user_confirm'),
this.$t('common.confirm'), {
confirmButtonText: this.$t('common.ok'),
cancelButtonText: this.$t('common.cancel'),
type: 'error'
})
.then(() => this.$axios.delete(`/user/${user.id}`))
.then(() => {
this.$root.$message({ message: this.$t('admin.user_remove_ok')})
this.users_ = this.users_.filter(u => u.id !== user.id)
})
async deleteUser (user) {
const ret = await this.$root.$confirm(this.$t('common.confirm'),
this.$t('admin.delete_user_confirm'),
{ type: 'error' })
if (!ret) { return }
await this.$axios.delete(`/user/${user.id}`)
this.$root.$message({ message: this.$t('admin.user_remove_ok') })
this.users_ = this.users_.filter(u => u.id !== user.id)
},
toggle (user) {
user.is_active = !user.is_active
@ -88,7 +85,6 @@ export default {
user.is_admin = !user.is_admin
await this.$axios.$put('/user', user)
} catch (e) {
console.error(e)
}
},
async createUser () {
@ -97,15 +93,13 @@ export default {
const user = await this.$axios.$post('/user', this.new_user)
this.new_user = { email: '', is_admin: false }
Message({
showClose: true,
this.$root.$message({
type: 'success',
message: this.$t('admin.user_create_ok')
})
this.users_.push(user)
} catch (e) {
Message({
showClose: true,
this.$root.$message({
type: 'error',
message: this.$t(e)
})

View file

@ -1,7 +1,7 @@
<template lang='pug'>
v-container.p-4.text-center
v-alert(v-if="error.statusCode === 404") ¯\_()_/¯ {{error.message}}
v-calert(v-else) <i>warning</i> An error occurred: {{error.message}}
v-alert(v-else type='danger') <v-icon>mdi-warning</v-icon> An error occurred: {{error.message}}
nuxt-link(to='/') Back to home
</template>

View file

@ -1,53 +1,55 @@
<template lang="pug">
v-container
v-card
v-tabs
v-tabs
//- SETTINGS
v-tab {{$t('common.settings')}}
v-tab-item
Settings
//- SETTINGS
v-tab {{$t('common.settings')}}
v-tab-item
Settings
//- THEME
v-tab {{$t('common.theme')}}
v-tab-item
Theme
//- THEME
v-tab {{$t('common.theme')}}
v-tab-item
Theme
//- USERS
v-tab
v-badge(:value='unconfirmedUsers.length' :content='unconfirmedUsers.length') {{$t('common.users')}}
v-tab-item
Users(:users='users')
//- USERS
v-tab
v-badge(:value='unconfirmedUsers.length' :content='unconfirmedUsers.length') {{$t('common.users')}}
v-tab-item
Users(:users='users')
//- PLACES
v-tab {{$t('common.places')}}
v-tab-item
Places
//- PLACES
v-tab {{$t('common.places')}}
v-tab-item
Places
//- EVENTS
v-tab
v-badge(:value='events.length') {{$t('common.events')}}
v-tab-item
v-container
v-card-title {{$t('common.events')}}
v-card-subtitle {{$t('admin.event_confirm_description')}}
v-card-text
v-data-table(
:items='events'
:headers='eventHeaders')
//- EVENTS
v-tab
v-badge(:value='events.length') {{$t('common.events')}}
v-tab-item
v-container
v-subheader {{$t('admin.event_confirm_description')}}
v-data-table(
:items='events'
:headers='eventHeaders')
//- ANNOUNCEMENTS
v-tab {{$t('common.announcements')}}
v-tab-item
Announcement
//- ANNOUNCEMENTS
v-tab {{$t('common.announcements')}}
v-tab-item
Announcement
//- FEDERATION
v-tab {{$t('common.federation')}}
v-tab-item
Federation
//- FEDERATION
v-tab {{$t('common.federation')}}
v-tab-item
Federation
//- MODERATION
v-tab(v-if='settings.enable_federation') {{$t('common.moderation')}}
v-tab-item
Moderation
//- MODERATION
v-tab(v-if='settings.enable_federation') {{$t('common.moderation')}}
v-tab-item
Moderation
</template>
<script>

View file

@ -1,21 +1,19 @@
<template lang='pug'>
v-card.mt-5
h4(slot='header')
nuxt-link(to='/')
img(src='/favicon.ico')
span {{settings.title}} - {{$t('common.authorize')}}
<u>{{$auth.user.email}}</u>
div
p(v-html="$t('oauth.authorization_request', { app: client.name, instance_name: settings.title })")
ul
li(v-for="s in scope.split(' ')") {{$t(`oauth.scopes.${scope}`)}}
span(v-html="$t('oauth.redirected_to', {url: $route.query.redirect_uri})")
br
br
a(:href='authorizeURL')
v-btn.mr-1(plain color='success') {{$t('common.authorize')}}
a(href='/')
v-btn.mt-1(plain color='danger') {{$t('common.cancel')}}
v-row.mt-5(align='center' justify='center')
v-col(cols='12' md="6" lg="5" xl="4")
v-card(light)
v-card-title {{settings.title}} - {{$t('common.authorize')}}
v-card-text
u {{$auth.user.email}}
div
p(v-html="$t('oauth.authorization_request', { app: client.name, instance_name: settings.title })")
ul
li(v-for="s in scope.split(' ')") {{$t(`oauth.scopes.${scope}`)}}
span(v-html="$t('oauth.redirected_to', {url: $route.query.redirect_uri})")
v-card-actions
v-spacer
v-btn(color='error' to='/') {{$t('common.cancel')}}
v-btn(:href='authorizeURL' color='success') {{$t('common.authorize')}}
</template>
<script>

View file

@ -3,7 +3,7 @@
.edit(v-if='$auth.user && $auth.user.is_admin')
Editor(v-if='$auth.user && $auth.user.is_admin'
v-model='about')
v-btn.float-right(type='success' plain icon='el-icon-check'
v-btn.float-right(color='success' plain
@click='save') {{$t('common.save')}}
div(v-else v-html='about')
</template>

View file

@ -10,7 +10,6 @@
b {{event|when}}
small ({{event.start_datetime|from}})
v-list-item-title
i.el-icon-location-outline
b.p-location {{event.place.name}}
span - {{event.place.address}}
h2 {{event.title}}

View file

@ -1,18 +1,21 @@
<template lang="pug">
el-main
h4 <nuxt-link to='/'><img src='/favicon.ico'/></nuxt-link> {{$t('common.set_password')}}
v-row.mt-5(align='center' justify='center')
v-col(cols='12' md="6" lg="5" xl="4")
v-card
v-card-title <nuxt-link to='/'><img src='/favicon.ico'/></nuxt-link> {{$t('common.set_password')}}
template(v-if='valid')
v-card-text(v-if='valid')
v-form(v-if='valid')
v-text-field(type='password' v-model='new_password' :label="$t('common.new_password')")
div(v-if='valid')
el-form
el-form-item {{$t('common.new_password')}}
el-input(type='password', v-model='new_password')
el-button(plain type="success" icon='el-icon-send'
:disabled='!new_password' @click='change_password') {{$t('common.send')}}
v-card-actions
v-btn(color="success" :disabled='!new_password' @click='change_password') {{$t('common.send')}}
div(v-else) {{$t('recover.not_valid_code')}}
v-card-text(v-else) {{$t('recover.not_valid_code')}}
</template>
<script>
import { validators } from '../../plugins/helpers'
export default {
name: 'Recover',
@ -26,7 +29,7 @@ export default {
}
},
data () {
return { new_password: '' }
return { validators, new_password: '' }
},
methods: {
async change_password () {