Add BaseLayout

All pages should be using this.
This commit is contained in:
jvyden 2021-11-19 21:51:33 -05:00
commit 4738684f6e
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
6 changed files with 31 additions and 24 deletions

View file

@ -1,21 +1,7 @@
@page "/" @page "/"
@using LBPUnion.ProjectLighthouse.Helpers @model LBPUnion.ProjectLighthouse.Pages.ExternalAuth.LandingPage
@model LBPUnion.ProjectLighthouse.Controllers.ExternalAuth.LandingPage
@{ @{
Layout = null; Layout = "Layouts/BaseLayout";
} }
<!DOCTYPE html>
<html>
<head>
<title>Project Lighthouse External Auth</title>
</head>
<body>
test test
</body>
<footer>
<p>Page generated by @GitVersionHelper.FullVersion</p>
</footer>
</html>

View file

@ -1,10 +1,12 @@
using JetBrains.Annotations;
using LBPUnion.ProjectLighthouse.Pages.Layouts;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace LBPUnion.ProjectLighthouse.Controllers.ExternalAuth namespace LBPUnion.ProjectLighthouse.Pages.ExternalAuth
{ {
public class LandingPage : PageModel public class LandingPage : BaseLayout
{ {
[UsedImplicitly]
public IActionResult OnGet() => this.Page(); public IActionResult OnGet() => this.Page();
} }
} }

View file

@ -0,0 +1,16 @@
@using LBPUnion.ProjectLighthouse.Helpers
@model LBPUnion.ProjectLighthouse.Pages.Layouts.BaseLayout
<!DOCTYPE html>
<html lang="en">
<head>
<title>Project Lighthouse</title>
</head>
<body>
@RenderBody()
</body>
<footer>
<p>Page generated by @GitVersionHelper.FullVersion</p>
</footer>
</html>

View file

@ -0,0 +1,7 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace LBPUnion.ProjectLighthouse.Pages.Layouts
{
public class BaseLayout : PageModel
{}
}

View file

@ -32,10 +32,6 @@
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Controllers\ExternalAuth"/>
</ItemGroup>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent"> <Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="git describe --long --always --dirty --exclude=\* --abbrev=8 &gt; &quot;$(ProjectDir)/gitVersion.txt&quot;"/> <Exec Command="git describe --long --always --dirty --exclude=\* --abbrev=8 &gt; &quot;$(ProjectDir)/gitVersion.txt&quot;"/>
<Exec Command="git branch --show-current &gt; &quot;$(ProjectDir)/gitBranch.txt&quot;"/> <Exec Command="git branch --show-current &gt; &quot;$(ProjectDir)/gitBranch.txt&quot;"/>

View file

@ -153,7 +153,7 @@ namespace LBPUnion.ProjectLighthouse
app.UseRouting(); app.UseRouting();
// app.UseEndpoints(endpoints => endpoints.MapControllers()); app.UseEndpoints(endpoints => endpoints.MapControllers());
app.UseEndpoints(endpoints => endpoints.MapRazorPages()); app.UseEndpoints(endpoints => endpoints.MapRazorPages());
} }
} }