diff --git a/src/index.js b/src/index.js index 1a95c4ac6e76e1fce31fb927f7f7e772ecbfe44f..bfe37ecff44e61b60f0efbc081245d747d1b9234 100644 --- a/src/index.js +++ b/src/index.js @@ -2,6 +2,7 @@ const m = require('mithril'); const Layout = require('./views/layout'); +const amivLayout = require('./views/amiv/amivLayout'); const amiv = require('./views/amiv'); const login = require('./views/login'); const statuten = require('./views/amiv/statuten'); @@ -13,12 +14,12 @@ const board = require('./views/amiv/board'); m.route(document.body, '/', { '/': { render() { - return m(Layout, m(amiv)); + return m(Layout, m(amivLayout, m(amiv))); }, }, '/amiv/statuten': { render() { - return m(Layout, m(statuten)); + return m(Layout, m(amivLayout, m(statuten))); }, }, '/contact': { @@ -28,7 +29,7 @@ m.route(document.body, '/', { }, '/amiv/aufenthaltsraum': { render() { - return m(Layout, m(aufenthaltsraum)); + return m(Layout, m(amivLayout, m(aufenthaltsraum))); }, }, '/login': { @@ -38,7 +39,7 @@ m.route(document.body, '/', { }, '/amiv/board': { render() { - return m(Layout, m(board)); + return m(Layout, m(amivLayout, m(board))); }, }, }); diff --git a/src/views/amiv/amivLayout.js b/src/views/amiv/amivLayout.js new file mode 100644 index 0000000000000000000000000000000000000000..e8041447f139a2a568fc8d2b3bd0c7dcb90f2f3d --- /dev/null +++ b/src/views/amiv/amivLayout.js @@ -0,0 +1,16 @@ +const m = require('mithril'); + +module.exports = { + view(vnode) { + return m('div', [ + m('ul', [ + m('li', m('a', { href: '/amiv/board', oncreate: m.route.link }, 'Vorstand')), + m('li', m('a', { href: '/amiv/aufenthaltsraum', oncreate: m.route.link }, 'Aufenthaltsraum')), + m('li', m('a', { href: '/amiv/statuten', oncreate: m.route.link }, 'Statuten')), + m('li', m('a', { href: '/amiv/comissions', oncreate: m.route.link }, 'Kommissionen')), + m('li', m('a', { href: '/amiv/protocols', oncreate: m.route.link }, 'Protokolle')), + ]), + m('main', vnode.children), + ]); + }, +};