<?page title="${labels.Information}" contentType="text/html;charset=UTF-8"?>
<zk>
	<window
		vflex="1"
		hflex="1"
		border="normal"
		apply="org.zkoss.bind.BindComposer"
		viewModel="@id('vm') @init('info.bukova.isspst.ui.dashboard.DashBoardVM')">
		<caption
			zclass="form-caption"
			label="${labels.Information}" />
		<vbox
			vflex="1"
			hflex="1">
			<hbox hflex="1">
				<label value="${labels.LogedInUser}" />
				<image src="/img/user-small.png" />
				<label value="@load(vm.user)" />
			</hbox>
			<groupbox
				vflex="1"
				hflex="1"
				mold="3d">
				<caption
					image="/img/commission-small.png"
					label="${labels.CentresForRequirements}" />
				<hbox
					children="@load(vm.centres)"
					vflex="1"
					hflex="1">
					<template name="children">
						<listbox
							model="@load(vm.groupRoles[each])"
							vflex="1"
							hflex="1">
							<listhead>
								<listheader label="@load(each.fullName)" />
							</listhead>
							<template
								name="model"
								var="role">
								<listitem>
									<listcell label="@load(role.description)" />
								</listitem>
							</template>
						</listbox>
					</template>
				</hbox>
			</groupbox>
			<hbox
				vflex="1"
				hflex="1">
				<groupbox
					vflex="1"
					hflex="1"
					mold="3d">
					<caption
						image="/img/commission-small.png"
						label="${labels.WorkgroupMembership}" />
					<vbox
						vflex="1"
						hflex="1"
						sclass="addScrollbar"
						children="@load(vm.workgroups)">
						<template name="children">
							<listbox
								model="@load(vm.groupRoles[each])"
								vflex="1"
								hflex="1">
								<listhead>
									<listheader label="@load(each.fullName)" />
								</listhead>
								<template
									name="model"
									var="role">
									<listitem>
										<listcell label="@load(role.description)" />
									</listitem>
								</template>
							</listbox>
						</template>
					</vbox>
				</groupbox>
				<groupbox
					vflex="1"
					hflex="1"
					mold="3d">
					<caption
						image="/img/money-small.png"
						label="${labels.WorkgroupLimits}" />
					<vbox
						vflex="1"
						hflex="1"
						sclass="addScrollbar"
						children="@load(vm.workgroups)">
						<template name="children">
							<listbox
								vflex="1"
								hflex="1">
								<listhead>
									<listheader label="@load(each.fullName)" />
									<listheader />
								</listhead>
								<listitem>
									<listcell label="${labels.Limit}" />
									<listcell label="@load(vm.workgroupLimit[each]) @converter(vm.standardBigDecimalConverter)" />
								</listitem>
								<listitem>
									<listcell label="${labels.Spent}" />
									<listcell label="@load(vm.workgroupSpent[each]) @converter(vm.standardBigDecimalConverter)" />
								</listitem>
							</listbox>
						</template>
					</vbox>
				</groupbox>
			</hbox>
		</vbox>
	</window>
</zk>