diff --git a/assets/css/style.scss b/assets/css/style.scss index a21027513b13f7b3a1ddfb51d26251b5f22ef7cc..3b2926a1c5fe409e653d44da7672bcedbf2853f0 100644 --- a/assets/css/style.scss +++ b/assets/css/style.scss @@ -27,6 +27,7 @@ $list-group-active-bg: rgba(0, 0, 255, 0.075); $list-group-active-color: var(--text-primary-color); $list-group-action-hover-color: var(--text-secondary-color); $list-group-action-color: var(--text-primary-color); +$list-group-border-width: 0; // Cards $card-bg: var(--background-color-secondary); diff --git a/components/navigation/Bar.vue b/components/navigation/Bar.vue index 5b02697e9d5aca3e229dcafb9b639c2395b2ef15..d83bd372a1b0e9fe641b061e55e8800bde902084 100644 --- a/components/navigation/Bar.vue +++ b/components/navigation/Bar.vue @@ -23,13 +23,17 @@ export default { methods: { toggleMenu() { document.querySelector('.app').classList.toggle('open') + console.log(this.isOpen) + this.isOpen = !this.isOpen + console.log(this.isOpen) + localStorage.setItem("menu-open", this.isOpen) } }, mounted() { - this.isOpen = localStorage.getItem("menu-open") - if (this.isOpen == 'true') { + this.isOpen = (localStorage.getItem("menu-open") == "true") + if (this.isOpen) { document.querySelector('.app').classList.add('open') } } diff --git a/components/navigation/menu/Group.vue b/components/navigation/menu/Group.vue index 967668c8c903b607b688317bf392094f31c5d04d..59b285b50b8412e807979fa72f9813ca53ac472a 100644 --- a/components/navigation/menu/Group.vue +++ b/components/navigation/menu/Group.vue @@ -1,6 +1,6 @@ <template> <div class="mb-4"> - <h2 class="small text-muted text-uppercase ml-4 mb-3 pb-3 border-bottom">{{ $t(menu.title) }}</h2> + <h2 class="small text-muted text-uppercase ml-4 mb-2 pb-3 border-bottom">{{ $t(menu.title) }}</h2> <div class="nav navbar-nav list-group list-group-flush"> <NuxtLink class="list-group-item list-group-item-action p-0 pl-3" :to="localePath(item.path)" v-for="item in menu.items" :key="item.path"> <div class="position-relative py-3">{{ $t(item.title) }}</div> diff --git a/components/navigation/menu/Sidebar.vue b/components/navigation/menu/Sidebar.vue index 431c5f6f52b04c6f1866856560148313a0f58ead..882d10197554db0a2117fe5c58a898749b2f090e 100644 --- a/components/navigation/menu/Sidebar.vue +++ b/components/navigation/menu/Sidebar.vue @@ -1,10 +1,14 @@ <template> <aside class="menu shadow position-fixed"> - <div class="nav_header pb-3 mb-5"> + <div class="nav_header pb-3 mb-4"> <nuxt-link :to="localePath('/')" class="d-flex"> <img src="@/assets/img/logo.png" alt="Accueil" class="logo"> <div><h1 class="h2">Wotwizard</h1><small class="text-muted">{{ $t('slogan') }}</small></div> </nuxt-link> + <div class="d-flex text-info justify-content-between align-items-baseline mt-3 mx-2"> + <div class="">v0.02</div> + <div class="small" v-if="countMax">Bloc n°<span class="font-weight-bold">{{ countMax.number }}</span> ({{ $d(new Date(countMax.utc0*1000), 'short') }} {{ $t('time.a') }} {{ $d(new Date(countMax.utc0*1000), 'hour') }})</div> + </div> <button type="button" class="close position-absolute d-xl-none" aria-label="Close" @click="toggleMenu"> <span aria-hidden="true">×</span> </button> @@ -12,11 +16,12 @@ <nav> <NavigationMenuGroup v-for="menu in menus" :key="menu.title" :menu="menu"/> </nav> - <div class="version position-absolute p-3 text-muted"><br>v0.01</div> </aside> </template> <script> +import {LAST_BLOCK} from '@/graphql/queries.js' + export default { props: { menus: Array @@ -25,13 +30,12 @@ export default { toggleMenu() { this.$emit('toggleMenu') } - } -} -</script> - -<style lang="scss"> -.version { - bottom: 0; - right: 0; + }, + apollo: { + countMax : { + query: LAST_BLOCK, + error (err) {this.error = err.message} + } + }, } -</style> \ No newline at end of file +</script> \ No newline at end of file diff --git a/graphql/queries.js b/graphql/queries.js index cc96804356e3adec51f451f6f1bf7591c51430b9..0df3c0f8e3365d1373da9e4e98b0fd42b28e2a96 100644 --- a/graphql/queries.js +++ b/graphql/queries.js @@ -1,5 +1,14 @@ import gql from "graphql-tag" +// Pour la sidebar +export const LAST_BLOCK = gql`query LastBlock{ + countMax { + number + bct + utc0 + } +}` + // Pour la page index export const LAST_EVENTS = gql`query LastEvents($start: Int64, $end: Int64) { membersCount(start: $start, end: $end) { diff --git a/i18n/locales/en.json b/i18n/locales/en.json index cdf36239661f739c28910fd2e474bfc6eca3f862..4691a3655e8882125bf4fa8f9aa3de07236eaf22 100644 --- a/i18n/locales/en.json +++ b/i18n/locales/en.json @@ -2,6 +2,7 @@ "accueil": "Home", "aurevoir": "Goodbye to", "bienvenue": "Welcome to", + "bloc": "Block", "certifications": { "envoyees" : "Certificates sent", "recues" : "Certificates received " diff --git a/i18n/locales/es.json b/i18n/locales/es.json index 8a5ff90513ef80ee00db62699d1f1302a473dabf..271c25cf9e2fc84306f2bce168c2a91bb24dfb09 100644 --- a/i18n/locales/es.json +++ b/i18n/locales/es.json @@ -2,6 +2,7 @@ "accueil": "Página principal", "aurevoir": "Salen", "bienvenue": "Entran", + "bloc": "Bloque", "certifications": { "envoyees" : "Certificaciones enviadas", "recues" : "Certificaciones recibidas " diff --git a/i18n/locales/fr.json b/i18n/locales/fr.json index ffadcf63ab84c31b3d82181a78d768aa81ebbc71..a48e931e0f900b40960f7cf51d20fb9cd007d9f8 100644 --- a/i18n/locales/fr.json +++ b/i18n/locales/fr.json @@ -2,6 +2,7 @@ "accueil": "Accueil", "aurevoir": "Au revoir à ", "bienvenue": "Bienvenue à ", + "bloc": "Bloc", "certifications": { "envoyees" : "Certifications envoyées", "recues" : "Certifications reçues "