From 72a8654c2f88c29cb80993e0e793e2abf209bdc3 Mon Sep 17 00:00:00 2001 From: jvyden Date: Mon, 22 Nov 2021 21:49:22 -0500 Subject: [PATCH] Pin session items to right side, add link to profile --- .../Pages/Layouts/BaseLayout.cshtml | 19 ++++++++++++++++--- .../Pages/Layouts/BaseLayout.cshtml.cs | 3 +++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml b/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml index 6dc55c22..a025f24b 100644 --- a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml +++ b/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml @@ -6,8 +6,8 @@ @{ if (Model!.User == null) { - Model.NavigationItems.Add(new PageNavigationItem("Log in", "/login", "user alternate")); - Model.NavigationItems.Add(new PageNavigationItem("Register", "/register", "user alternate edit")); + Model.NavigationItemsRight.Add(new PageNavigationItem("Log in", "/login", "user alternate")); + Model.NavigationItemsRight.Add(new PageNavigationItem("Register", "/register", "user alternate edit")); } else { @@ -15,7 +15,8 @@ { Model.NavigationItems.Add(new PageNavigationItem("Authentication", "/authentication", "key")); } - Model.NavigationItems.Add(new PageNavigationItem("Log out", "/logout", "user alternate slash")); // should always be last + Model.NavigationItemsRight.Add(new PageNavigationItem("Profile", "/user/" + Model.User.UserId, "user alternate")); + Model.NavigationItemsRight.Add(new PageNavigationItem("Log out", "/logout", "user alternate slash")); // should always be last } } @@ -40,6 +41,18 @@ @navigationItem.Name } + diff --git a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs b/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs index 3d3fbcc2..9ebe8b9f 100644 --- a/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs +++ b/ProjectLighthouse/Pages/Layouts/BaseLayout.cshtml.cs @@ -31,5 +31,8 @@ namespace LBPUnion.ProjectLighthouse.Pages.Layouts new PageNavigationItem("Photos", "/photos/0", "camera"), }; + public readonly List NavigationItemsRight = new() + {}; + } } \ No newline at end of file