Added account layout for the basic theme.

pull/344/head
Halil ibrahim Kalkan 7 years ago
parent ed1d0317ce
commit 2bec3c6438

@ -15,7 +15,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic
case StandardLayouts.Application:
return "~/Themes/Basic/Layouts/Application.cshtml";
case StandardLayouts.Account:
return "~/Themes/Basic/Layouts/Application.cshtml";
return "~/Themes/Basic/Layouts/Account.cshtml";
case StandardLayouts.Empty:
return "~/Themes/Basic/Layouts/Empty.cshtml";
default:

@ -0,0 +1,48 @@
@using Volo.Abp.AspNetCore.Mvc.AntiForgery
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.MainNavbar
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.PageAlerts
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Components
@inject IAbpAntiForgeryManager AbpAntiForgeryManager
@inject IBrandingProvider BrandingProvider
@{
Layout = null;
AbpAntiForgeryManager.SetCookie();
var containerClass = ViewBag.FluidLayout == true ? "container-fluid" : "container"; //TODO: Better and type-safe options
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>@(ViewBag.Title == null ? BrandingProvider.AppName : ViewBag.Title)</title>
<abp-style-bundle name="@BasicThemeBundles.Styles.Global" />
@RenderSection("styles", false)
</head>
<body>
@(await Component.InvokeAsync<MainNavbarViewComponent>())
<div class="@containerClass">
<abp-row>
<abp-column size-md="_4" offset-md="_4">
@(await Component.InvokeAsync<PageAlertsViewComponent>())
@RenderBody()
</abp-column>
</abp-row>
</div>
<abp-script-bundle name="@BasicThemeBundles.Scripts.Global" />
<script type="text/javascript" src="~/Abp/ApplicationConfigurationScript"></script>
<script type="text/javascript" src="~/Abp/ServiceProxyScript"></script>
@RenderSection("scripts", false)
</body>
</html>

@ -4,33 +4,27 @@
@inherits Volo.Abp.Account.Web.Pages.Account.AccountPage
@inject Volo.Abp.Settings.ISettingManager SettingManager
<h2>@L["Login"]</h2>
<abp-row>
<abp-column size-md="_3">
<form method="post">
<abp-input asp-for="Input.UserNameOrEmailAddress" auto-focus="true" />
<abp-input asp-for="Input.Password" />
<abp-input asp-for="Input.RememberMe" class="mb-3" />
<abp-button button-type="Primary" type="submit">@L["Login"]</abp-button>
@if (string.Equals(await SettingManager.GetOrNullAsync(AccountSettingNames.IsSelfRegistrationEnabled), "true", StringComparison.OrdinalIgnoreCase))
{
<a abp-button="Secondary" href="@Url.Page("./Register", new {returnUrl = Model.ReturnUrl, returnUrlHash = Model.ReturnUrlHash})">@L["Register"]</a>
}
</form>
</abp-column>
@if (Model.ExternalLogins.Any())
<form method="post">
<abp-input asp-for="Input.UserNameOrEmailAddress" auto-focus="true" />
<abp-input asp-for="Input.Password" />
<abp-input asp-for="Input.RememberMe" class="mb-3" />
<abp-button button-type="Primary" type="submit">@L["Login"]</abp-button>
@if (string.Equals(await SettingManager.GetOrNullAsync(AccountSettingNames.IsSelfRegistrationEnabled), "true", StringComparison.OrdinalIgnoreCase))
{
<abp-column size-md="_3">
<h4>Use another service to log in.</h4>
<form asp-page="./Login" asp-page-handler="ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" asp-route-returnUrlHash="@Model.ReturnUrlHash" method="post">
<div>
@foreach (var provider in Model.ExternalLogins)
{
<abp-button button-type="Primary" type="submit" name="provider" value="@provider.Name">@provider.DisplayName</abp-button>
}
</div>
</form>
</abp-column>
<a abp-button="Secondary" href="@Url.Page("./Register", new {returnUrl = Model.ReturnUrl, returnUrlHash = Model.ReturnUrlHash})">@L["Register"]</a>
}
</form>
</abp-row>
@if (Model.ExternalLogins.Any())
{
<h4>Use another service to log in.</h4>
<form asp-page="./Login" asp-page-handler="ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" asp-route-returnUrlHash="@Model.ReturnUrlHash" method="post">
<div>
@foreach (var provider in Model.ExternalLogins)
{
<abp-button button-type="Primary" type="submit" name="provider" value="@provider.Name">@provider.DisplayName</abp-button>
}
</div>
</form>
}

@ -2,13 +2,9 @@
@model Volo.Abp.Account.Web.Pages.Account.RegisterModel
@inherits Volo.Abp.Account.Web.Pages.Account.AccountPage
<h2>@L["Register"]</h2>
<abp-row>
<abp-column size-md="_3">
<form method="post">
<abp-input asp-for="Input.UserName" auto-focus="true" />
<abp-input asp-for="Input.EmailAddress" />
<abp-input asp-for="Input.Password" />
<abp-button button-type="Primary" type="submit">@L["Register"]</abp-button>
</form>
</abp-column>
</abp-row>
<form method="post">
<abp-input asp-for="Input.UserName" auto-focus="true" />
<abp-input asp-for="Input.EmailAddress" />
<abp-input asp-for="Input.Password" />
<abp-button button-type="Primary" type="submit">@L["Register"]</abp-button>
</form>

@ -0,0 +1,5 @@
@using Volo.Abp.AspNetCore.Mvc.UI.Theming
@inject IThemeManager ThemeManager
@{
Layout = ThemeManager.CurrentTheme.GetAccountLayout();
}
Loading…
Cancel
Save