Skip to content
Snippets Groups Projects
Commit be6441b7 authored by Pierre-Jean CHANCELLIER's avatar Pierre-Jean CHANCELLIER
Browse files

add block number in the menu

parent 7534b7e5
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
......@@ -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')
}
}
......
<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>
......
<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">&times;</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
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) {
......
......@@ -2,6 +2,7 @@
"accueil": "Home",
"aurevoir": "Goodbye to",
"bienvenue": "Welcome to",
"bloc": "Block",
"certifications": {
"envoyees" : "Certificates sent",
"recues" : "Certificates received "
......
......@@ -2,6 +2,7 @@
"accueil": "Página principal",
"aurevoir": "Salen",
"bienvenue": "Entran",
"bloc": "Bloque",
"certifications": {
"envoyees" : "Certificaciones enviadas",
"recues" : "Certificaciones recibidas "
......
......@@ -2,6 +2,7 @@
"accueil": "Accueil",
"aurevoir": "Au revoir à",
"bienvenue": "Bienvenue à",
"bloc": "Bloc",
"certifications": {
"envoyees" : "Certifications envoyées",
"recues" : "Certifications reçues "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment