Customize sidebar

pull/3466/head
Angel Fernando Quiroz Campos 4 years ago
parent 1c5b7c1412
commit 3de9bb8ac0
  1. 4
      assets/css/scss/_sidebar.scss
  2. 42
      assets/vue/App.vue
  3. 27
      assets/vue/components/layout/Header.vue
  4. 133
      assets/vue/components/layout/Sidebar.vue

@ -85,4 +85,8 @@
.breadcrumb{ .breadcrumb{
background-color: $breadcrumb-back; background-color: $breadcrumb-back;
margin-bottom: 0.7rem; margin-bottom: 0.7rem;
}
.navbar-expand-sm .navbar-toggler {
display: block;
} }

@ -1,5 +1,5 @@
<template> <template>
<span> <div>
<transition <transition
name="fade" name="fade"
mode="out-in" mode="out-in"
@ -8,30 +8,24 @@
<Header /> <Header />
</transition> </transition>
<b-container fluid> <Sidebar />
<b-row>
<b-col>
<transition
name="fade"
mode="out-in"
appear
>
<Sidebar />
</transition>
</b-col>
<b-col cols="10"> <main role="main">
<Breadcrumb layout-class="pl-3 py-3" /> <b-container fluid>
<snackbar /> <b-row>
<router-view /> <b-col cols="12">
<div <Breadcrumb />
id="legacy_content" <snackbar />
v-html="legacy_content" <router-view />
/> <div
<b-col /> id="legacy_content"
</b-col></b-row> v-html="legacy_content"
</b-container> />
</span> </b-col>
</b-row>
</b-container>
</main>
</div>
</template> </template>
<style> <style>
</style> </style>

@ -1,16 +1,27 @@
<template> <template>
<b-navbar <b-navbar
toggleable="lg" toggleable="sm"
type="dark" type="dark"
variant="primary" variant="primary"
sticky sticky
> >
<b-navbar-brand href="/"> <button
v-b-toggle.sidebar-1
type="button"
aria-label="Toggle navigation"
class="navbar-toggler mr-3"
aria-controls="sidebar-1"
>
<span class="navbar-toggler-icon" />
</button>
<b-navbar-brand
href="/"
class="mr-auto mr-sm-0"
>
Chamilo Chamilo
</b-navbar-brand> </b-navbar-brand>
<b-navbar-toggle target="nav-collapse" />
<b-collapse <b-collapse
id="nav-collapse" id="nav-collapse"
is-nav is-nav
@ -75,11 +86,16 @@
v-if="isAuthenticated" v-if="isAuthenticated"
right right
no-caret no-caret
toggle-class="p-0"
> >
<!-- Using 'button-content' slot --> <!-- Using 'button-content' slot -->
<template v-slot:button-content> <template v-slot:button-content>
<b-avatar variant="light" /> <b-avatar variant="light" />
</template> </template>
<b-dropdown-text style="width: 240px;">
{{ username }}
</b-dropdown-text>
<b-dropdown-divider />
<b-dropdown-item href="/main/messages/inbox.php"> <b-dropdown-item href="/main/messages/inbox.php">
Inbox Inbox
</b-dropdown-item> </b-dropdown-item>
@ -117,6 +133,9 @@ export default {
isAuthenticated() { isAuthenticated() {
return this.$store.getters['security/isAuthenticated'] return this.$store.getters['security/isAuthenticated']
}, },
username() {
return this.$store.getters['security/getUser'].username
}
}, },
methods: { methods: {
} }

@ -1,56 +1,88 @@
<template> <template>
<b-list-group> <b-sidebar
<b-list-group-item :to="{ name: 'Index' }"> id="sidebar-1"
Home title="Chamilo"
</b-list-group-item> backdrop
>
<b-list-group-item <template
v-if="isAuthenticated" v-slot:footer
:to="{ name: 'MyCourses' }"
>
Courses
</b-list-group-item>
<b-list-group-item
v-if="isAuthenticated"
:to="{ name: 'MySessions' }"
> >
Sessions <b-nav
</b-list-group-item> v-if="!isAuthenticated"
class="d-sm-none bg-dark text-light"
>
<b-nav-item to="/login">
Login
</b-nav-item>
<b-nav-item to="/register">
Register
</b-nav-item>
</b-nav>
<b-list-group-item <p
v-if="isAuthenticated" v-if="isAuthenticated"
/> class="d-sm-none px-3 py-2 mb-0 bg-dark text-light"
>
{{ username }}
</p>
<b-nav
v-if="isAuthenticated"
class="d-sm-none bg-dark text-light"
>
<b-nav-item href="/main/messages/inbox.php">
Inbox
</b-nav-item>
<b-nav-item href="/account/home">
Profile
</b-nav-item>
<b-nav-item href="/logout">
Logout
</b-nav-item>
</b-nav>
</template>
<b-list-group-item <b-nav vertical>
v-if="isAuthenticated" <b-nav-item :to="{ name: 'Index' }">
:to="'/main/admin/user_list.php'" Home
> </b-nav-item>
Users <b-nav-item
</b-list-group-item> v-if="isAuthenticated"
:to="{ name: 'MyCourses' }"
<b-list-group-item >
v-if="isAuthenticated" Courses
:to="'/main/admin/course_list.php'" </b-nav-item>
> <b-nav-item
Courses v-if="isAuthenticated"
</b-list-group-item> :to="{ name: 'MySessions' }"
>
<b-list-group-item Sessions
v-if="isAuthenticated" </b-nav-item>
:to="'/main/session/session_list.php'" <b-nav-item
> v-if="isAuthenticated"
Sessions :to="'/main/admin/user_list.php'"
</b-list-group-item> >
Users
</b-nav-item>
<b-list-group-item <b-nav-item
v-if="isAuthenticated" v-if="isAuthenticated"
:to="'/main/admin/index.php'" :to="'/main/admin/course_list.php'"
> >
Settings Courses
</b-list-group-item> </b-nav-item>
</b-list-group> <b-nav-item
v-if="isAuthenticated"
:to="'/main/session/session_list.php'"
>
Sessions
</b-nav-item>
<b-nav-item
v-if="isAuthenticated"
:to="'/main/admin/index.php'"
>
Settings
</b-nav-item>
</b-nav>
</b-sidebar>
</template> </template>
<script> <script>
@ -59,6 +91,9 @@ export default {
isAuthenticated() { isAuthenticated() {
return this.$store.getters['security/isAuthenticated'] return this.$store.getters['security/isAuthenticated']
}, },
username() {
return this.$store.getters['security/getUser'].username
}
}, },
}; };

Loading…
Cancel
Save