el-card
nuxt-link.float-right(to='/')
el-button
v-icon(name='times' color='red')
h5 {{$t('common.admin')}}
el-tabs(v-model='tab')
//- USERS
el-tab-pane.pt-1
template(slot='label')
v-icon(name='users')
span.ml-1 {{$t('common.users')}}
el-collapse
el-collapse-item
template(slot='title')
p {{$t('common.new_user')}}
el-form(inline)
el-form-item(:label="$t('common.email')")
el-input(v-model='new_user.email')
el-form-item(:label="$t('common.password')")
el-input(v-model='new_user.password' type='password')
el-form-item(:label="$t('common.admin')")
el-switch(v-model='new_user.admin')
el-button.float-right(@click='create_user' type='success' plain) {{$t('common.send')}}
el-table(:data='paginatedUsers' small)
el-table-column(label='Email')
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')
el-button.mr-1(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('common.remove_admin'):$t('common.admin')}}
el-pagination(:page-size='perPage' :currentPage.sync='userPage' :total='users.length')
//- PLACES
el-tab-pane.pt-1
template(slot='label')
v-icon(name='map-marker-alt')
span.ml-1 {{$t('common.places')}}
p(v-html="$t('admin.place_description')")
el-form.mb-2(:inline='true' label-width='120px')
el-form-item(:label="$t('common.name')")
el-input.mr-1(:placeholder='$t("common.name")' v-model='place.name')
el-form-item(:label="$t('common.address')")
el-input.mr-1(:placeholder='$t("common.address")' v-model='place.address')
el-button(variant='primary' @click='savePlace') {{$t('common.save')}}
el-table(:data='paginatedPlaces' small @current-change="val => place=val")
el-table-column(:label="$t('common.name')")
template(slot-scope='data') {{data.row.name}}
el-table-column(:label="$t('common.address')")
template(slot-scope='data') {{data.row.address}}
el-pagination(:page-size='perPage' :currentPage.sync='placePage' :total='places.length')
//- EVENTS
el-tab-pane.pt-1
template(slot='label')
v-icon(name='calendar')
span.ml-1 {{$t('common.events')}}
p {{$t('admin.event_confirm_description')}}
el-table(:data='paginatedEvents' small primary-key='id' v-loading='loading')
el-table-column(:label='$t("common.name")')
template(slot-scope='data') {{data.row.title}}
el-table-column(:label='$t("common.where")')
template(slot-scope='data') {{data.row.place.name}}
el-table-column(:label='$t("common.confirm")')
template(slot-scope='data')
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')}}
el-pagination(:page-size='perPage' :currentPage.sync='eventPage' :total='events.length')
//- TAGS
//- el-tab-pane.pt-1
//- template(slot='label')
//- v-icon(name='tags')
//- span {{$t('common.tags')}}
//- p {{$t('admin.tag_description')}}
//- el-tag(v-if='tag.tag' :color='tag.color' size='mini') {{tag.tag}}
//- el-form(:inline='true' label-width='120px')
//- el-form-item(:label="$t('common.color')")
//- el-color-picker(v-model='tag.color' @change='updateColor')
//- el-table(:data='paginatedTags' striped small hover
//- highlight-current-row @current-change="tagSelected")
//- el-table-column(:label="$t('common.tag')")
//- template(slot-scope='data')
//- el-tag(:color='data.row.color' size='mini') {{data.row.tag}}
//- el-pagination(:page-size='perPage' :currentPage.sync='tagPage' :total='tags.length')
//- SETTINGS
el-tab-pane.pt-1
template(slot='label')
v-icon(name='cog')
span {{$t('common.settings')}}
//- el-form(inline @submit.prevent.stop='save_settings' label-width='140px')
//- p {{$t('settings.name_description')}}
//- el-form-item(:label="$t('settings.name')")
//- el-input(v-model="settings.title")
//- el-form-item(:label="$t('settings.description')")
//- el-input(v-model="settings.description")
//- 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')}}