Display message on admin routes if non-admin tries to view
This commit is contained in:
parent
66f98fd194
commit
80a52bdcec
2 changed files with 30 additions and 17 deletions
|
@ -170,7 +170,8 @@
|
|||
"loading": "Loading",
|
||||
"noItemsConnection": "Please check your internet connection, or try again later.",
|
||||
"noItemsStart": "There are no",
|
||||
"noItemsEnd": "to display."
|
||||
"noItemsEnd": "to display.",
|
||||
"adminOnly": "Only users with admin are allowed to navigate to this route."
|
||||
},
|
||||
"relationships": {
|
||||
"pending": "Cancel Friend Request",
|
||||
|
|
|
@ -1,20 +1,32 @@
|
|||
<template>
|
||||
<div class="columns is-centered">
|
||||
<div class="column is-2">
|
||||
<b-menu class="box">
|
||||
<b-menu-list :label="$t('admin.title')">
|
||||
<b-menu-item @click="$router.push('/admin/dashboard')" :label="$t('admin.dashboard')"></b-menu-item>
|
||||
<b-menu-item @click="$router.push('/admin/item')" :label="$t('admin.uploadItem')"></b-menu-item>
|
||||
</b-menu-list>
|
||||
<b-menu-list :label="$t('admin.executive.title')">
|
||||
<b-menu-item :label="$t('admin.executive.soon')"></b-menu-item>
|
||||
</b-menu-list>
|
||||
</b-menu>
|
||||
</div>
|
||||
<div class="column is-9">
|
||||
<div class="box">
|
||||
<router-view></router-view>
|
||||
<main class="section">
|
||||
<div class="columns is-centered" v-if="$store.state.user.admin">
|
||||
<div class="column is-2">
|
||||
<b-menu class="box">
|
||||
<b-menu-list :label="$t('admin.title')">
|
||||
<b-menu-item @click="$router.push('/admin/dashboard')" :label="$t('admin.dashboard')"></b-menu-item>
|
||||
<b-menu-item @click="$router.push('/admin/item')" :label="$t('admin.uploadItem')"></b-menu-item>
|
||||
</b-menu-list>
|
||||
<b-menu-list :label="$t('admin.executive.title')">
|
||||
<b-menu-item :label="$t('admin.executive.soon')"></b-menu-item>
|
||||
</b-menu-list>
|
||||
</b-menu>
|
||||
</div>
|
||||
<div class="column is-9">
|
||||
<div class="box">
|
||||
<router-view></router-view>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column" v-if="!$store.state.user.admin">
|
||||
<div class="box">
|
||||
<div class="is-vcentered has-text-centered columns">
|
||||
<div class="column is-vcentered">
|
||||
<i class="far fa-times-square large-icon"></i>
|
||||
<h1 class="subtitle">{{$t('generic.adminOnly')}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</template>
|
Loading…
Reference in a new issue