1
0
mirror of https://github.com/exane/not-gwent-online synced 2024-10-31 10:36:53 +00:00

rewrite navigation

This commit is contained in:
devfake 2015-06-22 19:16:22 +02:00
parent 7dbb617323
commit fa7243a871
5 changed files with 31 additions and 8 deletions

View File

@ -1,5 +1,11 @@
module.exports = { module.exports = {
template: "<h2>deckbuilder hier</h2>" template: "<h2>deckbuilder hier</h2>",
data: function() {
return {
}
}
}; };

View File

@ -2,6 +2,8 @@ module.exports = {
template: require('../views/inner.html'), template: require('../views/inner.html'),
inherit: true,
data: function() { data: function() {
return { return {
modal: false modal: false

View File

@ -6,6 +6,17 @@ module.exports = {
inherit: true, inherit: true,
data: function() {
return {
// todo: work with slug filter
navigation: [
{ name: 'Lobby', route: '/lobby' },
{ name: 'Deck Builder', route: '/deck-builder' },
{ name: 'Highscore', route: '/highscore' }
]
}
},
methods: { methods: {
searchMatch: function() { searchMatch: function() {
this.modal = true; this.modal = true;

View File

@ -1,8 +1,10 @@
<nav> <nav>
<ul> <ul>
<li><a class="active" v-link="/lobby">Lobby</a></li> <li v-repeat="nav: navigation">
<li><a v-link="/deck-builder">Deck Builder</a></li> <a v-link="{{ nav.route }}" class="{{ route.path == nav.route ? 'active' : '' }}">
<li><a v-on="click: changeView('highscore')">Highscore</a></li> {{ nav.name }}
</a>
</li>
<li class="sub-nav" v-on="click: searchMatch"><a>Quick Match</a></li> <li class="sub-nav" v-on="click: searchMatch"><a>Quick Match</a></li>
</ul> </ul>

View File

@ -1,8 +1,11 @@
<?php <?php
get('/lobby', function() { get('/lobby', function() {
return view('app') return view('app')->withSection('inner');
->withSection('inner'); });
get('/deck-builder', function() {
return view('app')->withSection('inner');
}); });
get('/', function() { get('/', function() {
@ -10,6 +13,5 @@
return redirect('/lobby'); return redirect('/lobby');
} }
return view('app') return view('app')->withSection('landing');
->withSection('landing');
}); });