2019-09-16 16:47:29 +00:00
|
|
|
const m = require('mithril')
|
2019-10-01 12:19:10 +00:00
|
|
|
const Page = require('../api/page.p')
|
2019-09-16 16:47:29 +00:00
|
|
|
const Authentication = require('../authentication')
|
|
|
|
|
|
|
|
const Footer = {
|
|
|
|
oninit: function(vnode) {
|
|
|
|
this.year = new Date().getFullYear()
|
|
|
|
},
|
|
|
|
|
|
|
|
view: function() {
|
|
|
|
return [
|
2019-10-03 12:55:13 +00:00
|
|
|
m('div.footer-filler'),
|
2019-09-16 16:47:29 +00:00
|
|
|
m('div.sitemap', [
|
|
|
|
m('div', 'Sitemap'),
|
|
|
|
m(m.route.Link, { class: 'root', href: '/' }, 'Home'),
|
2019-10-01 11:35:00 +00:00
|
|
|
Page.Tree.map(function(page) {
|
2019-09-16 16:47:29 +00:00
|
|
|
return [
|
|
|
|
m(m.route.Link, { class: 'root', href: '/page/' + page.path }, page.name),
|
|
|
|
(page.children.length
|
|
|
|
? 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,
|
2019-10-01 03:45:44 +00:00
|
|
|
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)',
|
|
|
|
]),
|
2019-09-16 16:47:29 +00:00
|
|
|
]),
|
2019-10-01 03:45:44 +00:00
|
|
|
m('div.footer-logo'),
|
2019-09-16 16:47:29 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Footer
|