2016-03-31 22:33:49 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const config = require('../config.js');
|
2016-04-09 18:54:23 +02:00
|
|
|
const views = require('../util/views.js');
|
2016-03-31 22:33:49 +02:00
|
|
|
|
2016-04-09 18:54:23 +02:00
|
|
|
class HomeView {
|
2016-03-31 22:33:49 +02:00
|
|
|
constructor() {
|
2016-05-20 21:35:12 +02:00
|
|
|
this._template = views.getTemplate('home');
|
2016-03-31 22:33:49 +02:00
|
|
|
}
|
|
|
|
|
2016-04-08 10:35:38 +02:00
|
|
|
render(ctx) {
|
2016-04-09 18:54:23 +02:00
|
|
|
const target = document.getElementById('content-holder');
|
2016-05-20 21:35:12 +02:00
|
|
|
const source = this._template({
|
2016-04-06 20:38:45 +02:00
|
|
|
name: config.name,
|
2016-03-31 23:18:08 +02:00
|
|
|
version: config.meta.version,
|
2016-04-05 17:57:26 +02:00
|
|
|
buildDate: config.meta.buildDate,
|
2016-05-22 22:39:31 +02:00
|
|
|
diskUsage: ctx.diskUsage,
|
|
|
|
postCount: ctx.postCount,
|
2016-04-08 10:35:38 +02:00
|
|
|
});
|
2016-04-09 18:54:23 +02:00
|
|
|
|
2016-05-11 21:29:57 +02:00
|
|
|
views.listenToMessages(source);
|
2016-04-09 18:54:23 +02:00
|
|
|
views.showView(target, source);
|
2016-03-31 22:33:49 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = HomeView;
|