@model GreenTree.Nachtragsmanagement.Web.Models.Global.FooterModel

<script>
	function acceptFooterRoleSelection() {
		window.location = "@Url.Action("SetRole", "Global")?roleId=" + devListBoxRoles.GetValue();
	}
</script>

@Html.DevExpress().PopupControl(s =>
{
	s.Name = "devPopupControlRoles";
	s.HeaderText = "Rolle wechseln";
	s.ShowFooter = false;
	s.ShowMaximizeButton = false;
	s.Modal = true;
	s.Width = new Unit(350, UnitType.Pixel);
	s.PopupHorizontalAlign = PopupHorizontalAlign.WindowCenter;
	s.PopupVerticalAlign = PopupVerticalAlign.WindowCenter;
	s.CloseAction = CloseAction.CloseButton;
	s.SetContent(() =>
	{
		Html.DevExpress().ListBox(l =>
		{
			l.Name = "devListBoxRoles";
			l.Properties.TextField = "Description";
			l.Properties.ValueField = "ID";
			l.Width = new Unit(100, UnitType.Percentage);
			l.Height = new Unit(250, UnitType.Pixel);
			l.Properties.RootStyle.Border.BorderStyle = BorderStyle.None;
		}).BindList(ViewData["Roles"]).GetHtml();
		Html.RenderPartial(
			"~/Views/Shared/_PopupButtonPanel.cshtml",
			new GreenTree.Nachtragsmanagement.Web.Models.Global.PopupModel
			{
				PopupName = "devPopupControlRoles",
				AcceptFunction = "function (s, e) { acceptFooterRoleSelection(); }"
			});
	});
	s.Styles.Content.Paddings.Padding = new Unit(0);
}).GetHtml()

<div class="globalFooter">
	<div class="innerFooter">
		@if (Model != null)
		{
			<div class="linkContainer">
				@Html.DevExpress().Button(s =>
				{
					s.Name = "devButtonLogout";
					s.RenderMode = ButtonRenderMode.Link;
					s.Text = "Ausloggen";
					s.ClientSideEvents.Click = "function (s, e) { window.location = \"" + Url.Action("logout", "login") + "\" }";
					s.Style.Add("color", "white");
				}).GetHtml()
			</div>
			<div class="seperator">
			</div>
			<span class="userInfo">
				@String.Format("{0}, {1} ({2})", Model.Lastname, Model.Forename, Model.CustomNumber)
			</span>
			<div class="seperator">
			</div>
			<div class="linkContainer">
				@Html.DevExpress().Button(s =>
				{
					s.Name = "devButtonRole";
					s.RenderMode = ButtonRenderMode.Link;
					s.Text = Model.RoleDescription;
					s.ToolTip = "Rolle wechseln";
					s.ClientSideEvents.Click = "function (s, e) { devPopupControlRoles.Show(); }";
					s.Style.Add("color", "white");
				}).GetHtml()
			</div>
			<div class="linkContainer popupPanel">

			</div>
		}
		<span class="versionInfo">
			@String.Format("v{0}", GreenTree.Nachtragsmanagement.Core.AppendixVersion.CurrentVersion)
		</span>
	</div>
</div>