2020-03-30 11:03:20 +02:00
< template >
2020-04-17 17:04:03 +02:00
< div class = "" >
< v-navigation-drawer class = "main-drawer" v-model = "drawer" :clipped="$vuetify.breakpoint.lgAndUp" width="300" app >
< v-list dense nav >
< v-list-item class = "hidden-md-and-up site-title" link : to = "{path: '/'}" >
< v-list-item-avatar >
2021-02-06 15:39:30 +01:00
< span class = "icon-bookmark sidebar-logo" > < / span >
2020-04-17 17:04:03 +02:00
< / v-list-item-avatar >
< v-list-item-content >
< v-list-item-title > { { $site . title } } < / v-list-item-title >
< / v-list-item-content >
< / v-list-item >
< v-divider class = "hidden-md-and-up" / >
< template v-for = "item in items" >
< v-list-group v-if = "item.children" :key="item.title" :value="isExpanded(item)" color="accent" >
< template v -slot : activator >
2020-04-22 11:17:05 +02:00
< v-list-item-icon v-if = "item.icon" >
2020-06-10 10:30:32 +02:00
< span class = "v-icon" v-if = "item.customIcon" v-html="item.icon" > < / span >
< template v-else >
< v-icon v-text = "item.icon" > < / v-icon >
< / template >
2020-04-22 11:17:05 +02:00
< / v-list-item-icon >
2020-04-17 17:04:03 +02:00
< v-list-item-content >
< v-list-item-title >
{ { item . title } }
< / v-list-item-title >
< / v-list-item-content >
< / template >
2020-03-30 11:03:20 +02:00
2020-04-17 17:04:03 +02:00
< template v-for = "child in item.children" >
< v-list-group v-if = "child.children" :key="child.title" sub-group :value="isExpanded(child)" color="accent" >
< template v -slot : activator >
2020-04-22 11:17:05 +02:00
< v-list-item-icon v-if = "child.icon" >
< v-icon v-text = "child.icon" > < / v-icon >
< / v-list-item-icon >
2020-04-17 17:04:03 +02:00
< v-list-item-content >
< v-list-item-title >
{ { child . title } }
2020-04-22 11:17:05 +02:00
< v-chip v-if = "child.badge" class="ml-2" color="primary" x-small label v-html="displayBadge(child.badge)" > < / v-chip >
2020-04-17 17:04:03 +02:00
< / v-list-item-title >
< / v-list-item-content >
< / template >
2020-06-10 10:30:32 +02:00
< v-list-item v-for = "subchild in child.children" link :to="{path: subchild.path}" exact >
2020-04-22 11:17:05 +02:00
< v-list-item-icon v-if = "subchild.icon" >
< v-icon v-text = "subchild.icon" > < / v-icon >
< / v-list-item-icon >
2020-04-17 17:04:03 +02:00
< v-list-item-content >
< v-list-item-title >
{ { subchild . title } }
2020-04-22 11:17:05 +02:00
< v-chip v-if = "subchild.badge" class="ml-2" color="primary" x-small label v-html="displayBadge(subchild.badge)" > < / v-chip >
2020-04-17 17:04:03 +02:00
< / v-list-item-title >
< / v-list-item-content >
< / v-list-item >
< / v-list-group >
< v-divider v -else -if = " child.type = = ' divider ' " / >
2020-06-10 10:30:32 +02:00
< v-list-item v -else :key = "child.title" link : to = "{path: child.path}" exact >
2020-04-22 11:17:05 +02:00
< v-list-item-icon v-if = "child.icon" >
< v-icon v-text = "child.icon" > < / v-icon >
< / v-list-item-icon >
2020-03-30 11:03:20 +02:00
< v-list-item-content >
< v-list-item-title >
{ { child . title } }
2020-04-22 11:17:05 +02:00
< v-chip v-if = "child.badge" class="ml-2" color="primary" x-small label v-html="displayBadge(child.badge)" > < / v-chip >
2020-03-30 11:03:20 +02:00
< / v-list-item-title >
< / v-list-item-content >
< / v-list-item >
2020-04-17 17:04:03 +02:00
< / template >
< / v-list-group >
< v-divider v -else -if = " item.type = = ' divider ' " / >
2020-06-10 10:30:32 +02:00
< v-list-item v -else :key = "item.title" link : to = "{path: item.path}" color = "accent" exact >
2020-04-17 17:04:03 +02:00
< v-list-item-icon v-if = "item.icon" >
< v-icon v-text = "item.icon" > < / v-icon >
< / v-list-item-icon >
< v-list-item-content >
< v-list-item-title >
{ { item . title } }
< / v-list-item-title >
< / v-list-item-content >
< / v-list-item >
< / template >
2020-06-10 10:30:32 +02:00
< v-list-group key = "community" color = "accent" >
< template v -slot : activator >
< v-list-item-icon >
< v-icon > mdi - account - group < / v-icon >
< / v-list-item-icon >
< v-list-item-content >
< v-list-item-title >
Communauté
< / v-list-item-title >
< / v-list-item-content >
< / template >
< v-list-item v-if = "$site.themeConfig.forum" link :href="$site.themeConfig.forum" target="_blank" >
< v-list-item-icon >
< v-icon > mdi - forum < / v-icon >
< / v-list-item-icon >
< v-list-item-content >
< v-list-item-title >
Forum
< / v-list-item-title >
< / v-list-item-content >
< / v-list-item >
< v-list-item v-if = "$site.themeConfig.discordHDNO" link :href="$site.themeConfig.discordHDNO" target="_blank" >
< v-list-item-icon >
< v-icon > mdi - discord < / v-icon >
< / v-list-item-icon >
< v-list-item-content >
< v-list-item-title >
2021-02-06 15:39:30 +01:00
Discord Communautaire
2020-06-10 10:30:32 +02:00
< / v-list-item-title >
< / v-list-item-content >
< / v-list-item >
< v-list-item v-if = "$site.themeConfig.discord" link :href="$site.themeConfig.discord" target="_blank" >
< v-list-item-icon >
< v-icon > mdi - discord < / v-icon >
< / v-list-item-icon >
< v-list-item-content >
< v-list-item-title >
2021-02-09 17:49:44 +01:00
Discord 5 e DRS
2020-06-10 10:30:32 +02:00
< / v-list-item-title >
< / v-list-item-content >
< / v-list-item >
< v-divider / >
< / v-list-group >
2020-04-17 17:04:03 +02:00
< v-list-item v-if = "$site.themeConfig.repository" link :href="$site.themeConfig.repository" target="_blank" >
< v-list-item-icon >
< v-icon > mdi - github < / v-icon >
< / v-list-item-icon >
< v-list-item-content >
< v-list-item-title >
Sources GitHub
< / v-list-item-title >
< / v-list-item-content >
< / v-list-item >
2020-05-18 17:03:41 +02:00
< v-list-item v-if = "$site.themeConfig.kofi" @click.stop="toggleSupportDialog" >
2020-04-17 17:04:03 +02:00
< v-list-item-icon >
2021-02-08 15:06:08 +01:00
< v-icon class = "glowing-gold" > mdi - glass - mug - variant < / v-icon >
2020-04-17 17:04:03 +02:00
< / v-list-item-icon >
< v-list-item-content >
< v-list-item-title >
2020-05-19 08:21:39 +02:00
Jeter un sou au développeur
2020-04-17 17:04:03 +02:00
< / v-list-item-title >
< / v-list-item-content >
< / v-list-item >
2020-05-18 17:03:41 +02:00
< v-list-item link : to = "{path: '/a-propos/'}" color = "accent" >
2020-04-17 17:04:03 +02:00
< v-list-item-icon >
< v-icon > mdi - information < / v-icon >
2020-04-15 16:27:16 +02:00
< / v-list-item-icon >
2020-03-30 11:03:20 +02:00
< v-list-item-content >
< v-list-item-title >
2020-04-17 17:04:03 +02:00
À propos
2020-03-30 11:03:20 +02:00
< / v-list-item-title >
< / v-list-item-content >
< / v-list-item >
2020-04-17 17:04:03 +02:00
< / v-list >
< template v -slot : append >
< div class = "hidden-md-and-up" >
< v-divider / >
< div class = "pa-2 d-flex" >
< v-spacer / >
2020-04-18 15:27:29 +02:00
< v-btn @click.stop ="setIsThemeDark" icon >
2020-04-17 17:04:03 +02:00
< v-icon v-html = "$vuetify.theme.dark ? 'mdi-brightness-4' : 'mdi-brightness-7'" > < / v-icon >
< / v-btn >
< / div >
< / div >
2020-03-30 11:03:20 +02:00
< / template >
2020-04-17 17:04:03 +02:00
< / v-navigation-drawer >
2020-05-15 15:48:51 +02:00
< v-dialog v-model = "isOpenSupportDialog" @click:outside="toggleSupportDialog" max-width="600" >
< v-card >
2020-05-19 08:21:39 +02:00
< v-card-title class = "headline d-flex justify-space-between" >
2020-05-19 11:25:22 +02:00
< span > Jeter un sou < span class = "d-none d-md-inline" > & nbsp ; au développeur < / span > < / span >
2020-05-18 17:03:41 +02:00
< v-btn color = "primary" icon @click ="toggleSupportDialog" > < v -icon > mdi - close < / v-icon > < / v-btn >
< / v-card-title >
2020-05-15 15:48:51 +02:00
< v-card-text >
2020-05-18 17:03:41 +02:00
< p > < strong > Pourquoi donner ? < / strong > < / p >
< p > Soyons clairs : l 'accès au site est <strong>gratuit</strong>. Pour <strong>tout le monde</strong>. Pour <strong>toujours</strong>. Et <strong>sans publicité</strong>. Aucun revenu n' est donc généré par son biais . En revanche , la mise en ligne d ' un site web a un coût . < / p >
< p > L ' objectif est donc de couvrir ce coût . < / p >
< p > Vous pouvez participer aux frais d 'hébergement et permettre à tout le monde et à vous-même d' en profiter ou m ' encourager au développement parce que vous pensez que mon travail le mérite . < / p >
< p > C ' est < strong > vous < / strong > qui décidez . < / p >
< p class = "text-center" >
2020-05-19 11:25:22 +02:00
< v-btn depressed dark color = "#BDB76B" link :href = "$site.themeConfig.kofi" target = "_blank" > < v-icon class = "mr-2" > mdi - glass - mug - variant < / v-icon > Jeter un sou < span class = "d-none d-md-inline" > & nbsp ; au développeur < / span > < / v-btn >
2020-05-18 17:03:41 +02:00
< / p >
2020-05-15 15:48:51 +02:00
< / v-card-text >
< / v-card >
< / v-dialog >
2020-04-17 17:04:03 +02:00
< / div >
2020-03-30 11:03:20 +02:00
< / template >
< script >
export default {
name : 'NavDrawer' ,
data ( ) {
return {
items : [ ]
}
} ,
computed : {
drawer : {
get ( ) {
return this . $store . state . drawer
} ,
set ( newValue ) {
this . $store . commit ( 'setDrawer' , newValue )
}
2020-04-15 16:27:16 +02:00
} ,
2020-05-15 15:48:51 +02:00
isOpenSupportDialog ( ) {
return this . $store . state . isOpenSupportDialog
2020-04-17 17:04:03 +02:00
}
2020-03-30 11:03:20 +02:00
} ,
mounted ( ) {
this . items = this . $site . themeConfig . sidebar
} ,
methods : {
2020-04-09 09:40:55 +02:00
isExpanded ( item ) {
if ( item . children ) {
for ( var i = 0 ; i < item . children . length ; i ++ ) {
if ( item . children [ i ] . path ) {
if ( item . children [ i ] . path == this . $route . path ) {
return true
}
}
if ( item . children [ i ] . children ) {
for ( var j = 0 ; j < item . children [ i ] . children . length ; j ++ ) {
2020-04-09 10:20:08 +02:00
if ( item . children [ i ] . children [ j ] . path ) {
2020-04-09 09:40:55 +02:00
if ( item . children [ i ] . children [ j ] . path == this . $route . path ) {
return true
}
}
}
}
}
}
2020-04-11 10:39:54 +02:00
// Grimoire
if ( ( item . title == "Pour les joueurs" ) && ( this . $route . path . includes ( '/grimoire/' ) ) ) {
return true
}
2020-04-15 16:27:16 +02:00
// Bestiaire
if ( ( item . title == "Pour les meneurs" ) && ( this . $route . path . includes ( '/bestiaire/' ) ) ) {
return true
}
2020-04-11 10:39:54 +02:00
// Liste des objets magiques
if ( ( item . title == "Pour les meneurs" ) && ( this . $route . path . includes ( '/liste-objets-magiques/' ) ) ) {
return true
}
2020-04-09 09:40:55 +02:00
return false
2020-04-17 17:04:03 +02:00
} ,
2020-05-15 15:48:51 +02:00
toggleSupportDialog ( ) {
this . $store . commit ( 'setIsOpenSupportDialog' , ! this . $store . state . isOpenSupportDialog )
} ,
2020-04-18 15:27:29 +02:00
setIsThemeDark ( ) {
this . $vuetify . theme . dark = ! this . $vuetify . theme . dark
this . $store . commit ( 'setIsThemeDark' , this . $vuetify . theme . dark )
2020-04-22 11:17:05 +02:00
} ,
displayBadge ( badge ) {
if ( badge == 'mySpells' ) {
return this . $store . state . mySpells . spells . length
} else if ( badge == 'myMonsters' ) {
return this . $store . state . myMonsters . monsters . length
} else if ( badge == 'myMagicItems' ) {
return this . $store . state . myMagicItems . magicItems . length
}
2020-04-09 09:40:55 +02:00
}
2020-03-30 11:03:20 +02:00
}
}
< / script >
< style lang = "scss" >
// Case of list
. v - application -- is - ltr {
. main - drawer {
. v - list - group -- sub - group {
. v - list - item _ _icon : first - child {
margin - right : 0 px ;
}
}
. v - list -- dense {
. v - list - group -- sub - group {
. v - list - group _ _header {
padding - left : 0 px ;
}
}
}
2020-03-30 14:26:19 +02:00
2020-03-30 11:03:20 +02:00
. v - list -- nav {
. v - list - item {
padding - left : 24 px ;
}
}
}
}
< / style >