diff --git a/LearningHub.Nhs.WebUI/Views/Bookmark/Rename.cshtml b/LearningHub.Nhs.WebUI/Views/Bookmark/Rename.cshtml index 182a537ca..2ab7ed9dc 100644 --- a/LearningHub.Nhs.WebUI/Views/Bookmark/Rename.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Bookmark/Rename.cshtml @@ -30,7 +30,7 @@ autocomplete="off" css-class="" required="true" - required-client-side-error-message="You must enter a bookmark name" /> + required-client-side-error-message="You must enter a bookmark name" /> diff --git a/LearningHub.Nhs.WebUI/Views/Bookmark/Toggle.cshtml b/LearningHub.Nhs.WebUI/Views/Bookmark/Toggle.cshtml index d06b16fdd..8f77215ae 100644 --- a/LearningHub.Nhs.WebUI/Views/Bookmark/Toggle.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Bookmark/Toggle.cshtml @@ -1,136 +1,142 @@ @using System.Text.RegularExpressions @model LearningHub.Nhs.WebUI.Models.Bookmark.EditBookmarkViewModel @{ - var bookmarkType = (Model.BookmarkTypeId == 1) ? "Folder" : "Bookmark"; - var titleAction = Model.Bookmarked ? "Delete" : "Add"; - var buttonAction = Model.Bookmarked ? "Delete" : "Continue"; + var bookmarkType = (Model.BookmarkTypeId == 1) ? "Folder" : "Bookmark"; + var titleAction = Model.Bookmarked ? "Delete" : "Add"; + var buttonAction = Model.Bookmarked ? "Delete" : "Continue"; - ViewData["Title"] = $"{titleAction} {bookmarkType}"; + ViewData["Title"] = $"{titleAction} {bookmarkType}"; - // Prepare the parameters for the back-link component. - var backToText = "Back to: "; - var returnUrl = ViewBag.ReturnUrl.ToLower(); - var controller = string.Empty; - var action = string.Empty; - var routeParams = new Dictionary(); + // Prepare the parameters for the back-link component. + var backToText = "Back to: "; + var returnUrl = ViewBag.ReturnUrl.ToLower(); + var controller = string.Empty; + var action = string.Empty; + var routeParams = new Dictionary(); - if (returnUrl == "/") + if (returnUrl == "/") + { + backToText += "Learning Hub"; + controller = "home"; + action = "index"; + } + else if (returnUrl.Contains("/bookmark")) + { + backToText += "My bookmarks"; + controller = "bookmark"; + action = "index"; + } + else + { + var resourceMatches = Regex.Matches(returnUrl, @"^/resource/([0-9]+)(/item)?$"); + var catalogueMatches = Regex.Matches(returnUrl, @"^/catalogue/(\w+)$"); + + if (resourceMatches.Count > 0) { - backToText += "Learning Hub"; - controller = "home"; - action = "index"; + backToText += "Learning Resource"; + controller = "resource"; + action = "Index"; + routeParams = new Dictionary { { "resourceReferenceId", resourceMatches[0].Groups[1].Value } }; } - else if (returnUrl == "/bookmark") + else if (catalogueMatches.Count > 0) { - backToText += "My bookmarks"; - controller = "bookmark"; - action = "index"; + backToText += "Catalogue"; + controller = "catalogue"; + action = "Index"; + routeParams = new Dictionary { { "reference", catalogueMatches[0].Groups[1].Value } }; } else { - var resourceMatches = Regex.Matches(returnUrl, @"^/resource/([0-9]+)(/item)?$"); - var catalogueMatches = Regex.Matches(returnUrl, @"^/catalogue/(\w+)$"); - - if (resourceMatches.Count > 0) - { - backToText += "Learning Resource"; - controller = "resource"; - action = "Index"; - routeParams = new Dictionary { { "resourceReferenceId", resourceMatches[0].Groups[1].Value } }; - } - else if (catalogueMatches.Count > 0) - { - backToText += "Catalogue"; - controller = "catalogue"; - action = "Index"; - routeParams = new Dictionary { { "reference", catalogueMatches[0].Groups[1].Value } }; - } + backToText += "Learning Hub"; + controller = "home"; + action = "index"; } + } } @section styles{ - + } - - + + - + - + - @if (Model.Bookmarked) - { - @if (Model.BookmarkTypeId == 1) - { - Are you sure you want to delete this folder? - - All bookmarks contained within the folder will also be deleted. To save any bookmarks move them out of the folder. - - - - - - Folder - - @Model.Title - - - - - } - else - { - Are you sure you want to remove this bookmark? - - - - Bookmark - - @Model.Title - - - - - } - } - else - { - Add @(Model.BookmarkTypeId == 1 ? "a folder" : "bookmark") + @if (Model.Bookmarked) + { + @if (Model.BookmarkTypeId == 1) + { + Are you sure you want to delete this folder? + + All bookmarks contained within the folder will also be deleted. To save any bookmarks move them out of the folder. + - - - - You must enter a folder name" : "You must enter a bookmark name")" /> - - + + + + Folder + + @Model.Title - } - - - @buttonAction - - Cancel + + + + } + else + { + Are you sure you want to remove this bookmark? + + + + Bookmark + + @Model.Title + + + } + } + else + { + Add @(Model.BookmarkTypeId == 1 ? "a folder" : "bookmark") + + + + + + + + + } + + + @buttonAction + + Cancel + + - - - - - - - - - + + + + + + + + + \ No newline at end of file
All bookmarks contained within the folder will also be deleted. To save any bookmarks move them out of the folder.
@Model.Title