From 824c070449194e5c8f1ff3345c928aba9545f9a5 Mon Sep 17 00:00:00 2001 From: vas Date: Wed, 22 Apr 2020 14:30:51 +0100 Subject: [PATCH 1/4] CON-1046-Title Page Back Link --- .../Employer.Web/Views/Part1/Title/Title.cshtml | 10 +++++++--- .../Employer.Web/wwwroot/javascripts/application.js | 11 ++++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/Employer/Employer.Web/Views/Part1/Title/Title.cshtml b/src/Employer/Employer.Web/Views/Part1/Title/Title.cshtml index 159cdc3b4e..0b7e3007b7 100644 --- a/src/Employer/Employer.Web/Views/Part1/Title/Title.cshtml +++ b/src/Employer/Employer.Web/Views/Part1/Title/Title.cshtml @@ -1,7 +1,7 @@ @using Esfa.Recruit.Shared.Web.Mappers @model Esfa.Recruit.Employer.Web.ViewModels.Part1.Title.TitleViewModel @inject ManageApprenticeshipsLinkHelper _externalLinksHelper; -@{ +@{ ViewBag.Vpv = "/recruitment/employer/page-part1-title"; ViewBag.ZenDeskLabel = "recruit-what-do-you-want-to-call-this-vacancy"; } @@ -10,7 +10,7 @@
- @Model.BackLinkText + @Model.BackLinkText

What do you want to call this vacancy?

@@ -46,4 +46,8 @@ - \ No newline at end of file + + + + + diff --git a/src/Employer/Employer.Web/wwwroot/javascripts/application.js b/src/Employer/Employer.Web/wwwroot/javascripts/application.js index 5e7f7f51f0..5dd83f49e3 100644 --- a/src/Employer/Employer.Web/wwwroot/javascripts/application.js +++ b/src/Employer/Employer.Web/wwwroot/javascripts/application.js @@ -232,4 +232,13 @@ $(function () { //handle anchor clicks to account for floating menu handleAnchorClicks(); window.GOVUKFrontend.initAll() -}); \ No newline at end of file +}); + +//back link +function historyBack() { + window.history.back(); +} +var el = document.getElementById('goBack'); +if (el) { + el.addEventListener('click', historyBack, false); +} \ No newline at end of file From b7b996c053d636ff0f606e274938c14674b9e083 Mon Sep 17 00:00:00 2001 From: vas Date: Wed, 22 Apr 2020 14:52:12 +0100 Subject: [PATCH 2/4] CON-1046- Tidy up --- src/Employer/Employer.Web/Views/Part1/Title/Title.cshtml | 5 +---- src/Employer/Employer.Web/wwwroot/javascripts/application.js | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Employer/Employer.Web/Views/Part1/Title/Title.cshtml b/src/Employer/Employer.Web/Views/Part1/Title/Title.cshtml index 0b7e3007b7..87623039ca 100644 --- a/src/Employer/Employer.Web/Views/Part1/Title/Title.cshtml +++ b/src/Employer/Employer.Web/Views/Part1/Title/Title.cshtml @@ -11,6 +11,7 @@ @Model.BackLinkText +

What do you want to call this vacancy?

@@ -47,7 +48,3 @@ - - - - diff --git a/src/Employer/Employer.Web/wwwroot/javascripts/application.js b/src/Employer/Employer.Web/wwwroot/javascripts/application.js index 5dd83f49e3..bcd29f1597 100644 --- a/src/Employer/Employer.Web/wwwroot/javascripts/application.js +++ b/src/Employer/Employer.Web/wwwroot/javascripts/application.js @@ -236,7 +236,7 @@ $(function () { //back link function historyBack() { - window.history.back(); + history.back(); } var el = document.getElementById('goBack'); if (el) { From e16b5943bec03cfe75359de61fffd63a40d68e56 Mon Sep 17 00:00:00 2001 From: vas Date: Thu, 23 Apr 2020 13:01:43 +0100 Subject: [PATCH 3/4] CON-1046- Worked with Darren. --- .../Employer.Web/Views/Part1/Title/Title.cshtml | 15 +++++++-------- .../wwwroot/javascripts/application.js | 16 ++++++++-------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/Employer/Employer.Web/Views/Part1/Title/Title.cshtml b/src/Employer/Employer.Web/Views/Part1/Title/Title.cshtml index 87623039ca..7bd3e2f097 100644 --- a/src/Employer/Employer.Web/Views/Part1/Title/Title.cshtml +++ b/src/Employer/Employer.Web/Views/Part1/Title/Title.cshtml @@ -6,15 +6,14 @@ ViewBag.ZenDeskLabel = "recruit-what-do-you-want-to-call-this-vacancy"; } -
-
- - - @Model.BackLinkText - -

What do you want to call this vacancy?

+
+
+ + +
+

What do you want to call this vacancy?

+
-
diff --git a/src/Employer/Employer.Web/wwwroot/javascripts/application.js b/src/Employer/Employer.Web/wwwroot/javascripts/application.js index bcd29f1597..2412d759cc 100644 --- a/src/Employer/Employer.Web/wwwroot/javascripts/application.js +++ b/src/Employer/Employer.Web/wwwroot/javascripts/application.js @@ -234,11 +234,11 @@ $(function () { window.GOVUKFrontend.initAll() }); -//back link -function historyBack() { - history.back(); -} -var el = document.getElementById('goBack'); -if (el) { - el.addEventListener('click', historyBack, false); -} \ No newline at end of file +jQuery(document).ready(function () { //remove this line and update HTML to das-js-back-link if adding das js lib + var goBack = jQuery('#goBack'); + var backTxt = goBack.data('txt'); + goBack.find('.js-back-link').html('').end().find('.govuk-back-link').text(backTxt).on('click', function (e) { + e.preventDefault(); + window.history.back(); + }); +}); \ No newline at end of file From 5c13e470e6c1cd52ab2250046fa9725584203d91 Mon Sep 17 00:00:00 2001 From: vas Date: Mon, 27 Apr 2020 14:32:07 +0100 Subject: [PATCH 4/4] CON-1046 : Removed Back Link --- .../Controllers/Part1/TitleController.cs | 15 ++++++--------- .../ViewModels/Part1/Title/TitleViewModel.cs | 8 ++------ .../Employer.Web/Views/Part1/Title/Title.cshtml | 7 +++---- .../wwwroot/javascripts/application.js | 9 --------- 4 files changed, 11 insertions(+), 28 deletions(-) diff --git a/src/Employer/Employer.Web/Controllers/Part1/TitleController.cs b/src/Employer/Employer.Web/Controllers/Part1/TitleController.cs index 0111425873..070bddf9ee 100644 --- a/src/Employer/Employer.Web/Controllers/Part1/TitleController.cs +++ b/src/Employer/Employer.Web/Controllers/Part1/TitleController.cs @@ -98,20 +98,17 @@ private async Task UpdateTextAndLinks(TitleViewModel vm) if(!string.IsNullOrWhiteSpace(vm.ReferredProgrammeId)) { var training = await _orchestrator.GetProgramme(vm.ReferredProgrammeId); - vm.TrainingTitle = training.Title + ", Level: " + training.EducationLevelNumber; - vm.BackLinkText = "Back to your saved favourites"; - vm.BackLinkRoute = GenerateEmployerFavouriteUrl(vm); + vm.TrainingTitle = training.Title + ", Level: " + training.EducationLevelNumber; + vm.CancelLinkRoute = GenerateEmployerFavouriteUrl(vm); } else - { - vm.BackLinkText = "Return to home"; - vm.BackLinkRoute = Url.RouteUrl(RouteNames.Dashboard_Account_Home); + { + vm.CancelLinkRoute = Url.RouteUrl(RouteNames.Dashboard_Account_Home); } } else - { - vm.BackLinkText = "Back"; - vm.BackLinkRoute = Url.RouteUrl(vm.BackLink); + { + vm.CancelLinkRoute = Url.RouteUrl(vm.CancelLink); } } diff --git a/src/Employer/Employer.Web/ViewModels/Part1/Title/TitleViewModel.cs b/src/Employer/Employer.Web/ViewModels/Part1/Title/TitleViewModel.cs index dc8b97d973..5413883f6e 100644 --- a/src/Employer/Employer.Web/ViewModels/Part1/Title/TitleViewModel.cs +++ b/src/Employer/Employer.Web/ViewModels/Part1/Title/TitleViewModel.cs @@ -19,18 +19,14 @@ public class TitleViewModel public string FormPostRouteName => VacancyId.HasValue ? RouteNames.Title_Post : RouteNames.CreateVacancy_Post; public PartOnePageInfoViewModel PageInfo { get; set; } public bool HasCloneableVacancies { get; set; } - public string BackLink => - HasCloneableVacancies ? RouteNames.Vacancies_Get : RouteNames.Dashboard_Get; - - public string BackLinkText { get; set; } - public string BackLinkRoute { get; set; } + public string CancelLink => HasCloneableVacancies ? RouteNames.Vacancies_Get : RouteNames.Dashboard_Get; + public string CancelLinkRoute { get; set; } public bool ReferredFromMa { get; set; } public string ReferredUkprn { get; set; } public string ReferredProgrammeId { get; set; } public bool ReferredFromSavedFavourites => ReferredFromMa & (!string.IsNullOrEmpty(ReferredUkprn) || !string.IsNullOrEmpty(ReferredProgrammeId)); - public string TrainingTitle { get; set; } } } diff --git a/src/Employer/Employer.Web/Views/Part1/Title/Title.cshtml b/src/Employer/Employer.Web/Views/Part1/Title/Title.cshtml index 7bd3e2f097..cad45b6f46 100644 --- a/src/Employer/Employer.Web/Views/Part1/Title/Title.cshtml +++ b/src/Employer/Employer.Web/Views/Part1/Title/Title.cshtml @@ -9,8 +9,7 @@
- -
+

What do you want to call this vacancy?

@@ -37,11 +36,11 @@
- Cancel + Cancel Cancel - Cancel + Cancel Cancel diff --git a/src/Employer/Employer.Web/wwwroot/javascripts/application.js b/src/Employer/Employer.Web/wwwroot/javascripts/application.js index 2412d759cc..5e7f7f51f0 100644 --- a/src/Employer/Employer.Web/wwwroot/javascripts/application.js +++ b/src/Employer/Employer.Web/wwwroot/javascripts/application.js @@ -232,13 +232,4 @@ $(function () { //handle anchor clicks to account for floating menu handleAnchorClicks(); window.GOVUKFrontend.initAll() -}); - -jQuery(document).ready(function () { //remove this line and update HTML to das-js-back-link if adding das js lib - var goBack = jQuery('#goBack'); - var backTxt = goBack.data('txt'); - goBack.find('.js-back-link').html('').end().find('.govuk-back-link').text(backTxt).on('click', function (e) { - e.preventDefault(); - window.history.back(); - }); }); \ No newline at end of file