corporate-frontend-mithril
Version:
Corporate frontend MithrilJS modules
38 lines (34 loc) • 1.97 kB
JavaScript
const _ = require('lodash');
const BundlesPanelModel = require('./bundles-panel-model');
module.exports = class BundlesPanelView {
view(vnode) {
return m('.b-bundles-panel.b-component', [
m('.b-title.b-title--h2.b-text--upper.b-text--align-center.b-component--tight', BundlesPanelModel.getCurrentServerKey()),
m('.b-bundles-panel__content-container.b-component', [
m('.b-featured-table', [
m('.b-featured-table__row', [
m('.2/7.b-featured-table__cell.b-featured-table__cell--head', 'Bundle Name'),
m('.1/7.b-featured-table__cell.b-featured-table__cell--head', 'Author1'),
m('.1/7.b-featured-table__cell.b-featured-table__cell--head', 'Publish1'),
m('.1/7.b-featured-table__cell.b-featured-table__cell--head', 'Publish2'),
m('.1/7.b-featured-table__cell.b-featured-table__cell--head', 'Publish3'),
]),
_.map(vnode.attrs.bundleGroups, (bundleGroup)=> {
return m('.b-featured-table__row', [
m('.2/7.grid_cell.b-featured-table__cell', `${bundleGroup[0]}`),
_.map(BundlesPanelModel.generateStandardBundleList(bundleGroup[1]), (bundle)=> {
return m('.1/7.grid_cell.b-featured-table__cell', [
m('span.b-text', `${bundle.version ? bundle.version: ''}`),
m('span.b-text', `${bundle.version ? BundlesPanelModel.getBundleStateText(bundle): ''}`),
]);
}),
]);
}),
]),
]),
m('div', [
m('span', 'Synchronise bundle status every 5 seconds for DEV, TEST, TRAIN and PROD.'),
]),
]);
}
};