2022-08-05 14:26:29 +00:00
|
|
|
const m = require('mithril')
|
|
|
|
const PageTree = require('./page_tree')
|
|
|
|
const Authentication = require('./authentication')
|
|
|
|
|
|
|
|
const Footer = {
|
|
|
|
oninit: function(vnode) {
|
|
|
|
this.year = new Date().getFullYear()
|
|
|
|
},
|
|
|
|
|
|
|
|
view: function() {
|
|
|
|
return [
|
2022-08-18 09:59:48 +00:00
|
|
|
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),
|
|
|
|
]
|
|
|
|
}),
|
|
|
|
|
|
|
|
!Authentication.currentUser
|
|
|
|
? m(m.route.Link, { class: 'root', href: '/login' }, 'Login')
|
|
|
|
: null,
|
|
|
|
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)',
|
|
|
|
]),
|
2022-08-05 14:26:29 +00:00
|
|
|
]),
|
2022-08-18 09:59:48 +00:00
|
|
|
m('div.asuna.spritesheet'),
|
2022-08-05 14:26:29 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Footer
|