diff --git a/components/Calendar.vue b/components/Calendar.vue
index 413c1924..9f714152 100644
--- a/components/Calendar.vue
+++ b/components/Calendar.vue
@@ -2,7 +2,7 @@
#calendar
v-calendar(
title-position='left'
- is-dark
+ :is-dark="settings['theme.is_dark']"
@update:from-page='updatePage'
:columns="$screens({ default: 1, lg: 2 })"
:locale='$i18n.locale'
@@ -29,7 +29,7 @@ export default {
},
computed: {
...mapGetters(['filteredEventsWithPast']),
- ...mapState(['tags', 'filters', 'in_past']),
+ ...mapState(['tags', 'filters', 'in_past', 'settings']),
// TODO: could be better
attributes () {
diff --git a/components/Confirm.vue b/components/Confirm.vue
new file mode 100644
index 00000000..4360a0ae
--- /dev/null
+++ b/components/Confirm.vue
@@ -0,0 +1,86 @@
+
+
+ v-dialog(v-model='show'
+ :color='options.color'
+ :title='title'
+ :max-width='options.width'
+ :style="{ zIndex: options.zIndex, position: 'absolute' }"
+ @keydown.esc='cancel')
+ v-card
+ v-card-title {{ title }}
+ v-card-text.pa-4(v-show='!!message') {{ message }}
+ v-card-actions.pt-0
+ v-spacer
+ v-btn(color='primary darken-1' text
+ @click='agree') {{$t('common.ok')}}
+ v-btn(color='secondary'
+ text @click='cancel') {{$t('common.cancel')}}
+
+
+
diff --git a/components/Editor.vue b/components/Editor.vue
index a1a2f89c..a5067d73 100644
--- a/components/Editor.vue
+++ b/components/Editor.vue
@@ -1,7 +1,17 @@
- .editor(:class='{ "with-border": border }')
- editor-menu-bubble(:editor='editor' :keep-in-bounds='true' v-slot='{ commands, isActive, getMarkAttrs, menu }')
- v-button-group.menububble(:class="{ 'is-active': menu.isActive }" :style="`left: ${menu.left}px; bottom: ${menu.bottom}px;`")
+ .editor
+ editor-menu-bar(:editor='editor' :keep-in-bounds='true' v-slot='{ commands, isActive, getMarkAttrs, menu }')
+ v-btn-toggle(dense)
+ v-btn(icon
+ :color="isActive.bold() && 'primary' || ''"
+ @click="commands.bold")
+ v-icon mdi-format-bold
+ v-btn(icon
+ :color="isActive.underline() && 'primary' || ''"
+ @click="commands.underline")
+ v-icon mdi-format-italic
+
+ //- v-button-group.menububble(:class="{ 'is-active': menu.isActive }" :style="`left: ${menu.left}px; bottom: ${menu.bottom}px;`")
v-popover(trigger='hover' placement='bottom-start')
v-btn.float-left(slot='reference' size='mini')
template
@@ -66,6 +76,7 @@ export default {
},
data () {
return {
+ options: [],
linkActive: false,
editor: null,
update: false
@@ -112,11 +123,17 @@ export default {
diff --git a/components/admin/Places.vue b/components/admin/Places.vue
index 67f0fd1c..f284d8ad 100644
--- a/components/admin/Places.vue
+++ b/components/admin/Places.vue
@@ -1,22 +1,26 @@
v-container
v-subheader(v-html="$t('admin.place_description')")
- v-form.mb-2
- //- el-form-item(:label="$t('common.name')")
- //- el-input.mr-1(:placeholder='$t("common.name")' v-model='place.name')
- v-text-field(
- :label="$t('common.name')"
- v-model='place.name'
- :placeholder='$t("common.name")')
- v-text-field(
- :label="$t('common.address')"
- v-model='place.address'
- :placeholder='$t("common.address")')
+ v-dialog
+ v-form.mb-2
+ //- el-form-item(:label="$t('common.name')")
+ //- el-input.mr-1(:placeholder='$t("common.name")' v-model='place.name')
+ v-text-field(
+ :label="$t('common.name')"
+ v-model='place.name'
+ :placeholder='$t("common.name")')
- v-btn(@click='savePlace') {{$t('common.save')}}
+ v-text-field(
+ :label="$t('common.address')"
+ v-model='place.address'
+ :placeholder='$t("common.address")')
+
+ v-btn(@click='savePlace') {{$t('common.save')}}
v-data-table(
+ @click:row='selectPlace'
+ :headers='headers'
:items='places')
diff --git a/components/admin/Users.vue b/components/admin/Users.vue
index 2989bb53..cce1134b 100644
--- a/components/admin/Users.vue
+++ b/components/admin/Users.vue
@@ -1,59 +1,47 @@
- v-container
+ v-card
+ v-card-title {{$t('common.users')}}
+ v-spacer
+ v-text-field(v-model='search'
+ append-icon='mdi-magnify'
+ label='Search',
+ single-line hide-details)
//- ADD NEW USER
- v-dialog(v-model='newUser' width='500')
- template(v-slot:activator="{ on }")
- v-btn(text v-on='on') mdi-plus {{$t('common.new_user')}}
+ v-dialog(v-model='newUserDialog' width='500')
v-card
- v-card-title {{$t('common.new_user')}}
+ v-card-title {{$t('common.new_user')}}
v-card-text
- v-form(inline @submit.native.prevent='create_user')
+ v-form
v-text-field(v-model='new_user.email'
- :label="$t('common.email')")
+ :label="$t('common.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-btn(@click='create_user' color='success' plain) {{$t('common.send')}}
+ 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')
+ :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='danger') {{$t('admin.delete_user')}}
+ color='error') {{$t('admin.delete_user')}}
- //- el-table-column(label='Email' width='220')
- //- template(slot-scope='data')
- //- el-popover(trigger='hover' :content='data.row.description' width='400')
- //- span(slot='reference') {{data.row.email}}
- //- el-table-column(:label="$t('common.actions')")
- //- template(slot-scope='data')
- //- div(v-if='data.row.id!==$auth.user.id')
- //- el-button-group
- //- el-button(size='mini'
- //- :type='data.row.is_active?"warning":"success"'
- //- @click='toggle(data.row)') {{data.row.is_active?$t('common.deactivate'):$t('common.activate')}}
- //- el-button(size='mini'
- //- :type='data.row.is_admin?"danger":"warning"'
- //- @click='toggleAdmin(data.row)') {{data.row.is_admin?$t('admin.remove_admin'):$t('common.admin')}}
- //- el-button(size='mini'
- //- type='danger'
- //- @click='delete_user(data.row)') {{$t('admin.delete_user')}}
- //- div(v-else)
- //- span {{$t('common.me')}}
- //- v-pagination(:page-size='perPage' :currentPage.sync='userPage' v-if='perPagemdi-plus-user {{$t('common.new_user')}}
diff --git a/layouts/modal.vue b/layouts/modal.vue
index 21a191b2..69e94b1c 100644
--- a/layouts/modal.vue
+++ b/layouts/modal.vue
@@ -1,9 +1,25 @@
- el-container#modal
- el-header
- .row.p-0.m-0
- .col.p-0
- .col-xl-5.col-lg-6.col-sm-10.col-xs-12.col-md-7.p-0
+ v-app(app)
+ Snackbar
+ Confirm
+ Nav
+
+ v-main(app)
+ v-scroll-y-transition(hide-on-leave)
nuxt
- .col.p-0
+
+ Footer
+
+
diff --git a/pages/Admin.vue b/pages/Admin.vue
index 13e1460b..06ee2ed2 100644
--- a/pages/Admin.vue
+++ b/pages/Admin.vue
@@ -8,6 +8,11 @@
v-tab-item
Settings
+ //- THEME
+ v-tab {{$t('common.theme')}}
+ v-tab-item
+ Theme
+
//- USERS
v-tab
v-badge(:value='unconfirmedUsers.length' :content='unconfirmedUsers.length') {{$t('common.users')}}
@@ -21,24 +26,13 @@
//- EVENTS
v-tab
- v-badge(:content='events.length') {{$t('common.events')}}
+ v-badge(:value='events.length') {{$t('common.events')}}
v-tab-item
- p {{$t('admin.event_confirm_description')}}
- v-data-table(
- :items='events'
- :headers='eventHeaders'
- )
- //- el-table-column(:label='$t("common.name")' width='300')
- //- template(slot-scope='data') {{data.row.title}}
- //- el-table-column(:label='$t("common.where")' width='250')
- //- template(slot-scope='data') {{data.row.place.name}}
- //- el-table-column(:label='$t("common.confirm")' width='250')
- //- template(slot-scope='data')
- //- el-button-group
- //- el-button(type='primary' @click='confirm(data.row.id)' size='mini') {{$t('common.confirm')}}
- //- el-button(type='success' @click='preview(data.row.id)' size='mini') {{$t('common.preview')}}
- //- client-only
- //- el-pagination(v-if='events.length>perPage' :page-size='perPage' :currentPage.sync='eventPage' :total='events.length')
+ v-container
+ v-subheader {{$t('admin.event_confirm_description')}}
+ v-data-table(
+ :items='events'
+ :headers='eventHeaders')
//- ANNOUNCEMENTS
v-tab {{$t('common.announcements')}}
@@ -65,10 +59,11 @@ import Settings from '../components/admin/Settings'
import Federation from '../components/admin/Federation'
import Moderation from '../components/admin/Moderation'
import Announcement from '../components/admin/Announcement'
+import Theme from '../components/admin/Theme'
export default {
name: 'Admin',
- components: { Users, Places, Settings, Federation, Moderation, Announcement },
+ components: { Users, Places, Settings, Federation, Moderation, Announcement, Theme },
middleware: ['auth'],
async asyncData ({ $axios, params, store }) {
try {
@@ -83,7 +78,10 @@ export default {
data () {
return {
description: '',
- events: []
+ events: [],
+ eventHeaders: [
+ { value: 'title', text: 'Title' }
+ ]
}
},
computed: {
diff --git a/pages/Login.vue b/pages/Login.vue
index 159c94c7..1eab67bd 100644
--- a/pages/Login.vue
+++ b/pages/Login.vue
@@ -7,18 +7,19 @@
v-card-subtitle(v-text="$t('login.description')")
v-card-text
+ v-form
+ v-text-field(v-model='email' type='email'
+ :rules='validators.email' autofocus
+ :placeholder='$t("common.email")'
+ ref='email')
- v-text-field(v-model='email' type='email'
- :placeholder='$t("common.email")'
- ref='email')
-
- v-text-field(v-model='password'
- type='password'
- :placeholder='$t("common.password")')
+ v-text-field(v-model='password'
+ :rules='validators.password'
+ type='password'
+ :placeholder='$t("common.password")')
v-card-actions
v-btn(color='success'
- text
:disabled='disabled'
@click='submit') {{$t('common.login')}}
@@ -32,12 +33,13 @@
diff --git a/pages/event/_id.vue b/pages/event/_id.vue
index 74f1447f..f9595cc0 100644
--- a/pages/event/_id.vue
+++ b/pages/event/_id.vue
@@ -1,58 +1,27 @@
- v-card#eventDetail.h-event.d-inline-block-mx-auto
- v-toolbar(prominent)
+ v-card.h-event.eventDetail
+ //- .d-block
+ v-container
v-list-item(two-line)
v-list-item-content
- h2(v-text='event.title')
- v-list-item-subtitle
+ v-list-item-title
time.dt-start(:datetime='event.start_datetime|unixFormat("YYYY-MM-DD HH:mm")')
v-icon mdi-date
b {{event|when}}
small ({{event.start_datetime|from}})
- v-list-item-subtitle
+ v-list-item-title
i.el-icon-location-outline
b.p-location {{event.place.name}}
span - {{event.place.address}}
+ h2 {{event.title}}
- v-spacer
- v-btn.mr-1(nuxt :to='`/event/${event.prev}`' color='primary' icon :disabled='!event.prev')
- v-icon mdi-arrow-left
- v-btn(nuxt :to='`/event/${event.next}`' color='primary' :disabled='!event.next' icon)
- v-icon mdi-arrow-right
- //- h2 {{event.title}}
- //- v-toolbar-subtitle
-
- //- v-toolbar(prominent)
- //- v-list-item
- //- h3 {{event.title}}
- //- v-row(justify='space-between')
- v-col(cols='auto')
- v-list-item(two-line)
- v-list-item-content
- v-list-item-title.headline(v-text='event.title')
- v-list-item-subtitle
- time.dt-start(:datetime='event.start_datetime|unixFormat("YYYY-MM-DD HH:mm")')
- v-icon mdi-date
- b {{event|when}}
- small ({{event.start_datetime|from}})
- v-list-item-subtitle
- i.el-icon-location-outline
- b.p-location {{event.place.name}}
- span - {{event.place.address}}
- v-col
- v-btn.mr-1(nuxt :to='`/event/${event.prev}`' color='primary' icon :disabled='!event.prev')
- v-icon mdi-arrow-left
- v-btn(nuxt :to='`/event/${event.next}`' color='primary' :disabled='!event.next' icon)
- v-icon mdi-arrow-right
-
- template(slot='extension')
- h2 {{event.title}}
- //- v-list-item
- //- i.el-icon-location-outline
- //- b.p-location {{event.place.name}}
- //- span - {{event.place.address}}
- //- v-spacer
- //- v-chip.p-category.ml-1(v-for='tag in event.tags' :key='tag' small color='secondary') {{tag}}
+ .v-btn--absolute.v-btn--right.v-btn--top
+ v-btn.mr-1(nuxt icon outlined color='primary'
+ :to='`/event/${event.prev}`' :disabled='!event.prev')
+ v-icon mdi-arrow-left
+ v-btn(nuxt bottom right outlined icon color='primary'
+ :to='`/event/${event.next}`' :disabled='!event.next')
+ v-icon mdi-arrow-right
v-card-text
v-dialog.embedDialog(:visible.sync='showEmbed')
@@ -65,31 +34,23 @@
//- event image
v-img.main_image.mb-3(
lazy
+ contain
:src='imgPath'
:lazy-src='thumbImgPath'
v-if='event.image_path')
p.p-description(v-html='event.description')
- v-btn.p-category.ml-1(type='text' plain round size='mini' v-for='tag in event.tags' :key='tag') {{tag}}
+ v-chip.p-category.ml-1(small v-for='tag in event.tags' color='primary' outlined :key='tag') {{tag}}
//- info & actions
- //- v-col
- v-list
- time.dt-start(:datetime='event.start_datetime|unixFormat("YYYY-MM-DD HH:mm")') {{event|when}}
{{event.start_datetime|from}}
- p
- i.el-icon-location-outline
- b.p-location {{event.place.name}}
- span - {{event.place.address}}
- v-divider {{$t('common.actions')}}
- v-list-item(
- v-clipboard:success='copyLink'
- v-clipboard:copy='`${settings.baseurl}/event/${event.id}`') {{$t('common.copy_link')}}
+ v-btn(text color='primary'
+ v-clipboard:success='copyLink'
+ v-clipboard:copy='`${settings.baseurl}/event/${event.id}`') {{$t('common.copy_link')}}
- v-list-item(@click='showEmbed=true') {{$t('common.embed')}}
+ v-btn(@click='showEmbed=true' text color='primary') {{$t('common.embed')}}
- v-list-item
- a(:href='`${settings.baseurl}/api/event/${event.id}.ics`') {{$t('common.add_to_calendar')}}
- EventAdmin(v-if='is_mine' :event='event')
+ v-btn(:href='`${settings.baseurl}/api/event/${event.id}.ics`' text color='primary') {{$t('common.add_to_calendar')}}
+ EventAdmin(v-if='is_mine' :event='event')
//- hr
@@ -137,7 +98,6 @@ import { mapState } from 'vuex'
import EventAdmin from './eventAdmin'
import EmbedEvent from './embedEvent'
import FollowMe from '../../components/FollowMe'
-import { Message, MessageBox } from 'element-ui'
import moment from 'moment-timezone'
const htmlToText = require('html-to-text')
@@ -269,7 +229,7 @@ export default {
},
async remove () {
try {
- await MessageBox.confirm(this.$t('event.remove_confirmation'), this.$t('common.confirm'), {
+ await this.$root.$confirm(this.$t('event.remove_confirmation'), this.$t('common.confirm'), {
confirmButtonText: this.$t('common.ok'),
cancelButtonText: this.$t('common.cancel'),
type: 'error'
@@ -300,18 +260,18 @@ export default {
},
async blockUser (resource) {
try {
- await MessageBox.confirm(this.$t('admin.user_block_confirm'), {
+ await this.$root.$confirm(this.$t('admin.user_block_confirm'), {
confirmButtonText: this.$t('common.ok'),
cancelButtonText: this.$t('common.cancel'),
type: 'error'
})
await this.$axios.post('/instances/toggle_user_block', { ap_id: resource.ap_user.ap_id })
- Message({ message: this.$t('admin.user_blocked', { user: resource.ap_user.ap_id }), type: 'success', showClose: true })
+ this.$root.$message({ message: this.$t('admin.user_blocked', { user: resource.ap_user.ap_id }), type: 'success' })
} catch (e) { }
},
async deleteResource (resource) {
try {
- await MessageBox.confirm(this.$t('admin.delete_resource_confirm'),
+ await this.$root.$confirm(this.$t('admin.delete_resource_confirm'),
this.$t('common.confirm'), {
confirmButtonText: this.$t('common.ok'),
cancelButtonText: this.$t('common.cancel'),
@@ -322,7 +282,7 @@ export default {
} catch (e) { }
},
copyLink () {
- Message({ message: this.$t('common.copied'), type: 'success', showClose: true })
+ this.$root.$message({ message: this.$t('common.copied'), type: 'success' })
},
// TOFIX
resource_filter (value) {
@@ -343,7 +303,21 @@ export default {
}