diff --git a/DigitalLearningSolutions.Data.Tests/DataServices/CentresDataServiceTests.cs b/DigitalLearningSolutions.Data.Tests/DataServices/CentresDataServiceTests.cs index 30471677d8..deb572fbc9 100644 --- a/DigitalLearningSolutions.Data.Tests/DataServices/CentresDataServiceTests.cs +++ b/DigitalLearningSolutions.Data.Tests/DataServices/CentresDataServiceTests.cs @@ -301,5 +301,24 @@ public void SetCentreAutoRegistered_should_set_AutoRegistered_true() transaction.Dispose(); } } + + [Test] + public void GetAllCentreSummariesForSuperAdmin_returns_active_and_inactive_summary_details_and_reference_data() + { + // When + var summaries = centresDataService.GetAllCentreSummariesForSuperAdmin().ToList(); + + // Then + var activeCentre = summaries.Single(c => c.CentreId == 2); + var inActiveCentre = summaries.Single(c => c.CentreId == 6); + + activeCentre.Active.Should().BeTrue(); + activeCentre.CentreType.Should().Be("NHS Organisation"); + activeCentre.RegionName.Should().Be("North West"); + + inActiveCentre.Active.Should().BeFalse(); + inActiveCentre.CentreType.Should().Be("NHS Organisation"); + inActiveCentre.RegionName.Should().Be("East Of England"); + } } } diff --git a/DigitalLearningSolutions.Data.Tests/Services/CentresServiceTests.cs b/DigitalLearningSolutions.Data.Tests/Services/CentresServiceTests.cs index 42a2cf381e..210fe4b309 100644 --- a/DigitalLearningSolutions.Data.Tests/Services/CentresServiceTests.cs +++ b/DigitalLearningSolutions.Data.Tests/Services/CentresServiceTests.cs @@ -3,17 +3,19 @@ using System; using System.Linq; using DigitalLearningSolutions.Data.DataServices; + using DigitalLearningSolutions.Data.Models.Centres; using DigitalLearningSolutions.Data.Services; using DigitalLearningSolutions.Data.Tests.TestHelpers; using FakeItEasy; + using FizzWare.NBuilder; using FluentAssertions; using NUnit.Framework; public class CentresServiceTests { private ICentresDataService centresDataService = null!; - private IClockService clockService = null!; private ICentresService centresService = null!; + private IClockService clockService = null!; [SetUp] public void Setup() @@ -35,7 +37,7 @@ public void Setup() CentreTestHelper.GetCentreRank(7), CentreTestHelper.GetCentreRank(8), CentreTestHelper.GetCentreRank(9), - CentreTestHelper.GetCentreRank(10) + CentreTestHelper.GetCentreRank(10), } ); } @@ -69,5 +71,21 @@ public void GetCentreRankForCentre_returns_null_with_no_data_for_centre() // Then result.Should().BeNull(); } + + [Test] + public void GetAllCentreSummariesForSuperAdmin_calls_dataService_and_returns_all_summary_details() + { + // Given + var centres = Builder.CreateListOfSize(10).Build(); + A.CallTo(() => centresDataService.GetAllCentreSummariesForSuperAdmin()).Returns(centres); + + // When + var result = centresService.GetAllCentreSummariesForSuperAdmin(); + + // Then + result + .Should() + .HaveCount(10); + } } } diff --git a/DigitalLearningSolutions.Data.Tests/TestHelpers/CentreTestHelper.cs b/DigitalLearningSolutions.Data.Tests/TestHelpers/CentreTestHelper.cs index eba6df05a4..402cb32d70 100644 --- a/DigitalLearningSolutions.Data.Tests/TestHelpers/CentreTestHelper.cs +++ b/DigitalLearningSolutions.Data.Tests/TestHelpers/CentreTestHelper.cs @@ -1,6 +1,6 @@ namespace DigitalLearningSolutions.Data.Tests.TestHelpers { - using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Data.Models.Centres; using DigitalLearningSolutions.Data.Models.DbModels; public static class CentreTestHelper diff --git a/DigitalLearningSolutions.Data/DataServices/CentresDataService.cs b/DigitalLearningSolutions.Data/DataServices/CentresDataService.cs index 98a5faf15f..a22d572832 100644 --- a/DigitalLearningSolutions.Data/DataServices/CentresDataService.cs +++ b/DigitalLearningSolutions.Data/DataServices/CentresDataService.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.Data; using Dapper; - using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Data.Models.Centres; using DigitalLearningSolutions.Data.Models.DbModels; using Microsoft.Extensions.Logging; @@ -14,6 +14,7 @@ public interface ICentresDataService string? GetCentreName(int centreId); IEnumerable<(int, string)> GetCentresForDelegateSelfRegistrationAlphabetical(); Centre? GetCentreDetailsById(int centreId); + IEnumerable GetAllCentreSummariesForSuperAdmin(); void UpdateCentreManagerDetails( int centreId, @@ -161,6 +162,26 @@ FROM Centres AS c return centre; } + public IEnumerable GetAllCentreSummariesForSuperAdmin() + { + return connection.Query( + @"SELECT c.CentreID, + c.CentreName, + c.RegionID, + r.RegionName, + c.ContactForename, + c.ContactSurname, + c.ContactEmail, + c.ContactTelephone, + c.CentreTypeId, + ct.CentreType, + c.Active + FROM Centres AS c + INNER JOIN Regions AS r ON r.RegionID = c.RegionID + INNER JOIN CentreTypes AS ct ON ct.CentreTypeId = c.CentreTypeId" + ); + } + public void UpdateCentreManagerDetails( int centreId, string firstName, diff --git a/DigitalLearningSolutions.Data/Models/CentreContractAdminUsage.cs b/DigitalLearningSolutions.Data/Models/CentreContractAdminUsage.cs index 334185d44c..d2d9d11f46 100644 --- a/DigitalLearningSolutions.Data/Models/CentreContractAdminUsage.cs +++ b/DigitalLearningSolutions.Data/Models/CentreContractAdminUsage.cs @@ -2,6 +2,7 @@ { using System.Collections.Generic; using System.Linq; + using DigitalLearningSolutions.Data.Models.Centres; using DigitalLearningSolutions.Data.Models.User; public class CentreContractAdminUsage diff --git a/DigitalLearningSolutions.Data/Models/Centre.cs b/DigitalLearningSolutions.Data/Models/Centres/Centre.cs similarity index 94% rename from DigitalLearningSolutions.Data/Models/Centre.cs rename to DigitalLearningSolutions.Data/Models/Centres/Centre.cs index f0d7a7fcea..8035cc6c56 100644 --- a/DigitalLearningSolutions.Data/Models/Centre.cs +++ b/DigitalLearningSolutions.Data/Models/Centres/Centre.cs @@ -1,4 +1,4 @@ -namespace DigitalLearningSolutions.Data.Models +namespace DigitalLearningSolutions.Data.Models.Centres { public class Centre { diff --git a/DigitalLearningSolutions.Data/Models/Centres/CentreSummaryForSuperAdmin.cs b/DigitalLearningSolutions.Data/Models/Centres/CentreSummaryForSuperAdmin.cs new file mode 100644 index 0000000000..73d2794a93 --- /dev/null +++ b/DigitalLearningSolutions.Data/Models/Centres/CentreSummaryForSuperAdmin.cs @@ -0,0 +1,17 @@ +namespace DigitalLearningSolutions.Data.Models.Centres +{ + public class CentreSummaryForSuperAdmin + { + public int CentreId { get; set; } + public string CentreName { get; set; } + public int RegionId { get; set; } + public string RegionName { get; set; } + public string? ContactForename { get; set; } + public string? ContactSurname { get; set; } + public string? ContactEmail { get; set; } + public string? ContactTelephone { get; set; } + public int CentreTypeId { get; set; } + public string CentreType { get; set; } + public bool Active { get; set; } + } +} diff --git a/DigitalLearningSolutions.Data/Services/CentresService.cs b/DigitalLearningSolutions.Data/Services/CentresService.cs index b6ec4d4560..c966d60279 100644 --- a/DigitalLearningSolutions.Data/Services/CentresService.cs +++ b/DigitalLearningSolutions.Data/Services/CentresService.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using DigitalLearningSolutions.Data.DataServices; + using DigitalLearningSolutions.Data.Models.Centres; using DigitalLearningSolutions.Data.Models.DbModels; public interface ICentresService @@ -10,6 +11,8 @@ public interface ICentresService IEnumerable GetCentresForCentreRankingPage(int centreId, int numberOfDays, int? regionId); int? GetCentreRankForCentre(int centreId); + + IEnumerable GetAllCentreSummariesForSuperAdmin(); } public class CentresService : ICentresService @@ -39,5 +42,10 @@ public IEnumerable GetCentresForCentreRankingPage(int centreId, i var centreRanking = centreRankings.SingleOrDefault(cr => cr.CentreId == centreId); return centreRanking?.Ranking; } + + public IEnumerable GetAllCentreSummariesForSuperAdmin() + { + return centresDataService.GetAllCentreSummariesForSuperAdmin(); + } } } diff --git a/DigitalLearningSolutions.Web.AutomatedUiTests/AccessibilityTests/BasicAuthenticatedAccessibilityTests.cs b/DigitalLearningSolutions.Web.AutomatedUiTests/AccessibilityTests/BasicAuthenticatedAccessibilityTests.cs index 6fa2a0d244..6b75daf8c5 100644 --- a/DigitalLearningSolutions.Web.AutomatedUiTests/AccessibilityTests/BasicAuthenticatedAccessibilityTests.cs +++ b/DigitalLearningSolutions.Web.AutomatedUiTests/AccessibilityTests/BasicAuthenticatedAccessibilityTests.cs @@ -93,6 +93,7 @@ public BasicAuthenticatedAccessibilityTests(AuthenticatedAccessibilityTestsFixtu [InlineData("/NotificationPreferences/Edit/DelegateUser", "Update notification preferences")] [InlineData("/ChangePassword", "Change password")] [InlineData("/TrackingSystem/Support", "Support")] + [InlineData("/SuperAdmin/Centres", "Centres")] [InlineData("/TrackingSystem/Resources", "Resources")] public void Authenticated_page_has_no_accessibility_errors(string url, string pageTitle) { diff --git a/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentreSummaryViewModelTests.cs b/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentreSummaryViewModelTests.cs new file mode 100644 index 0000000000..aaf5c4f2c7 --- /dev/null +++ b/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentreSummaryViewModelTests.cs @@ -0,0 +1,48 @@ +namespace DigitalLearningSolutions.Web.Tests.ViewModels.SuperAdmin.Centres +{ + using DigitalLearningSolutions.Data.Models.Centres; + using DigitalLearningSolutions.Web.ViewModels.SuperAdmin.Centres; + using FluentAssertions; + using FluentAssertions.Execution; + using NUnit.Framework; + + public class CentreSummaryViewModelTests + { + [Test] + public void CentreSummaryViewModel_constructor_should_populate_expected_properties() + { + // Given + var centre = new CentreSummaryForSuperAdmin() + { + CentreId = 2, + CentreName = "North West Boroughs Healthcare NHS Foundation Trust", + RegionId = 5, + RegionName = "North West", + ContactForename = "TestForename", + ContactSurname = "TestSurname", + ContactEmail = "email@nhs.net", + ContactTelephone = "0123654789", + CentreTypeId = 4, + CentreType = "Social Care", + Active = true, + }; + + // When + var model = new CentreSummaryViewModel(centre); + + // Then + using (new AssertionScope()) + { + model.CentreId.Should().Be(2); + model.CentreName.Should().Be("North West Boroughs Healthcare NHS Foundation Trust"); + model.RegionName.Should().Be("North West"); + model.ContactForename.Should().Be("TestForename"); + model.ContactSurname.Should().Be("TestSurname"); + model.ContactEmail.Should().Be("email@nhs.net"); + model.ContactTelephone.Should().Be("0123654789"); + model.CentreType.Should().Be("Social Care"); + model.Active.Should().BeTrue(); + } + } + } +} diff --git a/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentresViewModelTests.cs b/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentresViewModelTests.cs new file mode 100644 index 0000000000..69d29e1cee --- /dev/null +++ b/DigitalLearningSolutions.Web.Tests/ViewModels/SuperAdmin/Centres/CentresViewModelTests.cs @@ -0,0 +1,43 @@ +namespace DigitalLearningSolutions.Web.Tests.ViewModels.SuperAdmin.Centres +{ + using System.Collections.Generic; + using DigitalLearningSolutions.Data.Models.Centres; + using DigitalLearningSolutions.Web.ViewModels.SuperAdmin.Centres; + using FluentAssertions; + using FluentAssertions.Execution; + using NUnit.Framework; + + public class CentresViewModelTests + { + [Test] + public void CentresViewModel_default_should_return_first_page_of_centres_in_ascending_order() + { + // Given + var centres = new List + { + new CentreSummaryForSuperAdmin { CentreName = "A" }, + new CentreSummaryForSuperAdmin { CentreName = "b" }, + new CentreSummaryForSuperAdmin { CentreName = "C" }, + new CentreSummaryForSuperAdmin { CentreName = "F" }, + new CentreSummaryForSuperAdmin { CentreName = "J" }, + new CentreSummaryForSuperAdmin { CentreName = "e" }, + new CentreSummaryForSuperAdmin { CentreName = "w" }, + new CentreSummaryForSuperAdmin { CentreName = "S" }, + new CentreSummaryForSuperAdmin { CentreName = "r" }, + new CentreSummaryForSuperAdmin { CentreName = "H" }, + new CentreSummaryForSuperAdmin { CentreName = "m" }, + }; + + // When + var model = new CentresViewModel(centres); + + // Then + using (new AssertionScope()) + { + model.Centres + .Should().HaveCount(10) + .And.BeInAscendingOrder(o => o.CentreName); + } + } + } +} diff --git a/DigitalLearningSolutions.Web/Controllers/SuperAdmin/Centres/CentresController.cs b/DigitalLearningSolutions.Web/Controllers/SuperAdmin/Centres/CentresController.cs new file mode 100644 index 0000000000..20ce0caad1 --- /dev/null +++ b/DigitalLearningSolutions.Web/Controllers/SuperAdmin/Centres/CentresController.cs @@ -0,0 +1,35 @@ +namespace DigitalLearningSolutions.Web.Controllers.SuperAdmin.Centres +{ + using DigitalLearningSolutions.Data.Enums; + using DigitalLearningSolutions.Data.Services; + using DigitalLearningSolutions.Web.Attributes; + using DigitalLearningSolutions.Web.Helpers; + using DigitalLearningSolutions.Web.Models.Enums; + using DigitalLearningSolutions.Web.ViewModels.SuperAdmin.Centres; + using Microsoft.AspNetCore.Authorization; + using Microsoft.AspNetCore.Mvc; + using Microsoft.FeatureManagement.Mvc; + + [FeatureGate(FeatureFlags.RefactoredSuperAdminInterface)] + [Authorize(Policy = CustomPolicies.UserSuperAdmin)] + [Route("SuperAdmin/Centres")] + [SetDlsSubApplication(nameof(DlsSubApplication.SuperAdmin))] + [SetSelectedTab(nameof(NavMenuTab.Centres))] + public class CentresController : Controller + { + private readonly ICentresService centresService; + + public CentresController(ICentresService centresService) + { + this.centresService = centresService; + } + + public IActionResult Index() + { + var centres = centresService.GetAllCentreSummariesForSuperAdmin(); + var viewModel = new CentresViewModel(centres); + + return View(viewModel); + } + } +} diff --git a/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentreSummaryViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentreSummaryViewModel.cs new file mode 100644 index 0000000000..fe1b9a6a6f --- /dev/null +++ b/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentreSummaryViewModel.cs @@ -0,0 +1,30 @@ +namespace DigitalLearningSolutions.Web.ViewModels.SuperAdmin.Centres +{ + using DigitalLearningSolutions.Data.Models.Centres; + + public class CentreSummaryViewModel + { + public CentreSummaryViewModel(CentreSummaryForSuperAdmin model) + { + CentreId = model.CentreId; + CentreName = model.CentreName; + RegionName = model.RegionName; + ContactForename = model.ContactForename; + ContactSurname = model.ContactSurname; + ContactEmail = model.ContactEmail; + ContactTelephone = model.ContactTelephone; + CentreType = model.CentreType; + Active = model.Active; + } + + public int CentreId { get; set; } + public string CentreName { get; set; } + public string RegionName { get; set; } + public string? ContactForename { get; set; } + public string? ContactSurname { get; set; } + public string? ContactEmail { get; set; } + public string? ContactTelephone { get; set; } + public string CentreType { get; set; } + public bool Active { get; set; } + } +} diff --git a/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentresViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentresViewModel.cs new file mode 100644 index 0000000000..aaf275c6c8 --- /dev/null +++ b/DigitalLearningSolutions.Web/ViewModels/SuperAdmin/Centres/CentresViewModel.cs @@ -0,0 +1,18 @@ +namespace DigitalLearningSolutions.Web.ViewModels.SuperAdmin.Centres +{ + using System.Collections.Generic; + using System.Linq; + using DigitalLearningSolutions.Data.Models.Centres; + + public class CentresViewModel + { + public CentresViewModel(IEnumerable centreSummaries) + { + // TODO: HEEDLS-641: add filters/sort/pagination + // .Take(10) should be removed in HEEDLS-641 in favour of the standard pagination functionality. + Centres = centreSummaries.OrderBy(c => c.CentreName).Take(10).Select(c => new CentreSummaryViewModel(c)); + } + + public IEnumerable Centres { get; set; } + } +} diff --git a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/CentreConfigurationViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/CentreConfigurationViewModel.cs index 6992833720..c72266e12d 100644 --- a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/CentreConfigurationViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/CentreConfigurationViewModel.cs @@ -1,6 +1,6 @@ namespace DigitalLearningSolutions.Web.ViewModels.TrackingSystem.Centre.Configuration { - using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Data.Models.Centres; public class CentreConfigurationViewModel { diff --git a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreDetailsViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreDetailsViewModel.cs index 90824ac7cc..6cff263373 100644 --- a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreDetailsViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreDetailsViewModel.cs @@ -1,7 +1,7 @@ namespace DigitalLearningSolutions.Web.ViewModels.TrackingSystem.Centre.Configuration { using System.ComponentModel.DataAnnotations; - using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Data.Models.Centres; using DigitalLearningSolutions.Web.Attributes; using Microsoft.AspNetCore.Http; diff --git a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreManagerDetailsViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreManagerDetailsViewModel.cs index 29c457bf0c..3ec963e199 100644 --- a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreManagerDetailsViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreManagerDetailsViewModel.cs @@ -1,7 +1,7 @@ namespace DigitalLearningSolutions.Web.ViewModels.TrackingSystem.Centre.Configuration { using System.ComponentModel.DataAnnotations; - using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Data.Models.Centres; using DigitalLearningSolutions.Web.Attributes; public class EditCentreManagerDetailsViewModel diff --git a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreWebsiteDetailsViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreWebsiteDetailsViewModel.cs index f992fcf2b7..15a663d602 100644 --- a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreWebsiteDetailsViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Configuration/EditCentreWebsiteDetailsViewModel.cs @@ -1,7 +1,7 @@ namespace DigitalLearningSolutions.Web.ViewModels.TrackingSystem.Centre.Configuration { using System.ComponentModel.DataAnnotations; - using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Data.Models.Centres; using DigitalLearningSolutions.Web.Attributes; public class EditCentreWebsiteDetailsViewModel diff --git a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/ContractDetails/ContractDetailsViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/ContractDetails/ContractDetailsViewModel.cs index f7272294e2..8f8e625744 100644 --- a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/ContractDetails/ContractDetailsViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/ContractDetails/ContractDetailsViewModel.cs @@ -2,7 +2,7 @@ { using System.Collections.Generic; using System.Linq; - using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Data.Models.Centres; using DigitalLearningSolutions.Data.Models.User; using DigitalLearningSolutions.Web.Helpers; diff --git a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Dashboard/CentreDashboardViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Dashboard/CentreDashboardViewModel.cs index 9a018f60f4..4de1d0e39b 100644 --- a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Dashboard/CentreDashboardViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Dashboard/CentreDashboardViewModel.cs @@ -1,6 +1,6 @@ namespace DigitalLearningSolutions.Web.ViewModels.TrackingSystem.Centre.Dashboard { - using DigitalLearningSolutions.Data.Models; + using DigitalLearningSolutions.Data.Models.Centres; using DigitalLearningSolutions.Web.Helpers; public class CentreDashboardViewModel diff --git a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Dashboard/DashboardCentreDetailsViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Dashboard/DashboardCentreDetailsViewModel.cs index 8962d8e055..234a1f9c5e 100644 --- a/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Dashboard/DashboardCentreDetailsViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Centre/Dashboard/DashboardCentreDetailsViewModel.cs @@ -1,7 +1,6 @@ namespace DigitalLearningSolutions.Web.ViewModels.TrackingSystem.Centre.Dashboard { - using DigitalLearningSolutions.Data.Models; - + using DigitalLearningSolutions.Data.Models.Centres; public class DashboardCentreDetailsViewModel { public DashboardCentreDetailsViewModel(Centre centre, string userIpAddress, int? centreRank) diff --git a/DigitalLearningSolutions.Web/Views/SuperAdmin/Centres/Index.cshtml b/DigitalLearningSolutions.Web/Views/SuperAdmin/Centres/Index.cshtml new file mode 100644 index 0000000000..eafe0e366d --- /dev/null +++ b/DigitalLearningSolutions.Web/Views/SuperAdmin/Centres/Index.cshtml @@ -0,0 +1,19 @@ +@using DigitalLearningSolutions.Web.ViewModels.SuperAdmin.Centres +@model CentresViewModel + +@* TODO: HEEDLS-641: add search/filter/pagination components *@ +@{ + ViewData["Title"] = "Centres"; +} + +
+
+

Centres

+
+ @foreach (var centre in Model.Centres) + { + + } +
+
+
diff --git a/DigitalLearningSolutions.Web/Views/SuperAdmin/Centres/_CentreCard.cshtml b/DigitalLearningSolutions.Web/Views/SuperAdmin/Centres/_CentreCard.cshtml new file mode 100644 index 0000000000..58fa01d083 --- /dev/null +++ b/DigitalLearningSolutions.Web/Views/SuperAdmin/Centres/_CentreCard.cshtml @@ -0,0 +1,91 @@ +@using DigitalLearningSolutions.Web.ViewModels.SuperAdmin.Centres +@model CentreSummaryViewModel + +
+
+ + + @Model.CentreName (@Model.CentreId) + + + +
+
+ +
+
+ Centre ID +
+
+ @Model.CentreId +
+
+ +
+
+ Centre type +
+
+ @Model.CentreType +
+
+ +
+
+ Region +
+
+ @Model.RegionName +
+
+ +
+
+ Contact +
+
+ @Model.ContactForename @Model.ContactSurname +
+
+ +
+
+ Contact email +
+ +
+ +
+
+ Telephone +
+ +
+ +
+ + Manage centre + + + View courses + + @if (Model.Active) { + + Deactivate centre + + } else { + + Reactivate centre + + } +
+
+
diff --git a/DigitalLearningSolutions.Web/Views/SuperAdmin/Shared/_NavMenuItems.cshtml b/DigitalLearningSolutions.Web/Views/SuperAdmin/Shared/_NavMenuItems.cshtml index 9c7b711af7..5752b6d707 100644 --- a/DigitalLearningSolutions.Web/Views/SuperAdmin/Shared/_NavMenuItems.cshtml +++ b/DigitalLearningSolutions.Web/Views/SuperAdmin/Shared/_NavMenuItems.cshtml @@ -9,7 +9,7 @@
  • - + Centres