From a31085c08afccb87f4e7d607d8e4ab535b30b63b Mon Sep 17 00:00:00 2001 From: jvyden Date: Fri, 19 Nov 2021 22:00:08 -0500 Subject: [PATCH] Add page navigation bar --- .../Pages/ExternalAuth/LandingPage.cshtml | 2 +- ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml | 9 +++++++++ .../Pages/Layouts/BaseLayout.cshtml.cs | 11 ++++++++++- ProjectLighthouse/Types/PageNavigationItem.cs | 13 +++++++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 ProjectLighthouse/Types/PageNavigationItem.cs diff --git a/ProjectLighthouse/Pages/ExternalAuth/LandingPage.cshtml b/ProjectLighthouse/Pages/ExternalAuth/LandingPage.cshtml index 53141670..9cf7302c 100644 --- a/ProjectLighthouse/Pages/ExternalAuth/LandingPage.cshtml +++ b/ProjectLighthouse/Pages/ExternalAuth/LandingPage.cshtml @@ -4,4 +4,4 @@ @{ Layout = "Layouts/BaseLayout"; } -test +

Welcome to Project Lighthouse.

\ No newline at end of file diff --git a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml b/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml index 5a3d8255..13b53fff 100644 --- a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml +++ b/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml @@ -1,4 +1,5 @@ @using LBPUnion.ProjectLighthouse.Helpers +@using LBPUnion.ProjectLighthouse.Types @model LBPUnion.ProjectLighthouse.Pages.Layouts.BaseLayout @@ -7,6 +8,14 @@ Project Lighthouse +
+ +
@RenderBody() diff --git a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs b/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs index df4a1a2f..cfcd8349 100644 --- a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs +++ b/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs @@ -1,7 +1,16 @@ +using System.Collections.Generic; +using LBPUnion.ProjectLighthouse.Types; using Microsoft.AspNetCore.Mvc.RazorPages; namespace LBPUnion.ProjectLighthouse.Pages.Layouts { public class BaseLayout : PageModel - {} + { + public readonly List NavigationItems = new() + { + new PageNavigationItem("Home", "/"), + new PageNavigationItem("Register", "/register"), + new PageNavigationItem("Login", "/login"), + }; + } } \ No newline at end of file diff --git a/ProjectLighthouse/Types/PageNavigationItem.cs b/ProjectLighthouse/Types/PageNavigationItem.cs new file mode 100644 index 00000000..409622e5 --- /dev/null +++ b/ProjectLighthouse/Types/PageNavigationItem.cs @@ -0,0 +1,13 @@ +namespace LBPUnion.ProjectLighthouse.Types +{ + public class PageNavigationItem + { + public PageNavigationItem(string name, string url) + { + this.Name = name; + this.Url = url; + } + public string Name { get; set; } + public string Url { get; set; } + } +} \ No newline at end of file