corporate-frontend-mithril
Version:
Corporate frontend MithrilJS modules
54 lines (47 loc) • 2.37 kB
JavaScript
const LandingPageModel = require('./landing-page-model');
const AemBoardHeaderModel = require('./../aem-board-header/aem-board-header-view');
const BundlesPanelView = require('./../bundles-panel/bundles-panel-view');
const ComparedBundlesPanelView = require('./../compared-bundles-panel/compared-bundles-panel-view');
const SplashPageView = require('./../../splash-page/splash-page');
module.exports = class LandingPageView {
constructor(){
}
oninit(vnode) {
LandingPageModel.initState().then((result)=> {
vnode.state.title = result;
m.redraw();
});
}
view() {
return LandingPageModel.isReady() ?
m('.b-page.b-page--bg-dark', [
m(AemBoardHeaderModel),
m('.b-container.b-container--section',[
//DEV
m(`.b-container${LandingPageModel.isCurrentKey('dev')? '':'.b-hidden--fixed'}`, [
m(BundlesPanelView, LandingPageModel.getServerData('dev')),
]),
//TEST
m(`.b-container${LandingPageModel.isCurrentKey('test')? '':'.b-hidden--fixed'}`, [
m(BundlesPanelView, LandingPageModel.getServerData('test')),
]),
//COMPARE
m(`.b-container${LandingPageModel.isCurrentKey('compareTrain')? '':'.b-hidden--fixed'}`, [
m(ComparedBundlesPanelView, LandingPageModel.getComparedData('test', 'train')),
]),
//TRAIN
m(`.b-container${LandingPageModel.isCurrentKey('train')? '':'.b-hidden--fixed'}`, [
m(BundlesPanelView, LandingPageModel.getServerData('train')),
]),
//COMPARE
m(`.b-container${LandingPageModel.isCurrentKey('compareProd')? '':'.b-hidden--fixed'}`, [
m(ComparedBundlesPanelView, LandingPageModel.getComparedData('train', 'prod')),
]),
//PROD
m(`.b-container${LandingPageModel.isCurrentKey('prod')? '':'.b-hidden--fixed'}`, [
m(BundlesPanelView, LandingPageModel.getServerData('prod')),
]),
]),
]): m(SplashPageView);
}
};