From 248f141c650c084944bc6d6f0dfae1b97b11ff6f Mon Sep 17 00:00:00 2001 From: Molly Phillips Date: Tue, 3 Oct 2023 20:08:23 -0400 Subject: [PATCH] Add links to license and source code in footer (#909) * Display link to source code and license in footer * Remove " (fetch)" suffix in remote URL * Use split instead of replace for getting the clean remote URL * Open license link in new tab as well * LINQ-ify things and handle potential errors * Properly detect remote URL type and parse accordingly Squashed 3 commits: * Properly detect remote URL type and parse accordingly * Actually fix broken source code link...maybe * Attempt to fix broken source code link * Fix a kokoism Perhaps we should actually utilize the firstRemoteUnparsedUrl variable instead of getting the FirstOrDefault remote over and over * Fix missing slash when using an SSH remote * Assign null to parsed URL variable by default Thank you clyde discord * Only perform the null check on the unparsed URL once Thank you again clyde discord * Handle exception when there are no defined remotes * Move remote determination to VersionHelper and format file Squashed 4 commits: * Nitpick variable naming and add XML doc * Use preferred braces style * Return null directly if unparsed URL is null * Move remote determination to VersionHelper and format file * Add param to include HTTPS prefix in DetermineRemoteUrl method * Remove warnings from XML doc Not needed as of c63284cb371024c8e879d4ebdbad64b0659a25df * Properly insert HTTPS prefix into SSH remotes * Fix license layout and improve git remote parsing --------- Co-authored-by: Slendy --- .../Pages/Layouts/BaseLayout.cshtml | 24 ++++++- ProjectLighthouse/Helpers/VersionHelper.cs | 64 ++++++++++++------- 2 files changed, 64 insertions(+), 24 deletions(-) diff --git a/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml b/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml index 89ff3a8bd..4f73184e7 100644 --- a/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml +++ b/ProjectLighthouse.Servers.Website/Pages/Layouts/BaseLayout.cshtml @@ -191,8 +191,28 @@