75 lines
2.2 KiB
TypeScript
75 lines
2.2 KiB
TypeScript
import m from "mithril"
|
|
|
|
export var headerdata = {
|
|
date: new Date(),
|
|
version: "",
|
|
username: "Nicht angemeldet",
|
|
userid: "Nicht angemeldet",
|
|
appheader: "Der gläserne Kunde"
|
|
}
|
|
|
|
export const header: m.Component = {
|
|
view: (vnode) => {
|
|
return m("div.w3-row-padding.w3-theme",
|
|
m("div.w3-twothird.w3-padding-16", {style: "display: flex; justify-content: space-between;"},
|
|
// <img src="pfad/zum/bild.jpg" width="300" height="200" alt="Beschreibung des Bildes">
|
|
m("img", {src: "static/KBplus-Logo.png", height: 80, alt: "KBPlus CRM Logo"}),
|
|
m("h1",
|
|
m("div.w3-cell", headerdata.appheader)
|
|
)
|
|
),
|
|
m("div.w3-third.w3-display-container.w3-small",
|
|
m("table.w3-right",
|
|
m("tr.w3-hide-small",
|
|
m("td", "Datum:"),
|
|
m("td", headerdata.date.toLocaleDateString())
|
|
),
|
|
m("tr.w3-hide-small",
|
|
m("td", "Version:"),
|
|
m("td", headerdata.version)
|
|
),
|
|
m("tr",
|
|
m("td", "Benutzer:"),
|
|
m("td", headerdata.username)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
}
|
|
}
|
|
|
|
export const menubar: m.Component = {
|
|
view: (vnode) => {
|
|
return m("div.w3-bar.w3-black",
|
|
vnode.children
|
|
)
|
|
}
|
|
}
|
|
|
|
let menustack: MenuStack = null
|
|
|
|
export function init_menustack(menubarmountpoint):void {
|
|
if (menustack == null) {menustack = new MenuStack(menubarmountpoint)}
|
|
}
|
|
export function get_menustack(): MenuStack {
|
|
return menustack
|
|
}
|
|
|
|
class MenuStack {
|
|
private menustack = []
|
|
private menubarmountpoint = null
|
|
constructor(menubarmountpoint) {
|
|
this.menustack = []
|
|
this.menubarmountpoint = menubarmountpoint
|
|
}
|
|
push(menubar) {
|
|
this.menustack.push(menubar)
|
|
m.mount(this.menubarmountpoint, menubar)
|
|
}
|
|
pop() {
|
|
this.menustack.pop()
|
|
let menubar = this.menustack[this.menustack.length - 1]
|
|
m.mount(this.menubarmountpoint, menubar)
|
|
}
|
|
}
|