diff --git a/mocha-dotnet/src/app/Mocha.ServerApplication/MochaWebApplication.cs b/mocha-dotnet/src/app/Mocha.ServerApplication/MochaWebApplication.cs index 5912d53..64d145f 100644 --- a/mocha-dotnet/src/app/Mocha.ServerApplication/MochaWebApplication.cs +++ b/mocha-dotnet/src/app/Mocha.ServerApplication/MochaWebApplication.cs @@ -81,11 +81,49 @@ public abstract class MochaWebApplication : WebApplication body > form > div.uwt-panel > div.uwt-content > div:first-child { background-image: url('" + app.Oms.GetAttachmentUrl(loginHeaderImage) + @"'); + width: 256px; + height: 256px; + margin-left: auto; + margin-right: auto; + background-size: cover; +} +body > form > div.uwt-panel { + width: 600px; + margin-left: auto; + margin-right: auto; + margin-top: 128px; +} +h1 +{ +font-weight: lighter; +} +.uwt-copyright-text +{ + padding: 32px; + text-align: center; } ")); } } - protected override void CreateChildControls() + + protected override void OnInit(RenderEventArgs e) + { + base.OnInit(e); + + if (e.Request.Form.ContainsKey("username") && e.Request.Form.ContainsKey("password")) + { + if (e.Request.Form["username"] == "mocha") + { + if (e.Request.Form["password"] == "testing") + { + e.Response.Redirect("~/d/home.htmld"); + } + } + } + } + + + protected override void CreateChildControls() { base.CreateChildControls(); @@ -104,7 +142,7 @@ body > form > div.uwt-panel > div.uwt-content > div:first-child new FormView.FormViewItem("User _name", new TextBox() { Name = "username" }), new FormView.FormViewItem("_Password", new TextBox(TextBoxType.Password) { Name = "password" } ) })); - panel.FooterControls.Add(new Button("_Log In") { UseSubmitBehavior = true }); + panel.FooterControls.Add(new Button("_Log In") { ThemeColorPreset = ThemeColorPreset.Primary, UseSubmitBehavior = true }); Controls.Add(panel); Literal footer = new Literal("