diff --git a/TASVideos/Extensions/ViewDataDictionaryExtensions.cs b/TASVideos/Extensions/ViewDataDictionaryExtensions.cs index 30cec757b..73f4e00f0 100644 --- a/TASVideos/Extensions/ViewDataDictionaryExtensions.cs +++ b/TASVideos/Extensions/ViewDataDictionaryExtensions.cs @@ -45,10 +45,10 @@ public static string GetHeading(this ViewDataDictionary viewData) public static void SetWikiPage(this ViewDataDictionary viewData, IWikiPage wikiPage) => viewData["WikiPage"] = wikiPage; - public static void SetNavigation(this ViewDataDictionary viewData, int id, string fmtStr = "{0}") + public static void SetNavigation(this ViewDataDictionary viewData, int id, string suffix) { viewData["NavigationId"] = id; - viewData["NavigationFmtStr"] = fmtStr; + viewData["NavigationSuffix"] = suffix; } public static string ActivePageClass(this ViewDataDictionary viewData, string page) diff --git a/TASVideos/Pages/GameGroups/Index.cshtml b/TASVideos/Pages/GameGroups/Index.cshtml index 5506599ca..23e5e6b7a 100644 --- a/TASVideos/Pages/GameGroups/Index.cshtml +++ b/TASVideos/Pages/GameGroups/Index.cshtml @@ -2,10 +2,6 @@ @model IndexModel @{ ViewData.SetTitle($"Games for Group: {Model.Name}"); - if (int.TryParse(Model.Id, out var id)) - { - ViewData.SetNavigation(id, "/GameGroups/{0}"); - } } diff --git a/TASVideos/Pages/Games/Index.cshtml b/TASVideos/Pages/Games/Index.cshtml index 38d5417be..1fbea0c10 100644 --- a/TASVideos/Pages/Games/Index.cshtml +++ b/TASVideos/Pages/Games/Index.cshtml @@ -20,7 +20,7 @@ if (int.TryParse(Model.Id, out int id)) { - ViewData.SetNavigation(id, "/{0}G"); + ViewData.SetNavigation(id, "G"); } } diff --git a/TASVideos/Pages/Shared/_Layout.cshtml b/TASVideos/Pages/Shared/_Layout.cshtml index 60f329138..b49393a5f 100644 --- a/TASVideos/Pages/Shared/_Layout.cshtml +++ b/TASVideos/Pages/Shared/_Layout.cshtml @@ -89,7 +89,6 @@ var heading = ViewData.GetHeading(); int? prev = null; int? next = null; - string? fmtStr = ViewData["NavigationFmtStr"] as string; if (User.Has(PermissionTo.CatalogMovies)) { var id = ViewData.Int("NavigationId"); @@ -102,7 +101,7 @@

- + @if (IsSectionDefined("PageTitle")) { @await RenderSectionAsync("PageTitle") @@ -111,7 +110,7 @@ { @heading } - +

} diff --git a/TASVideos/Pages/Submissions/View.cshtml b/TASVideos/Pages/Submissions/View.cshtml index 6ba44e675..416bee367 100644 --- a/TASVideos/Pages/Submissions/View.cshtml +++ b/TASVideos/Pages/Submissions/View.cshtml @@ -4,7 +4,7 @@ @{ ViewData.SetTitle($"{Model.Submission.Title} - Submission #{Model.Id}"); ViewData.SetHeading($"Submission {Model.Submission.Title}"); - ViewData.SetNavigation(Model.Id, "/{0}S"); + ViewData.SetNavigation(Model.Id, "S"); bool hasEncode = !string.IsNullOrWhiteSpace(Model.Submission.EncodeEmbedLink); bool canEdit = User.Has(PermissionTo.EditSubmissions) || (Model.CanEdit && User.Has(PermissionTo.SubmitMovies));