diff --git a/DigitalLearningSolutions.Web/Controllers/FrameworksController/Signposting.cs b/DigitalLearningSolutions.Web/Controllers/FrameworksController/Signposting.cs index fdefceac2a..b829976878 100644 --- a/DigitalLearningSolutions.Web/Controllers/FrameworksController/Signposting.cs +++ b/DigitalLearningSolutions.Web/Controllers/FrameworksController/Signposting.cs @@ -32,7 +32,7 @@ public IActionResult EditCompetencyLearningResources(int frameworkId, int framew [Route("/Frameworks/{frameworkId}/Competency/{frameworkCompetencyId}/CompetencyGroup/{frameworkCompetencyGroupId}/Signposting/AddResource/{page=1:int}")] public async Task SearchLearningResourcesAsync(int frameworkId, int frameworkCompetencyId, int? frameworkCompetencyGroupId, int? catalogueId, string searchText, int page) - { + { var model = new CompetencyResourceSignpostingViewModel(frameworkId, frameworkCompetencyId, frameworkCompetencyGroupId); Catalogues = Catalogues ?? (await this.learningHubApiClient.GetCatalogues())?.Catalogues?.OrderBy(c => c.Name).ToList(); @@ -103,7 +103,7 @@ public IActionResult AddCompetencyLearningResourceSummary(CompetencyResourceSumm public IActionResult ConfirmAddCompetencyLearningResourceSummary(CompetencyResourceSummaryViewModel model) { var frameworkCompetency = frameworkService.GetFrameworkCompetencyById(model.FrameworkCompetencyId.Value); - string plainTextDescription = SignpostingHelper.DisplayText(model.Description); + string plainTextDescription = DisplayStringHelper.RemoveMarkup(model.Description); int competencyLearningResourceId = competencyLearningResourcesDataService.AddCompetencyLearningResource(model.ReferenceId, model.ResourceName, plainTextDescription, model.ResourceType, model.Link, model.SelectedCatalogue, model.Rating.Value, frameworkCompetency.CompetencyID, GetAdminId()); return RedirectToAction("StartSignpostingParametersSession", "Frameworks", new { model.FrameworkId, model.FrameworkCompetencyId, model.FrameworkCompetencyGroupId, competencyLearningResourceId }); } diff --git a/DigitalLearningSolutions.Web/Helpers/SignpostingHelper.cs b/DigitalLearningSolutions.Web/Helpers/SignpostingHelper.cs index bc63b3372a..81329e4d2f 100644 --- a/DigitalLearningSolutions.Web/Helpers/SignpostingHelper.cs +++ b/DigitalLearningSolutions.Web/Helpers/SignpostingHelper.cs @@ -7,12 +7,6 @@ namespace DigitalLearningSolutions.Web.Helpers { public class SignpostingHelper { - public static string DisplayText(string input) - { - const string space = " "; - return System.Text.RegularExpressions.Regex.Replace(input ?? String.Empty, $"<.*?>|{space}", String.Empty); - } - public static string DisplayTagColour(string resourceType) { var colours = new string[] { "white", "grey", "green", "aqua-green", "blue", "purple", "red", "orange", "yellow" }; diff --git a/DigitalLearningSolutions.Web/Views/Frameworks/Developer/AddCompetencyLearningResourceSummary.cshtml b/DigitalLearningSolutions.Web/Views/Frameworks/Developer/AddCompetencyLearningResourceSummary.cshtml index dd43bfa8e6..c1b98b6169 100644 --- a/DigitalLearningSolutions.Web/Views/Frameworks/Developer/AddCompetencyLearningResourceSummary.cshtml +++ b/DigitalLearningSolutions.Web/Views/Frameworks/Developer/AddCompetencyLearningResourceSummary.cshtml @@ -1,96 +1,94 @@ -@using DigitalLearningSolutions.Web.ViewModels.Frameworks; -@using DigitalLearningSolutions.Web.Helpers; -@model CompetencyResourceSummaryViewModel -@{ - ViewData["Title"] = "Add Competency Learning Resource Summary"; - ViewData["Application"] = "Framework Service"; -} - - -@section NavMenuItems { - -} -@section NavBreadcrumbs { - -} -

Add Competency Learning Resource Summary

-
-
-
-
Competency
-
@Model.NameOfCompetency
-
-
-
Resource name
-
@Model.ResourceName
-
-
-
Resource type
-
@Model.ResourceType
-
-
-
Catalogue
-
@Model.SelectedCatalogue
-
-
-
Description
-
@SignpostingHelper.DisplayText(Model.Description)
-
-
-
-
- - + -
-
-
-
-
- @Html.HiddenFor(m => m.FrameworkId) - @Html.HiddenFor(m => m.FrameworkCompetencyGroupId) - @Html.HiddenFor(m => m.FrameworkCompetencyId) - @Html.HiddenFor(m => m.ReferenceId) - @Html.HiddenFor(m => m.Resource.Title) - @Html.HiddenFor(m => m.Resource.ResourceType) - @Html.HiddenFor(m => m.Resource.Description) - @Html.HiddenFor(m => m.Link) - @Html.HiddenFor(m => m.SelectedCatalogue) - @Html.HiddenFor(m => m.Rating) -
- + +
+ + + @Html.HiddenFor(m => m.FrameworkId) + @Html.HiddenFor(m => m.FrameworkCompetencyGroupId) + @Html.HiddenFor(m => m.FrameworkCompetencyId) + @Html.HiddenFor(m => m.ReferenceId) + @Html.HiddenFor(m => m.Resource.Title) + @Html.HiddenFor(m => m.Resource.ResourceType) + @Html.HiddenFor(m => m.Resource.Description) + @Html.HiddenFor(m => m.Link) + @Html.HiddenFor(m => m.SelectedCatalogue) + @Html.HiddenFor(m => m.Rating) + + + asp-route-catalogueId="@Model.CatalogueId" + asp-route-page="@Model.Page"> + + Cancel + + diff --git a/DigitalLearningSolutions.Web/Views/Frameworks/Developer/_SignpostingCard.cshtml b/DigitalLearningSolutions.Web/Views/Frameworks/Developer/_SignpostingCard.cshtml index 365dad4fff..8a4577e3e8 100644 --- a/DigitalLearningSolutions.Web/Views/Frameworks/Developer/_SignpostingCard.cshtml +++ b/DigitalLearningSolutions.Web/Views/Frameworks/Developer/_SignpostingCard.cshtml @@ -2,8 +2,8 @@ @using DigitalLearningSolutions.Web.Helpers; @model SignpostingCardViewModel @{ - var parent = (CompetencyResourceSignpostingViewModel)ViewData["parent"]; - bool displayLevelLabels = Model.AssessmentQuestionInputTypeId != 2; + var parent = (CompetencyResourceSignpostingViewModel)ViewData["parent"]; + bool displayLevelLabels = Model.AssessmentQuestionInputTypeId != 2; }
@@ -34,14 +34,11 @@ } @if (!String.IsNullOrEmpty(Model.ResourceType)) { - @Model.ResourceType + @Model.ResourceType } @*
Digital Learn
*@ - @if (!String.IsNullOrEmpty(Model.Description)) - { -

@SignpostingHelper.DisplayText(Model.Description)

- } +

@DisplayStringHelper.RemoveMarkup(Model.Description)

Rated @Model.Rating/5
@if (Model.ParameterHasNotBeenSet) { @@ -58,39 +55,39 @@
@Model.AssessmentQuestion
- + +
+
+ Trigger @(displayLevelLabels ? "responses" : "range") +
+
+ @if (displayLevelLabels) + { + + @if (Model.MinimumResultMatch != Model.MaximumResultMatch) + { + + } + } + else + { + + } +
+
+ @if (!String.IsNullOrEmpty(Model.CompareResultTo)) + {
- Trigger @(displayLevelLabels ? "responses" : "range") + Compare result to
- @if (displayLevelLabels) - { - - @if (Model.MinimumResultMatch != Model.MaximumResultMatch) - { - - } - } - else - { - - } + @Model.CompareResultTo
- @if (!String.IsNullOrEmpty(Model.CompareResultTo)) - { -
-
- Compare result to -
-
- @Model.CompareResultTo -
-
- } - } + + } +
diff --git a/DigitalLearningSolutions.Web/Views/Frameworks/Developer/_SignpostingResourceCard.cshtml b/DigitalLearningSolutions.Web/Views/Frameworks/Developer/_SignpostingResourceCard.cshtml index 87c6ef4f4b..8eb8d7b8e6 100644 --- a/DigitalLearningSolutions.Web/Views/Frameworks/Developer/_SignpostingResourceCard.cshtml +++ b/DigitalLearningSolutions.Web/Views/Frameworks/Developer/_SignpostingResourceCard.cshtml @@ -8,7 +8,7 @@
- @SignpostingHelper.DisplayText(Model.Resource.Title) + @DisplayStringHelper.RemoveMarkup(Model.Resource.Title)
@@ -19,7 +19,7 @@
}
- @Html.Raw(SignpostingHelper.DisplayText(Model.Description)) + @Html.Raw(DisplayStringHelper.RemoveMarkup(Model.Description))
@if (Model.Catalogues.Count() > 0) {