nfp_sites/nfp_moe/app/footer.js

56 lines
1.7 KiB
JavaScript
Raw Normal View History

const m = require('mithril')
const PageTree = require('./page_tree')
const Authentication = require('./authentication')
const common = require('./common')
const Footer = {
oninit: function(vnode) {
this.year = new Date().getFullYear()
},
view: function() {
return [
m('div.first'),
m('div.middle', [
m('span', 'Sitemap'),
m(m.route.Link, { class: 'root', href: '/' }, 'Home'),
PageTree.Tree.map(function(page) {
return [
m(m.route.Link, { class: 'root', href: '/page/' + page.path }, page.name),
(page.children
? m('ul', page.children.map(function(subpage) {
return m('li', m(m.route.Link, { class: 'child', href: '/page/' + subpage.path }, subpage.name))
}))
: null),
]
}),
m('ul', [
m('li', !Authentication.currentUser
? m(m.route.Link, { class: 'root', href: '/login' }, 'Login')
: null),
m('li', m('button',
{ onclick: common.toggleDarkMode.bind(this) },
common.darkIsOn ? 'Day mode' : 'Night mode'
)),
]),
m('div.meta', [
'Chibi designed and drawn by the amazing and talented ',
m('a', { rel: 'noopener', href: 'https://shoritsu.xyz/', target: '_blank' }, 'SHORITSU'),
'.',
]),
m('div.meta', [
'©'
+ this.year
+ ' NFP Encodes - nfp@nfp.moe - ',
m('a', { rel: 'noopener', href: 'https://www.iubenda.com/privacy-policy/31076050', target: '_blank' }, 'Privacy Policy'),
' (Fuck EU)',
]),
]),
m('div.asuna.spritesheet'),
]
},
}
module.exports = Footer