Skip to content

Commit 088e062

Browse files
committed
🎨 Update admin quesry param to param
1 parent 972f441 commit 088e062

File tree

5 files changed

+24
-20
lines changed

5 files changed

+24
-20
lines changed

src/components/admin/AdminUser.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="h3 my-3">Felhasználói fiókok</div>
3-
<base-dialog :show="!!selectedId" upper footless>
3+
<base-dialog :show="!!selectedId" title="Felhasználó szerkesztése" upper footless>
44
<profile :id="selectedId" imported @close="close"></profile>
55
</base-dialog>
66
<base-loader v-if="loading">Loading...</base-loader>

src/components/admin/NavBar.vue

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,18 @@
1111
<span v-if="opened" class="align-self-center">Becsuk</span>
1212
</div>
1313
</li>
14-
<li v-if="role >= 4" class="nav-item my-0 text-center" @click="go('users')">
15-
<div class="btn mx-1 px-1 bigtext d-flex">
14+
<li v-if="role >= 3" class="nav-item my-0 text-center">
15+
<router-link to="/admin/users" class="btn mx-1 px-1 bigtext d-flex">
1616
<fa-icon icon="users" class="fa-2x mr-1 align-self-center" />
1717
<span v-if="opened" class="align-self-center">Felhasználók</span>
18-
</div>
18+
</router-link>
1919
</li>
2020
</ul>
2121
</template>
2222

2323
<script>
2424
export default {
2525
name: 'NavBar',
26-
emits: ['go'],
2726
data() {
2827
return { opened: false };
2928
},
@@ -36,9 +35,6 @@ export default {
3635
change() {
3736
this.opened = !this.opened;
3837
},
39-
go(p) {
40-
this.$emit('go', p);
41-
},
4238
},
4339
};
4440
</script>
@@ -47,13 +43,21 @@ export default {
4743
.bigtext {
4844
font-size: 1.2rem;
4945
}
46+
li > a:hover,
5047
li > div:hover {
5148
background-color: lighten($dark, 15);
5249
span,
5350
svg {
5451
color: $light;
5552
}
5653
}
54+
.router-link-active {
55+
background-color: lighten($dark, 48);
56+
span,
57+
svg {
58+
color: lighten($dark, 5);
59+
}
60+
}
5761
.justify-self-center {
5862
justify-self: center;
5963
}

src/components/layout/TheHeader.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<fa-icon icon="user" class="fa-1x mr-1" />
3434
Saját fiók
3535
</router-link>
36-
<router-link v-if="role > 2" to="/admin" class="dropdown-item">
36+
<router-link v-if="role > 1" to="/admin" class="dropdown-item">
3737
<fa-icon icon="toolbox" class="fa-1x mr-1" />
3838
Adminisztráció
3939
</router-link>

src/router.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ const routes = [
1919
props: true,
2020
children: [{ path: ':id', name: 'profileId', component: Profile }],
2121
},
22-
{ path: '/admin', name: 'admin', component: Admin, meta: { title: 'Adminisztráció', role: 2 } },
22+
{
23+
path: '/admin',
24+
name: 'admin',
25+
component: Admin,
26+
meta: { title: 'Adminisztráció', role: 2 },
27+
props: true,
28+
children: [{ path: ':content', name: 'AdminId', component: Admin }],
29+
},
2330
{ path: '/:notFound(.*)', name: 'notfound', component: NotFound },
2431
];
2532

src/views/Admin.vue

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<div class="flex-grow-1 d-flex">
33
<div class="admin flex-grow-1">
44
<div class="navB bg-light p-2">
5-
<nav-bar @go="go"></nav-bar>
5+
<nav-bar></nav-bar>
66
</div>
77
<div>
8-
<admin-user v-if="content === 'users' && role >= 4"></admin-user>
8+
<admin-user v-if="content === 'users' && role >= 3"></admin-user>
99
</div>
1010
</div>
1111
</div>
@@ -17,19 +17,12 @@ import AdminUser from '../components/admin/AdminUser.vue';
1717
export default {
1818
name: 'Admin',
1919
components: { NavBar, AdminUser },
20+
props: { content: { type: String, default: '' } },
2021
computed: {
21-
content() {
22-
return this.$route.query['content'];
23-
},
2422
role() {
2523
return this.$store.getters['getRole'];
2624
},
2725
},
28-
methods: {
29-
go(where) {
30-
this.$router.replace('/admin?content=' + where);
31-
},
32-
},
3326
};
3427
</script>
3528

0 commit comments

Comments
 (0)