diff --git a/Stoolball.UnitTests/Statistics/StatisticsBreadcrumbBuilderTests.cs b/Stoolball.Web.UnitTests/Navigation/StatisticsBreadcrumbBuilderTests.cs similarity index 98% rename from Stoolball.UnitTests/Statistics/StatisticsBreadcrumbBuilderTests.cs rename to Stoolball.Web.UnitTests/Navigation/StatisticsBreadcrumbBuilderTests.cs index 56894b8d3..b6b10e533 100644 --- a/Stoolball.UnitTests/Statistics/StatisticsBreadcrumbBuilderTests.cs +++ b/Stoolball.Web.UnitTests/Navigation/StatisticsBreadcrumbBuilderTests.cs @@ -3,12 +3,12 @@ using Stoolball.Clubs; using Stoolball.Competitions; using Stoolball.MatchLocations; -using Stoolball.Navigation; using Stoolball.Statistics; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Xunit; -namespace Stoolball.UnitTests.Statistics +namespace Stoolball.Web.UnitTests.Navigation { public class StatisticsBreadcrumbBuilderTests { diff --git a/Stoolball.Web.UnitTests/Navigation/TeamBreadcrumbBuilderTests.cs b/Stoolball.Web.UnitTests/Navigation/TeamBreadcrumbBuilderTests.cs new file mode 100644 index 000000000..7a3113d00 --- /dev/null +++ b/Stoolball.Web.UnitTests/Navigation/TeamBreadcrumbBuilderTests.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using Stoolball.Clubs; +using Stoolball.Teams; +using Stoolball.Web.Navigation; +using Xunit; + +namespace Stoolball.Web.UnitTests.Navigation +{ + public class TeamBreadcrumbBuilderTests + { +#nullable disable + [Fact] + public void Null_breadcrumbs_throws_ArgumentNullException() + { + var builder = new TeamBreadcrumbBuilder(); + + Assert.Throws(() => builder.BuildBreadcrumbs(null, new Team(), true)); + } + + [Fact] + public void Null_team_throws_ArgumentNullException() + { + var builder = new TeamBreadcrumbBuilder(); + + Assert.Throws(() => builder.BuildBreadcrumbs(new List(), null, true)); + } +#nullable enable + + [Fact] + public void Club_adds_club_breadcrumb() + { + var builder = new TeamBreadcrumbBuilder(); + var breadcrumbs = new List(); + var team = new Team { Club = new Club { ClubName = "Example club", ClubRoute = "/clubs/example-club" } }; + + builder.BuildBreadcrumbs(breadcrumbs, team, false); + + Assert.Equal(2, breadcrumbs.Count); + Assert.Equal(Constants.Pages.Teams, breadcrumbs[0].Name); + Assert.Equal(Constants.Pages.TeamsUrl, breadcrumbs[0].Url?.ToString()); + Assert.Equal(team.Club.ClubName, breadcrumbs[1].Name); + Assert.Equal(team.Club.ClubRoute, breadcrumbs[1].Url?.ToString()); + } + + [Fact] + public void IncludeTeam_adds_team_breadcrumb() + { + var builder = new TeamBreadcrumbBuilder(); + var breadcrumbs = new List(); + var team = new Team { TeamName = "Example team", TeamRoute = "/teams/example-team" }; + + builder.BuildBreadcrumbs(breadcrumbs, team, true); + + Assert.Equal(2, breadcrumbs.Count); + Assert.Equal(Constants.Pages.Teams, breadcrumbs[0].Name); + Assert.Equal(Constants.Pages.TeamsUrl, breadcrumbs[0].Url?.ToString()); + Assert.Equal(team.TeamName, breadcrumbs[1].Name); + Assert.Equal(team.TeamRoute, breadcrumbs[1].Url?.ToString()); + } + } +} diff --git a/Stoolball.Web.UnitTests/Statistics/BaseStatisticsTableControllerTests.cs b/Stoolball.Web.UnitTests/Statistics/BaseStatisticsTableControllerTests.cs index 5dfe04389..03a241e96 100644 --- a/Stoolball.Web.UnitTests/Statistics/BaseStatisticsTableControllerTests.cs +++ b/Stoolball.Web.UnitTests/Statistics/BaseStatisticsTableControllerTests.cs @@ -10,9 +10,9 @@ using Stoolball.Clubs; using Stoolball.Competitions; using Stoolball.MatchLocations; -using Stoolball.Navigation; using Stoolball.Statistics; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Statistics; using Stoolball.Web.Statistics.Models; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web.UnitTests/Statistics/CatchesControllerTests.cs b/Stoolball.Web.UnitTests/Statistics/CatchesControllerTests.cs index ca47bb0f0..a2f2e9a76 100644 --- a/Stoolball.Web.UnitTests/Statistics/CatchesControllerTests.cs +++ b/Stoolball.Web.UnitTests/Statistics/CatchesControllerTests.cs @@ -7,6 +7,7 @@ using Stoolball.Data.Abstractions; using Stoolball.Matches; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Statistics; using Stoolball.Web.Statistics.Models; using Xunit; diff --git a/Stoolball.Web.UnitTests/Statistics/PlayerSummaryViewModelFactoryTests.cs b/Stoolball.Web.UnitTests/Statistics/PlayerSummaryViewModelFactoryTests.cs index 96f1c6c40..58c51f330 100644 --- a/Stoolball.Web.UnitTests/Statistics/PlayerSummaryViewModelFactoryTests.cs +++ b/Stoolball.Web.UnitTests/Statistics/PlayerSummaryViewModelFactoryTests.cs @@ -3,9 +3,9 @@ using System.Threading.Tasks; using Moq; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Statistics; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Statistics; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Cms.Core.Services; diff --git a/Stoolball.Web.UnitTests/Statistics/RunOutsControllerTests.cs b/Stoolball.Web.UnitTests/Statistics/RunOutsControllerTests.cs index d4e61cf82..56000e6cc 100644 --- a/Stoolball.Web.UnitTests/Statistics/RunOutsControllerTests.cs +++ b/Stoolball.Web.UnitTests/Statistics/RunOutsControllerTests.cs @@ -7,6 +7,7 @@ using Stoolball.Data.Abstractions; using Stoolball.Matches; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Statistics; using Stoolball.Web.Statistics.Models; using Xunit; diff --git a/Stoolball.Web.UnitTests/Teams/DeleteTeamControllerTests.cs b/Stoolball.Web.UnitTests/Teams/DeleteTeamControllerTests.cs index 693f50ed2..4346415f8 100644 --- a/Stoolball.Web.UnitTests/Teams/DeleteTeamControllerTests.cs +++ b/Stoolball.Web.UnitTests/Teams/DeleteTeamControllerTests.cs @@ -1,11 +1,14 @@ using System; +using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using Moq; using Stoolball.Data.Abstractions; using Stoolball.Security; +using Stoolball.Statistics; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Teams; using Stoolball.Web.Teams.Models; using Xunit; @@ -17,6 +20,8 @@ public class DeleteTeamControllerTests : UmbracoBaseTest private readonly Mock _teamDataSource = new(); private readonly Mock _matchListingDataSource = new(); private readonly Mock _playerDataSource = new(); + private readonly Mock> _authorizationPolicy = new(); + private readonly Mock _breadcrumbBuilder = new(); private DeleteTeamController CreateController() { @@ -27,7 +32,8 @@ private DeleteTeamController CreateController() _teamDataSource.Object, _matchListingDataSource.Object, _playerDataSource.Object, - Mock.Of>()) + _authorizationPolicy.Object, + _breadcrumbBuilder.Object) { ControllerContext = ControllerContext }; @@ -49,7 +55,9 @@ public async Task Route_not_matching_team_returns_404() [Fact] public async Task Route_matching_team_returns_DeleteTeamViewModel() { - _teamDataSource.Setup(x => x.ReadTeamByRoute(It.IsAny(), true)).ReturnsAsync(new Team { TeamId = Guid.NewGuid(), TeamRoute = "/teams/example" }); + var team = new Team { TeamId = Guid.NewGuid(), TeamRoute = "/teams/example" }; + _teamDataSource.Setup(x => x.ReadTeamByRoute(It.IsAny(), true)).ReturnsAsync(team); + _playerDataSource.Setup(x => x.ReadPlayerIdentities(It.Is(f => f.TeamIds.Count == 1 && f.TeamIds.Contains(team.TeamId.Value)))).Returns(Task.FromResult(new List())); using (var controller = CreateController()) { diff --git a/Stoolball.Web.UnitTests/Teams/EditPlayersForTeamControllerTests.cs b/Stoolball.Web.UnitTests/Teams/EditPlayersForTeamControllerTests.cs index 498e48a19..54007639a 100644 --- a/Stoolball.Web.UnitTests/Teams/EditPlayersForTeamControllerTests.cs +++ b/Stoolball.Web.UnitTests/Teams/EditPlayersForTeamControllerTests.cs @@ -4,11 +4,11 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using Moq; -using Stoolball.Clubs; using Stoolball.Data.Abstractions; using Stoolball.Security; using Stoolball.Statistics; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Teams; using Stoolball.Web.Teams.Models; using Xunit; @@ -20,6 +20,7 @@ public class EditPlayersForTeamControllerTests : UmbracoBaseTest private readonly Mock _teamDataSource = new(); private readonly Mock _playerDataSource = new(); private readonly Mock> _authorizationPolicy = new(); + private readonly Mock _breadcrumbBuilder = new(); private EditPlayersForTeamController CreateController() { @@ -29,7 +30,8 @@ private EditPlayersForTeamController CreateController() UmbracoContextAccessor.Object, _teamDataSource.Object, _authorizationPolicy.Object, - _playerDataSource.Object) + _playerDataSource.Object, + _breadcrumbBuilder.Object) { ControllerContext = ControllerContext }; @@ -124,22 +126,10 @@ public async Task Route_matching_team_sets_page_title() } } - [Theory] - [InlineData(true)] - [InlineData(false)] - public async Task Route_matching_team_sets_breadcrumbs_including_club(bool hasClub) + [Fact] + public async Task Route_matching_team_sets_breadcrumbs() { var team = CreateTeam(); - - if (hasClub) - { - team.Club = new Club - { - ClubId = Guid.NewGuid(), - ClubName = "Example club", - ClubRoute = "/clubs/example-club" - }; - } SetupMocks(team); using (var controller = CreateController()) @@ -148,8 +138,7 @@ public async Task Route_matching_team_sets_breadcrumbs_including_club(bool hasCl var model = (TeamViewModel)((ViewResult)result).Model; - Assert.Equal(hasClub ? 5 : 4, model.Breadcrumbs.Count); - Assert.Equal(team.TeamName, model.Breadcrumbs[^1].Name); + _breadcrumbBuilder.Verify(x => x.BuildBreadcrumbs(model.Breadcrumbs, model.Team!, true), Times.Once()); } } } diff --git a/Stoolball.Web.UnitTests/Teams/EditTeamControllerTests.cs b/Stoolball.Web.UnitTests/Teams/EditTeamControllerTests.cs index 6c15cbc25..5ddef81b5 100644 --- a/Stoolball.Web.UnitTests/Teams/EditTeamControllerTests.cs +++ b/Stoolball.Web.UnitTests/Teams/EditTeamControllerTests.cs @@ -5,6 +5,7 @@ using Stoolball.Data.Abstractions; using Stoolball.Security; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Teams; using Stoolball.Web.Teams.Models; using Xunit; @@ -14,6 +15,8 @@ namespace Stoolball.Web.UnitTests.Teams public class EditTeamControllerTests : UmbracoBaseTest { private readonly Mock _teamDataSource = new(); + private Mock> _authorizationPolicy = new(); + private readonly Mock _breadcrumbBuilder = new(); private EditTeamController CreateController() { @@ -22,7 +25,8 @@ private EditTeamController CreateController() CompositeViewEngine.Object, UmbracoContextAccessor.Object, _teamDataSource.Object, - Mock.Of>()) + _authorizationPolicy.Object, + _breadcrumbBuilder.Object) { ControllerContext = ControllerContext }; diff --git a/Stoolball.Web.UnitTests/Teams/MatchesForTeamControllerTests.cs b/Stoolball.Web.UnitTests/Teams/MatchesForTeamControllerTests.cs index 40a5a71b6..d2ace4ae8 100644 --- a/Stoolball.Web.UnitTests/Teams/MatchesForTeamControllerTests.cs +++ b/Stoolball.Web.UnitTests/Teams/MatchesForTeamControllerTests.cs @@ -11,6 +11,7 @@ using Stoolball.Security; using Stoolball.Teams; using Stoolball.Web.Matches; +using Stoolball.Web.Navigation; using Stoolball.Web.Teams; using Stoolball.Web.Teams.Models; using Xunit; @@ -23,6 +24,7 @@ public class MatchesForTeamControllerTests : UmbracoBaseTest private readonly Mock _matchListingDataSource = new(); private readonly Mock _createMatchSeasonSelector = new(); private readonly Mock _matchFilterQueryStringParser = new(); + private readonly Mock _breadcrumbBuilder = new(); private MatchesForTeamController CreateController() { @@ -38,7 +40,8 @@ private MatchesForTeamController CreateController() Mock.Of>(), _matchFilterQueryStringParser.Object, Mock.Of(), - Mock.Of()) + Mock.Of(), + _breadcrumbBuilder.Object) { ControllerContext = ControllerContext }; diff --git a/Stoolball.Web.UnitTests/Teams/PlayersForTeamControllerTests.cs b/Stoolball.Web.UnitTests/Teams/PlayersForTeamControllerTests.cs index b2d8e2e61..348f336d2 100644 --- a/Stoolball.Web.UnitTests/Teams/PlayersForTeamControllerTests.cs +++ b/Stoolball.Web.UnitTests/Teams/PlayersForTeamControllerTests.cs @@ -4,11 +4,11 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using Moq; -using Stoolball.Clubs; using Stoolball.Data.Abstractions; using Stoolball.Security; using Stoolball.Statistics; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Teams; using Stoolball.Web.Teams.Models; using Xunit; @@ -20,6 +20,7 @@ public class PlayersForTeamControllerTests : UmbracoBaseTest private readonly Mock _teamDataSource = new(); private readonly Mock _playerDataSource = new(); private readonly Mock> _authorizationPolicy = new(); + private readonly Mock _breadcrumbBuilder = new(); private PlayersForTeamController CreateController() { @@ -29,7 +30,8 @@ private PlayersForTeamController CreateController() UmbracoContextAccessor.Object, _teamDataSource.Object, _authorizationPolicy.Object, - _playerDataSource.Object) + _playerDataSource.Object, + _breadcrumbBuilder.Object) { ControllerContext = ControllerContext }; @@ -115,10 +117,8 @@ public async Task Route_matching_team_sets_page_title_and_description() } } - [Theory] - [InlineData(true)] - [InlineData(false)] - public async Task Route_matching_team_sets_breadcrumbs_including_club(bool hasClub) + [Fact] + public async Task Route_matching_team_sets_breadcrumbs() { var team = new Team { @@ -126,16 +126,6 @@ public async Task Route_matching_team_sets_breadcrumbs_including_club(bool hasCl TeamName = "Example team", TeamRoute = "/teams/example-team" }; - - if (hasClub) - { - team.Club = new Club - { - ClubId = Guid.NewGuid(), - ClubName = "Example club", - ClubRoute = "/clubs/example-club" - }; - } SetupMocks(team); using (var controller = CreateController()) @@ -144,7 +134,7 @@ public async Task Route_matching_team_sets_breadcrumbs_including_club(bool hasCl var model = (TeamViewModel)((ViewResult)result).Model; - Assert.Equal(hasClub ? 4 : 3, model.Breadcrumbs.Count); + _breadcrumbBuilder.Verify(x => x.BuildBreadcrumbs(model.Breadcrumbs, model.Team!, false), Times.Once()); } } } diff --git a/Stoolball.Web.UnitTests/Teams/TeamActionsControllerTests.cs b/Stoolball.Web.UnitTests/Teams/TeamActionsControllerTests.cs index f9f0215be..9ba8c5740 100644 --- a/Stoolball.Web.UnitTests/Teams/TeamActionsControllerTests.cs +++ b/Stoolball.Web.UnitTests/Teams/TeamActionsControllerTests.cs @@ -5,6 +5,7 @@ using Stoolball.Data.Abstractions; using Stoolball.Security; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Teams; using Stoolball.Web.Teams.Models; using Xunit; @@ -14,6 +15,8 @@ namespace Stoolball.Web.UnitTests.Teams public class TeamActionsControllerTests : UmbracoBaseTest { private readonly Mock _teamDataSource = new(); + private readonly Mock> _authorizationPolicy = new(); + private readonly Mock _breadcrumbBuilder = new(); private TeamActionsController CreateController() { @@ -22,7 +25,8 @@ private TeamActionsController CreateController() CompositeViewEngine.Object, UmbracoContextAccessor.Object, _teamDataSource.Object, - Mock.Of>()) + _authorizationPolicy.Object, + _breadcrumbBuilder.Object) { ControllerContext = ControllerContext }; diff --git a/Stoolball.Web.UnitTests/Teams/TeamControllerTests.cs b/Stoolball.Web.UnitTests/Teams/TeamControllerTests.cs index 16794f6ff..a9c9dece8 100644 --- a/Stoolball.Web.UnitTests/Teams/TeamControllerTests.cs +++ b/Stoolball.Web.UnitTests/Teams/TeamControllerTests.cs @@ -6,6 +6,7 @@ using Stoolball.Email; using Stoolball.Security; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Teams; using Stoolball.Web.Teams.Models; using Xunit; @@ -15,6 +16,7 @@ namespace Stoolball.Web.UnitTests.Teams public class TeamControllerTests : UmbracoBaseTest { private readonly Mock _teamDataSource = new(); + private readonly Mock _breadcrumbBuilder = new(); private TeamController CreateController() { @@ -24,7 +26,8 @@ private TeamController CreateController() UmbracoContextAccessor.Object, _teamDataSource.Object, Mock.Of>(), - Mock.Of()) + Mock.Of(), + _breadcrumbBuilder.Object) { ControllerContext = ControllerContext }; diff --git a/Stoolball.Web.UnitTests/Teams/TeamStatisticsControllerTests.cs b/Stoolball.Web.UnitTests/Teams/TeamStatisticsControllerTests.cs index 974eb766f..437633d52 100644 --- a/Stoolball.Web.UnitTests/Teams/TeamStatisticsControllerTests.cs +++ b/Stoolball.Web.UnitTests/Teams/TeamStatisticsControllerTests.cs @@ -8,6 +8,7 @@ using Stoolball.Matches; using Stoolball.Statistics; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Statistics.Models; using Stoolball.Web.Teams; using Xunit; @@ -21,6 +22,8 @@ public class TeamStatisticsControllerTests : UmbracoBaseTest private readonly Mock _inningsStatisticsDataSource = new(); private readonly Mock _statisticsFilterQueryStringParser = new(); private readonly Mock _bestTotalDataSource = new(); + private readonly Mock _statisticsFilterHumanizer = new(); + private readonly Mock _breadcrumbBuilder = new(); private TeamStatisticsController CreateController() { @@ -33,8 +36,8 @@ private TeamStatisticsController CreateController() _inningsStatisticsDataSource.Object, _bestTotalDataSource.Object, _statisticsFilterQueryStringParser.Object, - Mock.Of() - ) + _statisticsFilterHumanizer.Object, + _breadcrumbBuilder.Object) { ControllerContext = ControllerContext }; diff --git a/Stoolball.Web/Account/ApproveMember.cs b/Stoolball.Web/Account/ApproveMember.cs index a3467bf41..7d899d28e 100644 --- a/Stoolball.Web/Account/ApproveMember.cs +++ b/Stoolball.Web/Account/ApproveMember.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using Stoolball.Metadata; -using Stoolball.Navigation; +using Stoolball.Web.Navigation; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Extensions; diff --git a/Stoolball.Web/Account/ConfirmEmailAddress.cs b/Stoolball.Web/Account/ConfirmEmailAddress.cs index 470154c62..8f76cda59 100644 --- a/Stoolball.Web/Account/ConfirmEmailAddress.cs +++ b/Stoolball.Web/Account/ConfirmEmailAddress.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using Stoolball.Metadata; -using Stoolball.Navigation; +using Stoolball.Web.Navigation; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Extensions; diff --git a/Stoolball.Web/Account/CreateMember.cs b/Stoolball.Web/Account/CreateMember.cs index 1a7a7842c..539877700 100644 --- a/Stoolball.Web/Account/CreateMember.cs +++ b/Stoolball.Web/Account/CreateMember.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using Stoolball.Metadata; -using Stoolball.Navigation; +using Stoolball.Web.Navigation; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Extensions; diff --git a/Stoolball.Web/Account/EmailAddress.cs b/Stoolball.Web/Account/EmailAddress.cs index 06f8332c7..1877833bb 100644 --- a/Stoolball.Web/Account/EmailAddress.cs +++ b/Stoolball.Web/Account/EmailAddress.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using Stoolball.Metadata; -using Stoolball.Navigation; using Stoolball.Web.Account; +using Stoolball.Web.Navigation; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Extensions; diff --git a/Stoolball.Web/Account/LoginMember.cs b/Stoolball.Web/Account/LoginMember.cs index e051e93c5..378a2b318 100644 --- a/Stoolball.Web/Account/LoginMember.cs +++ b/Stoolball.Web/Account/LoginMember.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using Stoolball.Metadata; -using Stoolball.Navigation; +using Stoolball.Web.Navigation; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Extensions; diff --git a/Stoolball.Web/Account/LogoutMember.cs b/Stoolball.Web/Account/LogoutMember.cs index 3955bb5fe..a3630287f 100644 --- a/Stoolball.Web/Account/LogoutMember.cs +++ b/Stoolball.Web/Account/LogoutMember.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using Stoolball.Metadata; -using Stoolball.Navigation; +using Stoolball.Web.Navigation; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Extensions; diff --git a/Stoolball.Web/Account/MyAccount.cs b/Stoolball.Web/Account/MyAccount.cs index 49b79822b..afb0936d5 100644 --- a/Stoolball.Web/Account/MyAccount.cs +++ b/Stoolball.Web/Account/MyAccount.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using Stoolball.Metadata; -using Stoolball.Navigation; +using Stoolball.Web.Navigation; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Extensions; diff --git a/Stoolball.Web/Account/PersonalDetails.cs b/Stoolball.Web/Account/PersonalDetails.cs index d4cd0fad1..fccd06fd5 100644 --- a/Stoolball.Web/Account/PersonalDetails.cs +++ b/Stoolball.Web/Account/PersonalDetails.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using Stoolball.Metadata; -using Stoolball.Navigation; +using Stoolball.Web.Navigation; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Extensions; diff --git a/Stoolball.Web/Account/ResetPassword.cs b/Stoolball.Web/Account/ResetPassword.cs index 14af46fd8..b6f367c89 100644 --- a/Stoolball.Web/Account/ResetPassword.cs +++ b/Stoolball.Web/Account/ResetPassword.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using Stoolball.Metadata; -using Stoolball.Navigation; +using Stoolball.Web.Navigation; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Extensions; diff --git a/Stoolball.Web/Clubs/ClubActionsController.cs b/Stoolball.Web/Clubs/ClubActionsController.cs index 82cf6ec32..99553565a 100644 --- a/Stoolball.Web/Clubs/ClubActionsController.cs +++ b/Stoolball.Web/Clubs/ClubActionsController.cs @@ -5,8 +5,8 @@ using Microsoft.Extensions.Logging; using Stoolball.Clubs; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Security; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Clubs/ClubController.cs b/Stoolball.Web/Clubs/ClubController.cs index 40911311a..bf2f4b1ee 100644 --- a/Stoolball.Web/Clubs/ClubController.cs +++ b/Stoolball.Web/Clubs/ClubController.cs @@ -5,8 +5,8 @@ using Microsoft.Extensions.Logging; using Stoolball.Clubs; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Security; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Clubs/ClubStatisticsController.cs b/Stoolball.Web/Clubs/ClubStatisticsController.cs index 14ce6b999..d186e7080 100644 --- a/Stoolball.Web/Clubs/ClubStatisticsController.cs +++ b/Stoolball.Web/Clubs/ClubStatisticsController.cs @@ -6,8 +6,8 @@ using Microsoft.Extensions.Logging; using Stoolball.Clubs; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Stoolball.Web.Statistics.Models; diff --git a/Stoolball.Web/Clubs/CreateClubController.cs b/Stoolball.Web/Clubs/CreateClubController.cs index 510f023cd..973cbbb9d 100644 --- a/Stoolball.Web/Clubs/CreateClubController.cs +++ b/Stoolball.Web/Clubs/CreateClubController.cs @@ -4,8 +4,8 @@ using Microsoft.AspNetCore.Mvc.ViewEngines; using Microsoft.Extensions.Logging; using Stoolball.Clubs; -using Stoolball.Navigation; using Stoolball.Security; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Clubs/CreateClubSurfaceController.cs b/Stoolball.Web/Clubs/CreateClubSurfaceController.cs index 2a7d3cad1..ed971eb34 100644 --- a/Stoolball.Web/Clubs/CreateClubSurfaceController.cs +++ b/Stoolball.Web/Clubs/CreateClubSurfaceController.cs @@ -4,10 +4,10 @@ using Microsoft.AspNetCore.Mvc; using Stoolball.Clubs; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Routing; using Stoolball.Security; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Clubs/DeleteClubController.cs b/Stoolball.Web/Clubs/DeleteClubController.cs index 3d4c25877..106a0fda4 100644 --- a/Stoolball.Web/Clubs/DeleteClubController.cs +++ b/Stoolball.Web/Clubs/DeleteClubController.cs @@ -5,8 +5,8 @@ using Microsoft.Extensions.Logging; using Stoolball.Clubs; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Security; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Clubs/DeleteClubSurfaceController.cs b/Stoolball.Web/Clubs/DeleteClubSurfaceController.cs index e8150a916..16a9c1f69 100644 --- a/Stoolball.Web/Clubs/DeleteClubSurfaceController.cs +++ b/Stoolball.Web/Clubs/DeleteClubSurfaceController.cs @@ -3,9 +3,9 @@ using Microsoft.AspNetCore.Mvc; using Stoolball.Clubs; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Clubs/EditClubController.cs b/Stoolball.Web/Clubs/EditClubController.cs index 957fa24d2..38292fd06 100644 --- a/Stoolball.Web/Clubs/EditClubController.cs +++ b/Stoolball.Web/Clubs/EditClubController.cs @@ -5,8 +5,8 @@ using Microsoft.Extensions.Logging; using Stoolball.Clubs; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Security; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Clubs/EditClubSurfaceController.cs b/Stoolball.Web/Clubs/EditClubSurfaceController.cs index c7db4a922..e35067d02 100644 --- a/Stoolball.Web/Clubs/EditClubSurfaceController.cs +++ b/Stoolball.Web/Clubs/EditClubSurfaceController.cs @@ -4,9 +4,9 @@ using Microsoft.AspNetCore.Mvc; using Stoolball.Clubs; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Clubs/MatchesForClubController.cs b/Stoolball.Web/Clubs/MatchesForClubController.cs index f315c4894..ccf5963ac 100644 --- a/Stoolball.Web/Clubs/MatchesForClubController.cs +++ b/Stoolball.Web/Clubs/MatchesForClubController.cs @@ -8,9 +8,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Competitions/CompetitionActionsController.cs b/Stoolball.Web/Competitions/CompetitionActionsController.cs index 3e9bb790c..c603418f9 100644 --- a/Stoolball.Web/Competitions/CompetitionActionsController.cs +++ b/Stoolball.Web/Competitions/CompetitionActionsController.cs @@ -5,9 +5,9 @@ using Microsoft.Extensions.Logging; using Stoolball.Competitions; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Competitions.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Competitions/CompetitionController.cs b/Stoolball.Web/Competitions/CompetitionController.cs index 1c431ed27..0f3e16b0a 100644 --- a/Stoolball.Web/Competitions/CompetitionController.cs +++ b/Stoolball.Web/Competitions/CompetitionController.cs @@ -6,9 +6,9 @@ using Stoolball.Competitions; using Stoolball.Data.Abstractions; using Stoolball.Email; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Competitions.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Competitions/CompetitionStatisticsController.cs b/Stoolball.Web/Competitions/CompetitionStatisticsController.cs index cc1325844..f4f0009da 100644 --- a/Stoolball.Web/Competitions/CompetitionStatisticsController.cs +++ b/Stoolball.Web/Competitions/CompetitionStatisticsController.cs @@ -6,8 +6,8 @@ using Microsoft.Extensions.Logging; using Stoolball.Competitions; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Stoolball.Web.Statistics.Models; diff --git a/Stoolball.Web/Competitions/CreateCompetitionController.cs b/Stoolball.Web/Competitions/CreateCompetitionController.cs index 2cd2e783b..4a89ce0c2 100644 --- a/Stoolball.Web/Competitions/CreateCompetitionController.cs +++ b/Stoolball.Web/Competitions/CreateCompetitionController.cs @@ -4,9 +4,9 @@ using Microsoft.AspNetCore.Mvc.ViewEngines; using Microsoft.Extensions.Logging; using Stoolball.Competitions; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Competitions.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Competitions/CreateCompetitionSurfaceController.cs b/Stoolball.Web/Competitions/CreateCompetitionSurfaceController.cs index 98bd45f28..929a44352 100644 --- a/Stoolball.Web/Competitions/CreateCompetitionSurfaceController.cs +++ b/Stoolball.Web/Competitions/CreateCompetitionSurfaceController.cs @@ -3,10 +3,10 @@ using Microsoft.AspNetCore.Mvc; using Stoolball.Competitions; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Routing; using Stoolball.Security; using Stoolball.Web.Competitions.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Competitions/CreateSeasonController.cs b/Stoolball.Web/Competitions/CreateSeasonController.cs index bc7a1b792..5ee03b28e 100644 --- a/Stoolball.Web/Competitions/CreateSeasonController.cs +++ b/Stoolball.Web/Competitions/CreateSeasonController.cs @@ -7,9 +7,9 @@ using Stoolball.Competitions; using Stoolball.Data.Abstractions; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Competitions.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Competitions/CreateSeasonSurfaceController.cs b/Stoolball.Web/Competitions/CreateSeasonSurfaceController.cs index 396b459ee..3ddf9d965 100644 --- a/Stoolball.Web/Competitions/CreateSeasonSurfaceController.cs +++ b/Stoolball.Web/Competitions/CreateSeasonSurfaceController.cs @@ -6,9 +6,9 @@ using Stoolball.Competitions; using Stoolball.Data.Abstractions; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Competitions.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Competitions/DeleteCompetitionController.cs b/Stoolball.Web/Competitions/DeleteCompetitionController.cs index d6ddbcee7..7f9b9a3a1 100644 --- a/Stoolball.Web/Competitions/DeleteCompetitionController.cs +++ b/Stoolball.Web/Competitions/DeleteCompetitionController.cs @@ -7,10 +7,10 @@ using Stoolball.Competitions; using Stoolball.Data.Abstractions; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; using Stoolball.Web.Competitions.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Competitions/DeleteCompetitionSurfaceController.cs b/Stoolball.Web/Competitions/DeleteCompetitionSurfaceController.cs index 2e2ccb823..4dddf7eb0 100644 --- a/Stoolball.Web/Competitions/DeleteCompetitionSurfaceController.cs +++ b/Stoolball.Web/Competitions/DeleteCompetitionSurfaceController.cs @@ -5,10 +5,10 @@ using Stoolball.Competitions; using Stoolball.Data.Abstractions; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; using Stoolball.Web.Competitions.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Competitions/DeleteSeasonController.cs b/Stoolball.Web/Competitions/DeleteSeasonController.cs index 2bc1b85fb..1b196b621 100644 --- a/Stoolball.Web/Competitions/DeleteSeasonController.cs +++ b/Stoolball.Web/Competitions/DeleteSeasonController.cs @@ -7,9 +7,9 @@ using Stoolball.Competitions; using Stoolball.Data.Abstractions; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Competitions.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Competitions/DeleteSeasonSurfaceController.cs b/Stoolball.Web/Competitions/DeleteSeasonSurfaceController.cs index b3b0bfd3d..01a59207f 100644 --- a/Stoolball.Web/Competitions/DeleteSeasonSurfaceController.cs +++ b/Stoolball.Web/Competitions/DeleteSeasonSurfaceController.cs @@ -6,9 +6,9 @@ using Stoolball.Competitions; using Stoolball.Data.Abstractions; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Competitions.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Competitions/EditCompetitionController.cs b/Stoolball.Web/Competitions/EditCompetitionController.cs index e1c508d2f..52e872ffc 100644 --- a/Stoolball.Web/Competitions/EditCompetitionController.cs +++ b/Stoolball.Web/Competitions/EditCompetitionController.cs @@ -6,9 +6,9 @@ using Microsoft.Extensions.Logging; using Stoolball.Competitions; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Competitions.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Competitions/EditCompetitionSurfaceController.cs b/Stoolball.Web/Competitions/EditCompetitionSurfaceController.cs index 1e494b060..b769f00f0 100644 --- a/Stoolball.Web/Competitions/EditCompetitionSurfaceController.cs +++ b/Stoolball.Web/Competitions/EditCompetitionSurfaceController.cs @@ -3,9 +3,9 @@ using Microsoft.AspNetCore.Mvc; using Stoolball.Competitions; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Competitions.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; diff --git a/Stoolball.Web/Competitions/EditSeasonController.cs b/Stoolball.Web/Competitions/EditSeasonController.cs index 3504f6d14..899e71d80 100644 --- a/Stoolball.Web/Competitions/EditSeasonController.cs +++ b/Stoolball.Web/Competitions/EditSeasonController.cs @@ -7,9 +7,9 @@ using Stoolball.Competitions; using Stoolball.Data.Abstractions; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Competitions.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Competitions/EditSeasonResultsTableController.cs b/Stoolball.Web/Competitions/EditSeasonResultsTableController.cs index c8489b48f..53c2199a6 100644 --- a/Stoolball.Web/Competitions/EditSeasonResultsTableController.cs +++ b/Stoolball.Web/Competitions/EditSeasonResultsTableController.cs @@ -6,9 +6,9 @@ using Microsoft.Extensions.Logging; using Stoolball.Competitions; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Competitions.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Competitions/EditSeasonResultsTableSurfaceController.cs b/Stoolball.Web/Competitions/EditSeasonResultsTableSurfaceController.cs index f4344ec47..1b76884fd 100644 --- a/Stoolball.Web/Competitions/EditSeasonResultsTableSurfaceController.cs +++ b/Stoolball.Web/Competitions/EditSeasonResultsTableSurfaceController.cs @@ -3,9 +3,9 @@ using Microsoft.AspNetCore.Mvc; using Stoolball.Competitions; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Competitions.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; diff --git a/Stoolball.Web/Competitions/EditSeasonSurfaceController.cs b/Stoolball.Web/Competitions/EditSeasonSurfaceController.cs index 452969649..547b183cc 100644 --- a/Stoolball.Web/Competitions/EditSeasonSurfaceController.cs +++ b/Stoolball.Web/Competitions/EditSeasonSurfaceController.cs @@ -6,9 +6,9 @@ using Stoolball.Competitions; using Stoolball.Data.Abstractions; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Competitions.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Competitions/EditSeasonTeamsController.cs b/Stoolball.Web/Competitions/EditSeasonTeamsController.cs index 07926971a..2ede5c863 100644 --- a/Stoolball.Web/Competitions/EditSeasonTeamsController.cs +++ b/Stoolball.Web/Competitions/EditSeasonTeamsController.cs @@ -5,9 +5,9 @@ using Microsoft.Extensions.Logging; using Stoolball.Competitions; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Competitions.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Competitions/EditSeasonTeamsSurfaceController.cs b/Stoolball.Web/Competitions/EditSeasonTeamsSurfaceController.cs index 8191be9fc..b0eb30782 100644 --- a/Stoolball.Web/Competitions/EditSeasonTeamsSurfaceController.cs +++ b/Stoolball.Web/Competitions/EditSeasonTeamsSurfaceController.cs @@ -4,9 +4,9 @@ using Microsoft.AspNetCore.Mvc; using Stoolball.Competitions; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Competitions.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Competitions/MatchesForSeasonController.cs b/Stoolball.Web/Competitions/MatchesForSeasonController.cs index a8d548554..b794d2105 100644 --- a/Stoolball.Web/Competitions/MatchesForSeasonController.cs +++ b/Stoolball.Web/Competitions/MatchesForSeasonController.cs @@ -6,11 +6,11 @@ using Stoolball.Competitions; using Stoolball.Data.Abstractions; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Competitions.Models; using Stoolball.Web.Matches; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Competitions/SeasonActionsController.cs b/Stoolball.Web/Competitions/SeasonActionsController.cs index d41f42646..f6033aa74 100644 --- a/Stoolball.Web/Competitions/SeasonActionsController.cs +++ b/Stoolball.Web/Competitions/SeasonActionsController.cs @@ -5,9 +5,9 @@ using Microsoft.Extensions.Logging; using Stoolball.Competitions; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Competitions.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Competitions/SeasonController.cs b/Stoolball.Web/Competitions/SeasonController.cs index 4bbaecba4..240003dee 100644 --- a/Stoolball.Web/Competitions/SeasonController.cs +++ b/Stoolball.Web/Competitions/SeasonController.cs @@ -6,9 +6,9 @@ using Stoolball.Competitions; using Stoolball.Data.Abstractions; using Stoolball.Email; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Competitions.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Competitions/SeasonMapController.cs b/Stoolball.Web/Competitions/SeasonMapController.cs index 98676151f..6808e9f6c 100644 --- a/Stoolball.Web/Competitions/SeasonMapController.cs +++ b/Stoolball.Web/Competitions/SeasonMapController.cs @@ -4,9 +4,9 @@ using Microsoft.AspNetCore.Mvc.ViewEngines; using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Web.Competitions.Models; using Stoolball.Web.Configuration; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Competitions/SeasonResultsTableController.cs b/Stoolball.Web/Competitions/SeasonResultsTableController.cs index a72592f97..57fdfbbd2 100644 --- a/Stoolball.Web/Competitions/SeasonResultsTableController.cs +++ b/Stoolball.Web/Competitions/SeasonResultsTableController.cs @@ -8,10 +8,10 @@ using Stoolball.Data.Abstractions; using Stoolball.Email; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Competitions.Models; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Competitions/SeasonStatisticsController.cs b/Stoolball.Web/Competitions/SeasonStatisticsController.cs index a9ccc2886..7bdc289c3 100644 --- a/Stoolball.Web/Competitions/SeasonStatisticsController.cs +++ b/Stoolball.Web/Competitions/SeasonStatisticsController.cs @@ -6,8 +6,8 @@ using Microsoft.Extensions.Logging; using Stoolball.Competitions; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Stoolball.Web.Statistics.Models; diff --git a/Stoolball.Web/MatchLocations/CreateMatchLocationController.cs b/Stoolball.Web/MatchLocations/CreateMatchLocationController.cs index 543415e44..72eccfab8 100644 --- a/Stoolball.Web/MatchLocations/CreateMatchLocationController.cs +++ b/Stoolball.Web/MatchLocations/CreateMatchLocationController.cs @@ -4,10 +4,10 @@ using Microsoft.AspNetCore.Mvc.ViewEngines; using Microsoft.Extensions.Logging; using Stoolball.MatchLocations; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Configuration; using Stoolball.Web.MatchLocations.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/MatchLocations/CreateMatchLocationSurfaceController.cs b/Stoolball.Web/MatchLocations/CreateMatchLocationSurfaceController.cs index 9f4f054bd..16ba0c21c 100644 --- a/Stoolball.Web/MatchLocations/CreateMatchLocationSurfaceController.cs +++ b/Stoolball.Web/MatchLocations/CreateMatchLocationSurfaceController.cs @@ -3,10 +3,10 @@ using Microsoft.AspNetCore.Mvc; using Stoolball.Data.Abstractions; using Stoolball.MatchLocations; -using Stoolball.Navigation; using Stoolball.Routing; using Stoolball.Security; using Stoolball.Web.MatchLocations.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/MatchLocations/DeleteMatchLocationController.cs b/Stoolball.Web/MatchLocations/DeleteMatchLocationController.cs index d2a58c843..9610e7b8d 100644 --- a/Stoolball.Web/MatchLocations/DeleteMatchLocationController.cs +++ b/Stoolball.Web/MatchLocations/DeleteMatchLocationController.cs @@ -7,9 +7,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Matches; using Stoolball.MatchLocations; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.MatchLocations.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/MatchLocations/DeleteMatchLocationSurfaceController.cs b/Stoolball.Web/MatchLocations/DeleteMatchLocationSurfaceController.cs index 16494104b..6c2d5a6d0 100644 --- a/Stoolball.Web/MatchLocations/DeleteMatchLocationSurfaceController.cs +++ b/Stoolball.Web/MatchLocations/DeleteMatchLocationSurfaceController.cs @@ -5,9 +5,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Matches; using Stoolball.MatchLocations; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.MatchLocations.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/MatchLocations/EditMatchLocationController.cs b/Stoolball.Web/MatchLocations/EditMatchLocationController.cs index e9c591c55..1163720bc 100644 --- a/Stoolball.Web/MatchLocations/EditMatchLocationController.cs +++ b/Stoolball.Web/MatchLocations/EditMatchLocationController.cs @@ -5,10 +5,10 @@ using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; using Stoolball.MatchLocations; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Configuration; using Stoolball.Web.MatchLocations.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/MatchLocations/EditMatchLocationSurfaceController.cs b/Stoolball.Web/MatchLocations/EditMatchLocationSurfaceController.cs index 93f685fb4..04cc5851e 100644 --- a/Stoolball.Web/MatchLocations/EditMatchLocationSurfaceController.cs +++ b/Stoolball.Web/MatchLocations/EditMatchLocationSurfaceController.cs @@ -3,9 +3,9 @@ using Microsoft.AspNetCore.Mvc; using Stoolball.Data.Abstractions; using Stoolball.MatchLocations; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.MatchLocations.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/MatchLocations/MatchLocationActionsController.cs b/Stoolball.Web/MatchLocations/MatchLocationActionsController.cs index 73b4d1932..6730ab6ab 100644 --- a/Stoolball.Web/MatchLocations/MatchLocationActionsController.cs +++ b/Stoolball.Web/MatchLocations/MatchLocationActionsController.cs @@ -5,9 +5,9 @@ using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; using Stoolball.MatchLocations; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.MatchLocations.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/MatchLocations/MatchLocationController.cs b/Stoolball.Web/MatchLocations/MatchLocationController.cs index 870e20947..f09730759 100644 --- a/Stoolball.Web/MatchLocations/MatchLocationController.cs +++ b/Stoolball.Web/MatchLocations/MatchLocationController.cs @@ -6,10 +6,10 @@ using Stoolball.Data.Abstractions; using Stoolball.Email; using Stoolball.MatchLocations; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Configuration; using Stoolball.Web.MatchLocations.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/MatchLocations/MatchLocationStatisticsController.cs b/Stoolball.Web/MatchLocations/MatchLocationStatisticsController.cs index 23e8a9e07..a508474d0 100644 --- a/Stoolball.Web/MatchLocations/MatchLocationStatisticsController.cs +++ b/Stoolball.Web/MatchLocations/MatchLocationStatisticsController.cs @@ -6,8 +6,8 @@ using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; using Stoolball.MatchLocations; -using Stoolball.Navigation; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Stoolball.Web.Statistics.Models; diff --git a/Stoolball.Web/MatchLocations/MatchesForMatchLocationController.cs b/Stoolball.Web/MatchLocations/MatchesForMatchLocationController.cs index 1464eefac..15e9cafe2 100644 --- a/Stoolball.Web/MatchLocations/MatchesForMatchLocationController.cs +++ b/Stoolball.Web/MatchLocations/MatchesForMatchLocationController.cs @@ -6,10 +6,10 @@ using Stoolball.Data.Abstractions; using Stoolball.Matches; using Stoolball.MatchLocations; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; using Stoolball.Web.MatchLocations.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/CreateFriendlyMatchController.cs b/Stoolball.Web/Matches/CreateFriendlyMatchController.cs index 6a0d18a8d..a375ab212 100644 --- a/Stoolball.Web/Matches/CreateFriendlyMatchController.cs +++ b/Stoolball.Web/Matches/CreateFriendlyMatchController.cs @@ -7,10 +7,10 @@ using Stoolball.Data.Abstractions; using Stoolball.Matches; using Stoolball.MatchLocations; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/CreateFriendlyMatchSurfaceController.cs b/Stoolball.Web/Matches/CreateFriendlyMatchSurfaceController.cs index 0e0e4eba1..c3467fb81 100644 --- a/Stoolball.Web/Matches/CreateFriendlyMatchSurfaceController.cs +++ b/Stoolball.Web/Matches/CreateFriendlyMatchSurfaceController.cs @@ -5,10 +5,10 @@ using Microsoft.AspNetCore.Mvc; using Stoolball.Data.Abstractions; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Matches/CreateKnockoutMatchController.cs b/Stoolball.Web/Matches/CreateKnockoutMatchController.cs index b2a5824cc..5b72fc18e 100644 --- a/Stoolball.Web/Matches/CreateKnockoutMatchController.cs +++ b/Stoolball.Web/Matches/CreateKnockoutMatchController.cs @@ -7,10 +7,10 @@ using Stoolball.Data.Abstractions; using Stoolball.Matches; using Stoolball.MatchLocations; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/CreateKnockoutMatchSurfaceController.cs b/Stoolball.Web/Matches/CreateKnockoutMatchSurfaceController.cs index a3dfbd457..a280dabf0 100644 --- a/Stoolball.Web/Matches/CreateKnockoutMatchSurfaceController.cs +++ b/Stoolball.Web/Matches/CreateKnockoutMatchSurfaceController.cs @@ -5,10 +5,10 @@ using Microsoft.AspNetCore.Mvc; using Stoolball.Data.Abstractions; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Matches/CreateLeagueMatchController.cs b/Stoolball.Web/Matches/CreateLeagueMatchController.cs index 5118c073d..70a2eb518 100644 --- a/Stoolball.Web/Matches/CreateLeagueMatchController.cs +++ b/Stoolball.Web/Matches/CreateLeagueMatchController.cs @@ -8,10 +8,10 @@ using Stoolball.Data.Abstractions; using Stoolball.Matches; using Stoolball.MatchLocations; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/CreateLeagueMatchSurfaceController.cs b/Stoolball.Web/Matches/CreateLeagueMatchSurfaceController.cs index d4b493088..1adcf09ae 100644 --- a/Stoolball.Web/Matches/CreateLeagueMatchSurfaceController.cs +++ b/Stoolball.Web/Matches/CreateLeagueMatchSurfaceController.cs @@ -5,10 +5,10 @@ using Microsoft.AspNetCore.Mvc; using Stoolball.Data.Abstractions; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Matches/CreateTournamentController.cs b/Stoolball.Web/Matches/CreateTournamentController.cs index 8fd94cf04..c4c83c0c7 100644 --- a/Stoolball.Web/Matches/CreateTournamentController.cs +++ b/Stoolball.Web/Matches/CreateTournamentController.cs @@ -8,10 +8,10 @@ using Stoolball.Data.Abstractions; using Stoolball.Matches; using Stoolball.MatchLocations; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/CreateTournamentSurfaceController.cs b/Stoolball.Web/Matches/CreateTournamentSurfaceController.cs index db9aaa2a1..8ab057fb4 100644 --- a/Stoolball.Web/Matches/CreateTournamentSurfaceController.cs +++ b/Stoolball.Web/Matches/CreateTournamentSurfaceController.cs @@ -4,9 +4,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Matches; using Stoolball.MatchLocations; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Matches/CreateTrainingSessionController.cs b/Stoolball.Web/Matches/CreateTrainingSessionController.cs index ed7062f6e..6411969b3 100644 --- a/Stoolball.Web/Matches/CreateTrainingSessionController.cs +++ b/Stoolball.Web/Matches/CreateTrainingSessionController.cs @@ -7,10 +7,10 @@ using Stoolball.Data.Abstractions; using Stoolball.Matches; using Stoolball.MatchLocations; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/CreateTrainingSessionSurfaceController.cs b/Stoolball.Web/Matches/CreateTrainingSessionSurfaceController.cs index 8bd7c4087..76bb02c58 100644 --- a/Stoolball.Web/Matches/CreateTrainingSessionSurfaceController.cs +++ b/Stoolball.Web/Matches/CreateTrainingSessionSurfaceController.cs @@ -5,10 +5,10 @@ using Microsoft.AspNetCore.Mvc; using Stoolball.Data.Abstractions; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Matches/DeleteMatchController.cs b/Stoolball.Web/Matches/DeleteMatchController.cs index 200ca30c6..cb5955b40 100644 --- a/Stoolball.Web/Matches/DeleteMatchController.cs +++ b/Stoolball.Web/Matches/DeleteMatchController.cs @@ -7,10 +7,10 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Statistics; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/DeleteMatchSurfaceController.cs b/Stoolball.Web/Matches/DeleteMatchSurfaceController.cs index d591892d0..9f2a9b3ea 100644 --- a/Stoolball.Web/Matches/DeleteMatchSurfaceController.cs +++ b/Stoolball.Web/Matches/DeleteMatchSurfaceController.cs @@ -4,9 +4,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Matches/DeleteTournamentController.cs b/Stoolball.Web/Matches/DeleteTournamentController.cs index cc5ed52ef..97ed26b65 100644 --- a/Stoolball.Web/Matches/DeleteTournamentController.cs +++ b/Stoolball.Web/Matches/DeleteTournamentController.cs @@ -6,9 +6,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/DeleteTournamentSurfaceController.cs b/Stoolball.Web/Matches/DeleteTournamentSurfaceController.cs index e4b324019..090bee551 100644 --- a/Stoolball.Web/Matches/DeleteTournamentSurfaceController.cs +++ b/Stoolball.Web/Matches/DeleteTournamentSurfaceController.cs @@ -4,9 +4,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Matches/EditBattingScorecardController.cs b/Stoolball.Web/Matches/EditBattingScorecardController.cs index f83a54a03..91bb33aff 100644 --- a/Stoolball.Web/Matches/EditBattingScorecardController.cs +++ b/Stoolball.Web/Matches/EditBattingScorecardController.cs @@ -8,9 +8,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/EditBattingScorecardSurfaceController.cs b/Stoolball.Web/Matches/EditBattingScorecardSurfaceController.cs index f959f99b7..94e3ddf04 100644 --- a/Stoolball.Web/Matches/EditBattingScorecardSurfaceController.cs +++ b/Stoolball.Web/Matches/EditBattingScorecardSurfaceController.cs @@ -6,10 +6,10 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Statistics; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Matches/EditBowlingScorecardController.cs b/Stoolball.Web/Matches/EditBowlingScorecardController.cs index 0fcd44db0..590b3b0c9 100644 --- a/Stoolball.Web/Matches/EditBowlingScorecardController.cs +++ b/Stoolball.Web/Matches/EditBowlingScorecardController.cs @@ -8,9 +8,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/EditBowlingScorecardSurfaceController.cs b/Stoolball.Web/Matches/EditBowlingScorecardSurfaceController.cs index 74824360e..cc6caf951 100644 --- a/Stoolball.Web/Matches/EditBowlingScorecardSurfaceController.cs +++ b/Stoolball.Web/Matches/EditBowlingScorecardSurfaceController.cs @@ -8,10 +8,10 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Statistics; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Matches/EditCloseOfPlayController.cs b/Stoolball.Web/Matches/EditCloseOfPlayController.cs index a0483e38f..3a5279625 100644 --- a/Stoolball.Web/Matches/EditCloseOfPlayController.cs +++ b/Stoolball.Web/Matches/EditCloseOfPlayController.cs @@ -8,9 +8,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/EditCloseOfPlaySurfaceController.cs b/Stoolball.Web/Matches/EditCloseOfPlaySurfaceController.cs index 75858794c..876509564 100644 --- a/Stoolball.Web/Matches/EditCloseOfPlaySurfaceController.cs +++ b/Stoolball.Web/Matches/EditCloseOfPlaySurfaceController.cs @@ -6,11 +6,11 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Statistics; using Stoolball.Teams; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Matches/EditFriendlyMatchController.cs b/Stoolball.Web/Matches/EditFriendlyMatchController.cs index 040e28d0e..21a9c5ce0 100644 --- a/Stoolball.Web/Matches/EditFriendlyMatchController.cs +++ b/Stoolball.Web/Matches/EditFriendlyMatchController.cs @@ -7,9 +7,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/EditFriendlyMatchSurfaceController.cs b/Stoolball.Web/Matches/EditFriendlyMatchSurfaceController.cs index 29b58d27f..a3dc94129 100644 --- a/Stoolball.Web/Matches/EditFriendlyMatchSurfaceController.cs +++ b/Stoolball.Web/Matches/EditFriendlyMatchSurfaceController.cs @@ -4,9 +4,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Matches/EditKnockoutMatchController.cs b/Stoolball.Web/Matches/EditKnockoutMatchController.cs index 5e46a7a17..2e0a40be6 100644 --- a/Stoolball.Web/Matches/EditKnockoutMatchController.cs +++ b/Stoolball.Web/Matches/EditKnockoutMatchController.cs @@ -7,9 +7,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/EditKnockoutMatchSurfaceController.cs b/Stoolball.Web/Matches/EditKnockoutMatchSurfaceController.cs index 6c2fcb2f8..260384605 100644 --- a/Stoolball.Web/Matches/EditKnockoutMatchSurfaceController.cs +++ b/Stoolball.Web/Matches/EditKnockoutMatchSurfaceController.cs @@ -4,9 +4,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Matches/EditLeagueMatchController.cs b/Stoolball.Web/Matches/EditLeagueMatchController.cs index 1be3c7dca..599839aaa 100644 --- a/Stoolball.Web/Matches/EditLeagueMatchController.cs +++ b/Stoolball.Web/Matches/EditLeagueMatchController.cs @@ -8,9 +8,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/EditLeagueMatchSurfaceController.cs b/Stoolball.Web/Matches/EditLeagueMatchSurfaceController.cs index 490f4af92..8fe10057d 100644 --- a/Stoolball.Web/Matches/EditLeagueMatchSurfaceController.cs +++ b/Stoolball.Web/Matches/EditLeagueMatchSurfaceController.cs @@ -4,9 +4,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Matches/EditMatchFormatController.cs b/Stoolball.Web/Matches/EditMatchFormatController.cs index 9f8390953..ffb58dc07 100644 --- a/Stoolball.Web/Matches/EditMatchFormatController.cs +++ b/Stoolball.Web/Matches/EditMatchFormatController.cs @@ -7,9 +7,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/EditMatchFormatSurfaceController.cs b/Stoolball.Web/Matches/EditMatchFormatSurfaceController.cs index edacf4489..fb8578e60 100644 --- a/Stoolball.Web/Matches/EditMatchFormatSurfaceController.cs +++ b/Stoolball.Web/Matches/EditMatchFormatSurfaceController.cs @@ -4,9 +4,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Matches/EditStartOfPlayController.cs b/Stoolball.Web/Matches/EditStartOfPlayController.cs index d5da0e7f3..7dbc2406f 100644 --- a/Stoolball.Web/Matches/EditStartOfPlayController.cs +++ b/Stoolball.Web/Matches/EditStartOfPlayController.cs @@ -7,9 +7,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/EditStartOfPlaySurfaceController.cs b/Stoolball.Web/Matches/EditStartOfPlaySurfaceController.cs index c95590ce7..fdf141a85 100644 --- a/Stoolball.Web/Matches/EditStartOfPlaySurfaceController.cs +++ b/Stoolball.Web/Matches/EditStartOfPlaySurfaceController.cs @@ -9,10 +9,10 @@ using Stoolball.Dates; using Stoolball.Matches; using Stoolball.MatchLocations; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Matches/EditTournamentController.cs b/Stoolball.Web/Matches/EditTournamentController.cs index 43213152f..cd9d4f9d7 100644 --- a/Stoolball.Web/Matches/EditTournamentController.cs +++ b/Stoolball.Web/Matches/EditTournamentController.cs @@ -7,9 +7,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/EditTournamentMatchesController.cs b/Stoolball.Web/Matches/EditTournamentMatchesController.cs index fe653d4b1..6cfeeff77 100644 --- a/Stoolball.Web/Matches/EditTournamentMatchesController.cs +++ b/Stoolball.Web/Matches/EditTournamentMatchesController.cs @@ -8,9 +8,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/EditTournamentMatchesSurfaceController.cs b/Stoolball.Web/Matches/EditTournamentMatchesSurfaceController.cs index a55cd2ac6..4847506bc 100644 --- a/Stoolball.Web/Matches/EditTournamentMatchesSurfaceController.cs +++ b/Stoolball.Web/Matches/EditTournamentMatchesSurfaceController.cs @@ -6,9 +6,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; diff --git a/Stoolball.Web/Matches/EditTournamentSeasonsController.cs b/Stoolball.Web/Matches/EditTournamentSeasonsController.cs index 2ef79794f..291ac5f49 100644 --- a/Stoolball.Web/Matches/EditTournamentSeasonsController.cs +++ b/Stoolball.Web/Matches/EditTournamentSeasonsController.cs @@ -10,10 +10,10 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/EditTournamentSurfaceController.cs b/Stoolball.Web/Matches/EditTournamentSurfaceController.cs index 2db75684d..ec919dccd 100644 --- a/Stoolball.Web/Matches/EditTournamentSurfaceController.cs +++ b/Stoolball.Web/Matches/EditTournamentSurfaceController.cs @@ -6,9 +6,9 @@ using Stoolball.Dates; using Stoolball.Matches; using Stoolball.MatchLocations; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Matches/EditTournamentTeamsController.cs b/Stoolball.Web/Matches/EditTournamentTeamsController.cs index 0fea4520d..9e74b1c7c 100644 --- a/Stoolball.Web/Matches/EditTournamentTeamsController.cs +++ b/Stoolball.Web/Matches/EditTournamentTeamsController.cs @@ -7,9 +7,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/EditTournamentTeamsSurfaceController.cs b/Stoolball.Web/Matches/EditTournamentTeamsSurfaceController.cs index 7c99ecda9..739810637 100644 --- a/Stoolball.Web/Matches/EditTournamentTeamsSurfaceController.cs +++ b/Stoolball.Web/Matches/EditTournamentTeamsSurfaceController.cs @@ -5,9 +5,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; diff --git a/Stoolball.Web/Matches/EditTrainingSessionController.cs b/Stoolball.Web/Matches/EditTrainingSessionController.cs index 00d8dd7ad..e12b77c20 100644 --- a/Stoolball.Web/Matches/EditTrainingSessionController.cs +++ b/Stoolball.Web/Matches/EditTrainingSessionController.cs @@ -6,9 +6,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/EditTrainingSessionSurfaceController.cs b/Stoolball.Web/Matches/EditTrainingSessionSurfaceController.cs index e553abd95..7f12ac0dd 100644 --- a/Stoolball.Web/Matches/EditTrainingSessionSurfaceController.cs +++ b/Stoolball.Web/Matches/EditTrainingSessionSurfaceController.cs @@ -4,9 +4,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; diff --git a/Stoolball.Web/Matches/MatchActionsController.cs b/Stoolball.Web/Matches/MatchActionsController.cs index c8fedd0e7..a8b5ba1d1 100644 --- a/Stoolball.Web/Matches/MatchActionsController.cs +++ b/Stoolball.Web/Matches/MatchActionsController.cs @@ -6,9 +6,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/MatchController.cs b/Stoolball.Web/Matches/MatchController.cs index 745255780..07078f161 100644 --- a/Stoolball.Web/Matches/MatchController.cs +++ b/Stoolball.Web/Matches/MatchController.cs @@ -8,10 +8,10 @@ using Stoolball.Email; using Stoolball.Html; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Configuration; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/TournamentActionsController.cs b/Stoolball.Web/Matches/TournamentActionsController.cs index b8611583c..1ec03abab 100644 --- a/Stoolball.Web/Matches/TournamentActionsController.cs +++ b/Stoolball.Web/Matches/TournamentActionsController.cs @@ -6,9 +6,9 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Matches/TournamentController.cs b/Stoolball.Web/Matches/TournamentController.cs index 99670b1cc..86a082dd6 100644 --- a/Stoolball.Web/Matches/TournamentController.cs +++ b/Stoolball.Web/Matches/TournamentController.cs @@ -8,10 +8,10 @@ using Stoolball.Email; using Stoolball.Html; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Web.Configuration; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Models/BaseViewModel.cs b/Stoolball.Web/Models/BaseViewModel.cs index 21e97c2ae..78b61ab5e 100644 --- a/Stoolball.Web/Models/BaseViewModel.cs +++ b/Stoolball.Web/Models/BaseViewModel.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using Stoolball.Metadata; -using Stoolball.Navigation; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Cms.Core.Services; diff --git a/Stoolball.Web/Models/IHasViewMetadata.cs b/Stoolball.Web/Models/IHasViewMetadata.cs index fcaa3de97..fd40b5269 100644 --- a/Stoolball.Web/Models/IHasViewMetadata.cs +++ b/Stoolball.Web/Models/IHasViewMetadata.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using Stoolball.Metadata; -using Stoolball.Navigation; +using Stoolball.Web.Navigation; using Umbraco.Cms.Core.Models.PublishedContent; namespace Stoolball.Web.Models diff --git a/Stoolball/Navigation/Breadcrumb.cs b/Stoolball.Web/Navigation/Breadcrumb.cs similarity index 85% rename from Stoolball/Navigation/Breadcrumb.cs rename to Stoolball.Web/Navigation/Breadcrumb.cs index 699c8f8a8..46c06b922 100644 --- a/Stoolball/Navigation/Breadcrumb.cs +++ b/Stoolball.Web/Navigation/Breadcrumb.cs @@ -1,7 +1,7 @@ using System; using System.Diagnostics.CodeAnalysis; -namespace Stoolball.Navigation +namespace Stoolball.Web.Navigation { [ExcludeFromCodeCoverage] public class Breadcrumb diff --git a/Stoolball/Statistics/IStatisticsBreadcrumbBuilder.cs b/Stoolball.Web/Navigation/IStatisticsBreadcrumbBuilder.cs similarity index 75% rename from Stoolball/Statistics/IStatisticsBreadcrumbBuilder.cs rename to Stoolball.Web/Navigation/IStatisticsBreadcrumbBuilder.cs index eca6a3f7e..7f85b3569 100644 --- a/Stoolball/Statistics/IStatisticsBreadcrumbBuilder.cs +++ b/Stoolball.Web/Navigation/IStatisticsBreadcrumbBuilder.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; -using Stoolball.Navigation; +using Stoolball.Statistics; -namespace Stoolball.Statistics +namespace Stoolball.Web.Navigation { public interface IStatisticsBreadcrumbBuilder { diff --git a/Stoolball.Web/Navigation/ITeamBreadcrumbBuilder.cs b/Stoolball.Web/Navigation/ITeamBreadcrumbBuilder.cs new file mode 100644 index 000000000..092afd111 --- /dev/null +++ b/Stoolball.Web/Navigation/ITeamBreadcrumbBuilder.cs @@ -0,0 +1,10 @@ +using System.Collections.Generic; +using Stoolball.Teams; + +namespace Stoolball.Web.Navigation +{ + public interface ITeamBreadcrumbBuilder + { + void BuildBreadcrumbs(List breadcrumbs, Team team, bool includeTeam); + } +} \ No newline at end of file diff --git a/Stoolball.Web/Navigation/ServiceCollectionExtensions.cs b/Stoolball.Web/Navigation/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..a4bf50499 --- /dev/null +++ b/Stoolball.Web/Navigation/ServiceCollectionExtensions.cs @@ -0,0 +1,14 @@ +using Microsoft.Extensions.DependencyInjection; + +namespace Stoolball.Web.Navigation +{ + public static class ServiceCollectionExtensions + { + public static IServiceCollection AddBreadcrumbBuilders(this IServiceCollection services) + { + services.AddTransient(); + services.AddTransient(); + return services; + } + } +} diff --git a/Stoolball/Statistics/StatisticsBreadcrumbBuilder.cs b/Stoolball.Web/Navigation/StatisticsBreadcrumbBuilder.cs similarity index 98% rename from Stoolball/Statistics/StatisticsBreadcrumbBuilder.cs rename to Stoolball.Web/Navigation/StatisticsBreadcrumbBuilder.cs index d6db297ca..9df6b87f4 100644 --- a/Stoolball/Statistics/StatisticsBreadcrumbBuilder.cs +++ b/Stoolball.Web/Navigation/StatisticsBreadcrumbBuilder.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; -using Stoolball.Navigation; +using Stoolball.Statistics; -namespace Stoolball.Statistics +namespace Stoolball.Web.Navigation { public class StatisticsBreadcrumbBuilder : IStatisticsBreadcrumbBuilder { diff --git a/Stoolball.Web/Navigation/TeamBreadcrumbBuilder.cs b/Stoolball.Web/Navigation/TeamBreadcrumbBuilder.cs new file mode 100644 index 000000000..4f96debac --- /dev/null +++ b/Stoolball.Web/Navigation/TeamBreadcrumbBuilder.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using Stoolball.Teams; + +namespace Stoolball.Web.Navigation +{ + public class TeamBreadcrumbBuilder : ITeamBreadcrumbBuilder + { + public void BuildBreadcrumbs(List breadcrumbs, Team team, bool includeTeam) + { + if (breadcrumbs is null) + { + throw new ArgumentNullException(nameof(breadcrumbs)); + } + + if (team is null) + { + throw new ArgumentNullException(nameof(team)); + } + + breadcrumbs.Add(new Breadcrumb { Name = Constants.Pages.Teams, Url = new Uri(Constants.Pages.TeamsUrl, UriKind.Relative) }); + if (team.Club != null && !string.IsNullOrEmpty(team.Club.ClubRoute)) + { + breadcrumbs.Add(new Breadcrumb { Name = team.Club.ClubName, Url = new Uri(team.Club.ClubRoute, UriKind.Relative) }); + } + if (includeTeam && !string.IsNullOrEmpty(team.TeamRoute)) + { + breadcrumbs.Add(new Breadcrumb { Name = team.TeamName, Url = new Uri(team.TeamRoute, UriKind.Relative) }); + } + } + } +} \ No newline at end of file diff --git a/Stoolball.Web/Pages/Content.cs b/Stoolball.Web/Pages/Content.cs index 918bcf785..17929410e 100644 --- a/Stoolball.Web/Pages/Content.cs +++ b/Stoolball.Web/Pages/Content.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using Stoolball.Metadata; -using Stoolball.Navigation; +using Stoolball.Web.Navigation; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Extensions; diff --git a/Stoolball.Web/Pages/HeaderViewModel.cs b/Stoolball.Web/Pages/HeaderViewModel.cs index 24651d390..a4b1132b2 100644 --- a/Stoolball.Web/Pages/HeaderViewModel.cs +++ b/Stoolball.Web/Pages/HeaderViewModel.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; using Stoolball.Metadata; -using Stoolball.Navigation; using Stoolball.Statistics; using Stoolball.Web.Models; +using Stoolball.Web.Navigation; using Umbraco.Cms.Core.Models.PublishedContent; namespace Stoolball.Web.Pages diff --git a/Stoolball.Web/Pages/Home.cs b/Stoolball.Web/Pages/Home.cs index 6917f4415..36b1715fa 100644 --- a/Stoolball.Web/Pages/Home.cs +++ b/Stoolball.Web/Pages/Home.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using Stoolball.Metadata; -using Stoolball.Navigation; +using Stoolball.Web.Navigation; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Extensions; diff --git a/Stoolball.Web/Pages/News.cs b/Stoolball.Web/Pages/News.cs index da804f359..ee8478d89 100644 --- a/Stoolball.Web/Pages/News.cs +++ b/Stoolball.Web/Pages/News.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using Stoolball.Metadata; -using Stoolball.Navigation; +using Stoolball.Web.Navigation; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Extensions; diff --git a/Stoolball.Web/Pages/NewsStory.cs b/Stoolball.Web/Pages/NewsStory.cs index 788949498..27a8b06a3 100644 --- a/Stoolball.Web/Pages/NewsStory.cs +++ b/Stoolball.Web/Pages/NewsStory.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using Stoolball.Metadata; -using Stoolball.Navigation; +using Stoolball.Web.Navigation; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Extensions; diff --git a/Stoolball.Web/Pages/ProductList.cs b/Stoolball.Web/Pages/ProductList.cs index cd6142d3d..a1c0ce5df 100644 --- a/Stoolball.Web/Pages/ProductList.cs +++ b/Stoolball.Web/Pages/ProductList.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using Stoolball.Metadata; -using Stoolball.Navigation; +using Stoolball.Web.Navigation; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Extensions; diff --git a/Stoolball.Web/Pages/StyleGuide.cs b/Stoolball.Web/Pages/StyleGuide.cs index cdd6ad9ff..df7e7157a 100644 --- a/Stoolball.Web/Pages/StyleGuide.cs +++ b/Stoolball.Web/Pages/StyleGuide.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using Stoolball.Metadata; -using Stoolball.Navigation; +using Stoolball.Web.Navigation; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Extensions; diff --git a/Stoolball.Web/Schools/SchoolsController.cs b/Stoolball.Web/Schools/SchoolsController.cs index a848b6db7..266a771d0 100644 --- a/Stoolball.Web/Schools/SchoolsController.cs +++ b/Stoolball.Web/Schools/SchoolsController.cs @@ -6,8 +6,8 @@ using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; using Stoolball.Listings; -using Stoolball.Navigation; using Stoolball.Schools; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Startup.cs b/Stoolball.Web/Startup.cs index 78dd5b021..d94a843ee 100644 --- a/Stoolball.Web/Startup.cs +++ b/Stoolball.Web/Startup.cs @@ -33,6 +33,7 @@ using Stoolball.Web.Matches; using Stoolball.Web.MatchLocations; using Stoolball.Web.MatchLocations.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Schools; using Stoolball.Web.Security; @@ -121,7 +122,6 @@ public void ConfigureServices(IServiceCollection services) services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -130,6 +130,8 @@ public void ConfigureServices(IServiceCollection services) services.AddTransient(); services.AddTransient(); + services.AddBreadcrumbBuilders(); + // Data filters services.AddTransient(); services.AddTransient(); diff --git a/Stoolball.Web/Statistics/BaseStatisticsTableController.cs b/Stoolball.Web/Statistics/BaseStatisticsTableController.cs index 890d1432a..8c4c10290 100644 --- a/Stoolball.Web/Statistics/BaseStatisticsTableController.cs +++ b/Stoolball.Web/Statistics/BaseStatisticsTableController.cs @@ -9,6 +9,7 @@ using Microsoft.Extensions.Logging; using Stoolball.Statistics; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Stoolball.Web.Statistics.Models; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Statistics/BattingAverageController.cs b/Stoolball.Web/Statistics/BattingAverageController.cs index 5f653323c..e1d545d3b 100644 --- a/Stoolball.Web/Statistics/BattingAverageController.cs +++ b/Stoolball.Web/Statistics/BattingAverageController.cs @@ -4,6 +4,7 @@ using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Statistics/BattingStrikeRateController.cs b/Stoolball.Web/Statistics/BattingStrikeRateController.cs index 53b864a0b..5b74a4e61 100644 --- a/Stoolball.Web/Statistics/BattingStrikeRateController.cs +++ b/Stoolball.Web/Statistics/BattingStrikeRateController.cs @@ -4,6 +4,7 @@ using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Statistics/BowlingAverageController.cs b/Stoolball.Web/Statistics/BowlingAverageController.cs index 853342173..1ea85413a 100644 --- a/Stoolball.Web/Statistics/BowlingAverageController.cs +++ b/Stoolball.Web/Statistics/BowlingAverageController.cs @@ -4,6 +4,7 @@ using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Statistics/BowlingFiguresController.cs b/Stoolball.Web/Statistics/BowlingFiguresController.cs index bed65bd9c..d15016f59 100644 --- a/Stoolball.Web/Statistics/BowlingFiguresController.cs +++ b/Stoolball.Web/Statistics/BowlingFiguresController.cs @@ -3,6 +3,7 @@ using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Statistics/BowlingStrikeRateController.cs b/Stoolball.Web/Statistics/BowlingStrikeRateController.cs index 44be6ea09..c216a7630 100644 --- a/Stoolball.Web/Statistics/BowlingStrikeRateController.cs +++ b/Stoolball.Web/Statistics/BowlingStrikeRateController.cs @@ -4,6 +4,7 @@ using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Statistics/CatchesController.cs b/Stoolball.Web/Statistics/CatchesController.cs index 5726cfd99..fb2d57fb3 100644 --- a/Stoolball.Web/Statistics/CatchesController.cs +++ b/Stoolball.Web/Statistics/CatchesController.cs @@ -6,6 +6,7 @@ using Stoolball.Data.Abstractions; using Stoolball.Matches; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Statistics/EconomyRateController.cs b/Stoolball.Web/Statistics/EconomyRateController.cs index efbd35d50..8e3f95839 100644 --- a/Stoolball.Web/Statistics/EconomyRateController.cs +++ b/Stoolball.Web/Statistics/EconomyRateController.cs @@ -4,6 +4,7 @@ using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Statistics/IndividualScoresController.cs b/Stoolball.Web/Statistics/IndividualScoresController.cs index 17c1e148a..fa47e863b 100644 --- a/Stoolball.Web/Statistics/IndividualScoresController.cs +++ b/Stoolball.Web/Statistics/IndividualScoresController.cs @@ -4,6 +4,7 @@ using Stoolball.Data.Abstractions; using Stoolball.Matches; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Statistics/LinkedPlayersForMemberController.cs b/Stoolball.Web/Statistics/LinkedPlayersForMemberController.cs index a96ae40db..f2e46e897 100644 --- a/Stoolball.Web/Statistics/LinkedPlayersForMemberController.cs +++ b/Stoolball.Web/Statistics/LinkedPlayersForMemberController.cs @@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Mvc.ViewEngines; using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Stoolball.Web.Statistics.Models; diff --git a/Stoolball.Web/Statistics/MostCatchesController.cs b/Stoolball.Web/Statistics/MostCatchesController.cs index 685142786..c36f9261f 100644 --- a/Stoolball.Web/Statistics/MostCatchesController.cs +++ b/Stoolball.Web/Statistics/MostCatchesController.cs @@ -3,6 +3,7 @@ using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Statistics/MostPlayerOfTheMatchAwardsController.cs b/Stoolball.Web/Statistics/MostPlayerOfTheMatchAwardsController.cs index e135e3ca4..576d7f9fb 100644 --- a/Stoolball.Web/Statistics/MostPlayerOfTheMatchAwardsController.cs +++ b/Stoolball.Web/Statistics/MostPlayerOfTheMatchAwardsController.cs @@ -3,6 +3,7 @@ using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Statistics/MostRunOutsController.cs b/Stoolball.Web/Statistics/MostRunOutsController.cs index 7f7fe249a..5aa777298 100644 --- a/Stoolball.Web/Statistics/MostRunOutsController.cs +++ b/Stoolball.Web/Statistics/MostRunOutsController.cs @@ -3,6 +3,7 @@ using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Statistics/MostRunsController.cs b/Stoolball.Web/Statistics/MostRunsController.cs index 3d2ca95de..c5b035622 100644 --- a/Stoolball.Web/Statistics/MostRunsController.cs +++ b/Stoolball.Web/Statistics/MostRunsController.cs @@ -3,6 +3,7 @@ using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Statistics/MostScoresOfXController.cs b/Stoolball.Web/Statistics/MostScoresOfXController.cs index 70e8c7924..53d6907c8 100644 --- a/Stoolball.Web/Statistics/MostScoresOfXController.cs +++ b/Stoolball.Web/Statistics/MostScoresOfXController.cs @@ -3,6 +3,7 @@ using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Statistics/MostWicketsController.cs b/Stoolball.Web/Statistics/MostWicketsController.cs index 3e76f01b5..077c64f37 100644 --- a/Stoolball.Web/Statistics/MostWicketsController.cs +++ b/Stoolball.Web/Statistics/MostWicketsController.cs @@ -3,6 +3,7 @@ using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Statistics/MostXWicketsController.cs b/Stoolball.Web/Statistics/MostXWicketsController.cs index b9f3f40fd..e01d07a56 100644 --- a/Stoolball.Web/Statistics/MostXWicketsController.cs +++ b/Stoolball.Web/Statistics/MostXWicketsController.cs @@ -3,6 +3,7 @@ using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Statistics/PlayerBattingController.cs b/Stoolball.Web/Statistics/PlayerBattingController.cs index 6369c9111..26fcde3f7 100644 --- a/Stoolball.Web/Statistics/PlayerBattingController.cs +++ b/Stoolball.Web/Statistics/PlayerBattingController.cs @@ -6,8 +6,8 @@ using Microsoft.AspNetCore.Mvc.ViewEngines; using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Stoolball.Web.Statistics.Models; diff --git a/Stoolball.Web/Statistics/PlayerBowlingController.cs b/Stoolball.Web/Statistics/PlayerBowlingController.cs index 974c78cbf..11f9ee01a 100644 --- a/Stoolball.Web/Statistics/PlayerBowlingController.cs +++ b/Stoolball.Web/Statistics/PlayerBowlingController.cs @@ -6,8 +6,8 @@ using Microsoft.AspNetCore.Mvc.ViewEngines; using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Stoolball.Web.Statistics.Models; diff --git a/Stoolball.Web/Statistics/PlayerFieldingController.cs b/Stoolball.Web/Statistics/PlayerFieldingController.cs index f41d1c095..765912a09 100644 --- a/Stoolball.Web/Statistics/PlayerFieldingController.cs +++ b/Stoolball.Web/Statistics/PlayerFieldingController.cs @@ -8,6 +8,7 @@ using Stoolball.Data.Abstractions; using Stoolball.Navigation; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Stoolball.Web.Statistics.Models; diff --git a/Stoolball.Web/Statistics/PlayerOfTheMatchAwardsController.cs b/Stoolball.Web/Statistics/PlayerOfTheMatchAwardsController.cs index 4ca41ff9c..94572c8c0 100644 --- a/Stoolball.Web/Statistics/PlayerOfTheMatchAwardsController.cs +++ b/Stoolball.Web/Statistics/PlayerOfTheMatchAwardsController.cs @@ -3,6 +3,7 @@ using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Statistics/PlayerPerformancesController.cs b/Stoolball.Web/Statistics/PlayerPerformancesController.cs index 0d4350eb9..b9ebf7148 100644 --- a/Stoolball.Web/Statistics/PlayerPerformancesController.cs +++ b/Stoolball.Web/Statistics/PlayerPerformancesController.cs @@ -3,6 +3,7 @@ using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Statistics/PlayerSummaryViewModelFactory.cs b/Stoolball.Web/Statistics/PlayerSummaryViewModelFactory.cs index 416b12753..c1ee80d82 100644 --- a/Stoolball.Web/Statistics/PlayerSummaryViewModelFactory.cs +++ b/Stoolball.Web/Statistics/PlayerSummaryViewModelFactory.cs @@ -4,6 +4,7 @@ using Humanizer; using Stoolball.Data.Abstractions; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Statistics.Models; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Cms.Core.Services; diff --git a/Stoolball.Web/Statistics/RunOutsController.cs b/Stoolball.Web/Statistics/RunOutsController.cs index 9a92a1aee..77d7c3625 100644 --- a/Stoolball.Web/Statistics/RunOutsController.cs +++ b/Stoolball.Web/Statistics/RunOutsController.cs @@ -6,6 +6,7 @@ using Stoolball.Data.Abstractions; using Stoolball.Matches; using Stoolball.Statistics; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Umbraco.Cms.Core.Web; diff --git a/Stoolball.Web/Teams/CreateTeamController.cs b/Stoolball.Web/Teams/CreateTeamController.cs index 47ca9092b..9e36d98dd 100644 --- a/Stoolball.Web/Teams/CreateTeamController.cs +++ b/Stoolball.Web/Teams/CreateTeamController.cs @@ -3,9 +3,9 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.ViewEngines; using Microsoft.Extensions.Logging; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Stoolball.Web.Teams.Models; diff --git a/Stoolball.Web/Teams/CreateTeamSurfaceController.cs b/Stoolball.Web/Teams/CreateTeamSurfaceController.cs index 05389e450..8b6b8e350 100644 --- a/Stoolball.Web/Teams/CreateTeamSurfaceController.cs +++ b/Stoolball.Web/Teams/CreateTeamSurfaceController.cs @@ -4,9 +4,9 @@ using Microsoft.AspNetCore.Mvc; using Stoolball.Data.Abstractions; using Stoolball.MatchLocations; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Stoolball.Web.Teams.Models; using Umbraco.Cms.Core.Cache; diff --git a/Stoolball.Web/Teams/DeleteTeamController.cs b/Stoolball.Web/Teams/DeleteTeamController.cs index e4a321e24..700358685 100644 --- a/Stoolball.Web/Teams/DeleteTeamController.cs +++ b/Stoolball.Web/Teams/DeleteTeamController.cs @@ -7,10 +7,10 @@ using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Statistics; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Stoolball.Web.Teams.Models; @@ -25,6 +25,7 @@ public class DeleteTeamController : RenderController, IRenderControllerAsync private readonly IMatchListingDataSource _matchDataSource; private readonly IPlayerDataSource _playerDataSource; private readonly IAuthorizationPolicy _authorizationPolicy; + private readonly ITeamBreadcrumbBuilder _breadcrumbBuilder; public DeleteTeamController(ILogger logger, ICompositeViewEngine compositeViewEngine, @@ -32,13 +33,15 @@ public DeleteTeamController(ILogger logger, ITeamDataSource teamDataSource, IMatchListingDataSource matchDataSource, IPlayerDataSource playerDataSource, - IAuthorizationPolicy authorizationPolicy) + IAuthorizationPolicy authorizationPolicy, + ITeamBreadcrumbBuilder breadcrumbBuilder) : base(logger, compositeViewEngine, umbracoContextAccessor) { _teamDataSource = teamDataSource ?? throw new ArgumentNullException(nameof(teamDataSource)); _matchDataSource = matchDataSource ?? throw new ArgumentNullException(nameof(matchDataSource)); _playerDataSource = playerDataSource ?? throw new ArgumentNullException(nameof(playerDataSource)); _authorizationPolicy = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy)); + _breadcrumbBuilder = breadcrumbBuilder ?? throw new ArgumentNullException(nameof(breadcrumbBuilder)); } [HttpGet] @@ -65,7 +68,7 @@ public DeleteTeamController(ILogger logger, model.Team.Players = (await _playerDataSource.ReadPlayerIdentities(new PlayerFilter { TeamIds = teamIds - }).ConfigureAwait(false))?.Select(x => new Player { PlayerIdentities = new List { x } }).ToList(); + }).ConfigureAwait(false)).Select(x => new Player { PlayerIdentities = new List { x } }).ToList(); model.ConfirmDeleteRequest.RequiredText = model.Team.TeamName; @@ -73,12 +76,7 @@ public DeleteTeamController(ILogger logger, model.Metadata.PageTitle = "Delete " + model.Team.TeamName; - model.Breadcrumbs.Add(new Breadcrumb { Name = Constants.Pages.Teams, Url = new Uri(Constants.Pages.TeamsUrl, UriKind.Relative) }); - if (model.Team.Club != null) - { - model.Breadcrumbs.Add(new Breadcrumb { Name = model.Team.Club.ClubName, Url = new Uri(model.Team.Club.ClubRoute, UriKind.Relative) }); - } - model.Breadcrumbs.Add(new Breadcrumb { Name = model.Team.TeamName, Url = new Uri(model.Team.TeamRoute, UriKind.Relative) }); + _breadcrumbBuilder.BuildBreadcrumbs(model.Breadcrumbs, model.Team, true); return CurrentTemplate(model); } diff --git a/Stoolball.Web/Teams/DeleteTeamSurfaceController.cs b/Stoolball.Web/Teams/DeleteTeamSurfaceController.cs index 7dfcbf92d..73cc675e6 100644 --- a/Stoolball.Web/Teams/DeleteTeamSurfaceController.cs +++ b/Stoolball.Web/Teams/DeleteTeamSurfaceController.cs @@ -5,10 +5,10 @@ using Microsoft.AspNetCore.Mvc; using Stoolball.Data.Abstractions; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Statistics; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Stoolball.Web.Teams.Models; using Umbraco.Cms.Core.Cache; @@ -33,11 +33,13 @@ public class DeleteTeamSurfaceController : SurfaceController private readonly IAuthorizationPolicy _authorizationPolicy; private readonly IListingCacheInvalidator _teamListingCacheClearer; private readonly IMatchListingCacheInvalidator _matchListingCacheClearer; + private readonly ITeamBreadcrumbBuilder _breadcrumbBuilder; public DeleteTeamSurfaceController(IUmbracoContextAccessor umbracoContextAccessor, IUmbracoDatabaseFactory umbracoDatabaseFactory, ServiceContext serviceContext, AppCaches appCaches, IProfilingLogger profilingLogger, IPublishedUrlProvider publishedUrlProvider, IMemberManager memberManager, ITeamDataSource teamDataSource, ITeamRepository teamRepository, IMatchListingDataSource matchDataSource, IPlayerDataSource playerDataSource, - IAuthorizationPolicy authorizationPolicy, IListingCacheInvalidator teamListingCacheClearer, IMatchListingCacheInvalidator matchListingCacheClearer) + IAuthorizationPolicy authorizationPolicy, IListingCacheInvalidator teamListingCacheClearer, IMatchListingCacheInvalidator matchListingCacheClearer, + ITeamBreadcrumbBuilder breadcrumbBuilder) : base(umbracoContextAccessor, umbracoDatabaseFactory, serviceContext, appCaches, profilingLogger, publishedUrlProvider) { _memberManager = memberManager ?? throw new ArgumentNullException(nameof(memberManager)); @@ -48,6 +50,7 @@ public DeleteTeamSurfaceController(IUmbracoContextAccessor umbracoContextAccesso _authorizationPolicy = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy)); _teamListingCacheClearer = teamListingCacheClearer ?? throw new ArgumentNullException(nameof(teamListingCacheClearer)); _matchListingCacheClearer = matchListingCacheClearer ?? throw new ArgumentNullException(nameof(matchListingCacheClearer)); + _breadcrumbBuilder = breadcrumbBuilder ?? throw new ArgumentNullException(nameof(breadcrumbBuilder)); } [HttpPost] @@ -92,20 +95,12 @@ public async Task DeleteTeam([Bind("RequiredText", "ConfirmationT model.Team.Players = (await _playerDataSource.ReadPlayerIdentities(new PlayerFilter { TeamIds = teamIds - }))?.Select(x => new Player { PlayerIdentities = new List { x } }).ToList(); + })).Select(x => new Player { PlayerIdentities = new List { x } }).ToList(); } model.Metadata.PageTitle = $"Delete {model.Team.TeamName}"; - model.Breadcrumbs.Add(new Breadcrumb { Name = Constants.Pages.Teams, Url = new Uri(Constants.Pages.TeamsUrl, UriKind.Relative) }); - if (model.Team.Club != null) - { - model.Breadcrumbs.Add(new Breadcrumb { Name = model.Team.Club.ClubName, Url = new Uri(model.Team.Club.ClubRoute, UriKind.Relative) }); - } - if (!model.Deleted) - { - model.Breadcrumbs.Add(new Breadcrumb { Name = model.Team.TeamName, Url = new Uri(model.Team.TeamRoute, UriKind.Relative) }); - } + _breadcrumbBuilder.BuildBreadcrumbs(model.Breadcrumbs, model.Team, !model.Deleted); return View("DeleteTeam", model); } diff --git a/Stoolball.Web/Teams/EditPlayersForTeamController.cs b/Stoolball.Web/Teams/EditPlayersForTeamController.cs index f851c13a9..781ff939e 100644 --- a/Stoolball.Web/Teams/EditPlayersForTeamController.cs +++ b/Stoolball.Web/Teams/EditPlayersForTeamController.cs @@ -5,10 +5,10 @@ using Microsoft.AspNetCore.Mvc.ViewEngines; using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Statistics; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Stoolball.Web.Teams.Models; @@ -22,18 +22,21 @@ public class EditPlayersForTeamController : RenderController, IRenderControllerA private readonly ITeamDataSource _teamDataSource; private readonly IAuthorizationPolicy _authorizationPolicy; private readonly IPlayerDataSource _playerDataSource; + private readonly ITeamBreadcrumbBuilder _breadcrumbBuilder; public EditPlayersForTeamController(ILogger logger, ICompositeViewEngine compositeViewEngine, IUmbracoContextAccessor umbracoContextAccessor, ITeamDataSource teamDataSource, IAuthorizationPolicy authorizationPolicy, - IPlayerDataSource playerDataSource) + IPlayerDataSource playerDataSource, + ITeamBreadcrumbBuilder breadcrumbBuilder) : base(logger, compositeViewEngine, umbracoContextAccessor) { _teamDataSource = teamDataSource ?? throw new ArgumentNullException(nameof(teamDataSource)); _authorizationPolicy = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy)); _playerDataSource = playerDataSource ?? throw new ArgumentNullException(nameof(playerDataSource)); + _breadcrumbBuilder = breadcrumbBuilder ?? throw new ArgumentNullException(nameof(breadcrumbBuilder)); } [HttpGet] @@ -57,12 +60,7 @@ public EditPlayersForTeamController(ILogger logger model.Metadata.PageTitle = "Edit players for " + model.Team.TeamName + " stoolball team"; - model.Breadcrumbs.Add(new Breadcrumb { Name = Constants.Pages.Teams, Url = new Uri(Constants.Pages.TeamsUrl, UriKind.Relative) }); - if (model.Team.Club != null) - { - model.Breadcrumbs.Add(new Breadcrumb { Name = model.Team.Club.ClubName, Url = new Uri(model.Team.Club.ClubRoute!, UriKind.Relative) }); - } - model.Breadcrumbs.Add(new Breadcrumb { Name = model.Team.TeamName, Url = new Uri(model.Team.TeamRoute!, UriKind.Relative) }); + _breadcrumbBuilder.BuildBreadcrumbs(model.Breadcrumbs, model.Team, true); return CurrentTemplate(model); } diff --git a/Stoolball.Web/Teams/EditTeamController.cs b/Stoolball.Web/Teams/EditTeamController.cs index 8d621bd95..0befa97d5 100644 --- a/Stoolball.Web/Teams/EditTeamController.cs +++ b/Stoolball.Web/Teams/EditTeamController.cs @@ -4,9 +4,9 @@ using Microsoft.AspNetCore.Mvc.ViewEngines; using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Stoolball.Web.Teams.Models; @@ -19,16 +19,19 @@ public class EditTeamController : RenderController, IRenderControllerAsync { private readonly ITeamDataSource _teamDataSource; private readonly IAuthorizationPolicy _authorizationPolicy; + private readonly ITeamBreadcrumbBuilder _breadcrumbBuilder; public EditTeamController(ILogger logger, ICompositeViewEngine compositeViewEngine, IUmbracoContextAccessor umbracoContextAccessor, ITeamDataSource teamDataSource, - IAuthorizationPolicy authorizationPolicy) + IAuthorizationPolicy authorizationPolicy, + ITeamBreadcrumbBuilder breadcrumbBuilder) : base(logger, compositeViewEngine, umbracoContextAccessor) { _teamDataSource = teamDataSource ?? throw new ArgumentNullException(nameof(teamDataSource)); _authorizationPolicy = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy)); + _breadcrumbBuilder = breadcrumbBuilder ?? throw new ArgumentNullException(nameof(breadcrumbBuilder)); } [HttpGet] @@ -51,12 +54,7 @@ public EditTeamController(ILogger logger, model.Metadata.PageTitle = "Edit " + model.Team.TeamName; - model.Breadcrumbs.Add(new Breadcrumb { Name = Constants.Pages.Teams, Url = new Uri(Constants.Pages.TeamsUrl, UriKind.Relative) }); - if (model.Team.Club != null) - { - model.Breadcrumbs.Add(new Breadcrumb { Name = model.Team.Club.ClubName, Url = new Uri(model.Team.Club.ClubRoute!, UriKind.Relative) }); - } - model.Breadcrumbs.Add(new Breadcrumb { Name = model.Team.TeamName, Url = new Uri(model.Team.TeamRoute!, UriKind.Relative) }); + _breadcrumbBuilder.BuildBreadcrumbs(model.Breadcrumbs, model.Team, true); return CurrentTemplate(model); } diff --git a/Stoolball.Web/Teams/EditTeamSurfaceController.cs b/Stoolball.Web/Teams/EditTeamSurfaceController.cs index 62ba1cf3a..074b1622a 100644 --- a/Stoolball.Web/Teams/EditTeamSurfaceController.cs +++ b/Stoolball.Web/Teams/EditTeamSurfaceController.cs @@ -4,9 +4,9 @@ using Microsoft.AspNetCore.Mvc; using Stoolball.Data.Abstractions; using Stoolball.MatchLocations; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Stoolball.Web.Teams.Models; using Umbraco.Cms.Core.Cache; @@ -29,11 +29,13 @@ public class EditTeamSurfaceController : SurfaceController private readonly IAuthorizationPolicy _authorizationPolicy; private readonly IListingCacheInvalidator _teamListingCacheClearer; private readonly IListingCacheInvalidator _matchLocationCacheClearer; + private readonly ITeamBreadcrumbBuilder _breadcrumbBuilder; public EditTeamSurfaceController(IUmbracoContextAccessor umbracoContextAccessor, IUmbracoDatabaseFactory umbracoDatabaseFactory, ServiceContext serviceContext, AppCaches appCaches, IProfilingLogger profilingLogger, IPublishedUrlProvider publishedUrlProvider, IMemberManager memberManager, ITeamDataSource teamDataSource, ITeamRepository teamRepository, IAuthorizationPolicy authorizationPolicy, - IListingCacheInvalidator teamListingCacheClearer, IListingCacheInvalidator matchLocationCacheClearer) + IListingCacheInvalidator teamListingCacheClearer, IListingCacheInvalidator matchLocationCacheClearer, + ITeamBreadcrumbBuilder breadcrumbBuilder) : base(umbracoContextAccessor, umbracoDatabaseFactory, serviceContext, appCaches, profilingLogger, publishedUrlProvider) { _memberManager = memberManager ?? throw new ArgumentNullException(nameof(memberManager)); @@ -42,6 +44,7 @@ public EditTeamSurfaceController(IUmbracoContextAccessor umbracoContextAccessor, _authorizationPolicy = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy)); _teamListingCacheClearer = teamListingCacheClearer ?? throw new ArgumentNullException(nameof(teamListingCacheClearer)); _matchLocationCacheClearer = matchLocationCacheClearer ?? throw new ArgumentNullException(nameof(matchLocationCacheClearer)); + _breadcrumbBuilder = breadcrumbBuilder ?? throw new ArgumentNullException(nameof(breadcrumbBuilder)); } [HttpPost] @@ -103,12 +106,7 @@ public async Task UpdateTeam([Bind("TeamName", "TeamType", "AgeRa model.Authorization.CurrentMemberIsAuthorized = isAuthorized; model.Metadata.PageTitle = $"Edit {team.TeamName}"; - model.Breadcrumbs.Add(new Breadcrumb { Name = Constants.Pages.Teams, Url = new Uri(Constants.Pages.TeamsUrl, UriKind.Relative) }); - if (model.Team.Club != null) - { - model.Breadcrumbs.Add(new Breadcrumb { Name = model.Team.Club.ClubName, Url = new Uri(model.Team.Club.ClubRoute, UriKind.Relative) }); - } - model.Breadcrumbs.Add(new Breadcrumb { Name = model.Team.TeamName, Url = new Uri(model.Team.TeamRoute, UriKind.Relative) }); + _breadcrumbBuilder.BuildBreadcrumbs(model.Breadcrumbs, model.Team, true); return View("EditTeam", model); } diff --git a/Stoolball.Web/Teams/EditTransientTeamController.cs b/Stoolball.Web/Teams/EditTransientTeamController.cs index 265a1e2c7..94a785f92 100644 --- a/Stoolball.Web/Teams/EditTransientTeamController.cs +++ b/Stoolball.Web/Teams/EditTransientTeamController.cs @@ -8,10 +8,10 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Stoolball.Web.Teams.Models; diff --git a/Stoolball.Web/Teams/EditTransientTeamSurfaceController.cs b/Stoolball.Web/Teams/EditTransientTeamSurfaceController.cs index 171d27b11..e12bccfd4 100644 --- a/Stoolball.Web/Teams/EditTransientTeamSurfaceController.cs +++ b/Stoolball.Web/Teams/EditTransientTeamSurfaceController.cs @@ -6,10 +6,10 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Security; using Stoolball.Web.Teams.Models; using Umbraco.Cms.Core.Cache; diff --git a/Stoolball.Web/Teams/MatchesForTeamController.cs b/Stoolball.Web/Teams/MatchesForTeamController.cs index 55abc758d..2be341c15 100644 --- a/Stoolball.Web/Teams/MatchesForTeamController.cs +++ b/Stoolball.Web/Teams/MatchesForTeamController.cs @@ -8,11 +8,11 @@ using Stoolball.Data.Abstractions; using Stoolball.Dates; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; using Stoolball.Web.Matches; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Stoolball.Web.Teams.Models; @@ -32,6 +32,7 @@ public class MatchesForTeamController : RenderController, IRenderControllerAsync private readonly IMatchFilterQueryStringParser _matchFilterQueryStringParser; private readonly IMatchFilterHumanizer _matchFilterHumanizer; private readonly IAddMatchMenuViewModelFactory _addMatchMenuViewModelFactory; + private readonly ITeamBreadcrumbBuilder _breadcrumbBuilder; public MatchesForTeamController(ILogger logger, ICompositeViewEngine compositeViewEngine, @@ -44,7 +45,8 @@ public MatchesForTeamController(ILogger logger, IAuthorizationPolicy authorizationPolicy, IMatchFilterQueryStringParser matchFilterQueryStringParser, IMatchFilterHumanizer matchFilterHumanizer, - IAddMatchMenuViewModelFactory addMatchMenuViewModelFactory) + IAddMatchMenuViewModelFactory addMatchMenuViewModelFactory, + ITeamBreadcrumbBuilder breadcrumbBuilder) : base(logger, compositeViewEngine, umbracoContextAccessor) { _teamDataSource = teamDataSource ?? throw new ArgumentNullException(nameof(teamDataSource)); @@ -56,6 +58,7 @@ public MatchesForTeamController(ILogger logger, _matchFilterQueryStringParser = matchFilterQueryStringParser ?? throw new ArgumentNullException(nameof(matchFilterQueryStringParser)); _matchFilterHumanizer = matchFilterHumanizer ?? throw new ArgumentNullException(nameof(matchFilterHumanizer)); _addMatchMenuViewModelFactory = addMatchMenuViewModelFactory ?? throw new ArgumentNullException(nameof(addMatchMenuViewModelFactory)); + _breadcrumbBuilder = breadcrumbBuilder ?? throw new ArgumentNullException(nameof(breadcrumbBuilder)); } [HttpGet] @@ -94,11 +97,7 @@ public MatchesForTeamController(ILogger logger, } model.Metadata.PageTitle = $"{_matchFilterHumanizer.MatchesAndTournaments(model.AppliedMatchFilter)} for {model.Team.TeamName} stoolball team{userFilter}"; - model.Breadcrumbs.Add(new Breadcrumb { Name = Constants.Pages.Teams, Url = new Uri(Constants.Pages.TeamsUrl, UriKind.Relative) }); - if (model.Team.Club != null) - { - model.Breadcrumbs.Add(new Breadcrumb { Name = model.Team.Club.ClubName, Url = new Uri(model.Team.Club.ClubRoute, UriKind.Relative) }); - } + _breadcrumbBuilder.BuildBreadcrumbs(model.Breadcrumbs, model.Team, false); return CurrentTemplate(model); } diff --git a/Stoolball.Web/Teams/PlayersForTeamController.cs b/Stoolball.Web/Teams/PlayersForTeamController.cs index 95de06883..4978ed24b 100644 --- a/Stoolball.Web/Teams/PlayersForTeamController.cs +++ b/Stoolball.Web/Teams/PlayersForTeamController.cs @@ -6,10 +6,10 @@ using Microsoft.AspNetCore.Mvc.ViewEngines; using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Statistics; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Stoolball.Web.Teams.Models; @@ -23,18 +23,21 @@ public class PlayersForTeamController : RenderController, IRenderControllerAsync private readonly ITeamDataSource _teamDataSource; private readonly IAuthorizationPolicy _authorizationPolicy; private readonly IPlayerDataSource _playerDataSource; + private readonly ITeamBreadcrumbBuilder _breadcrumbBuilder; public PlayersForTeamController(ILogger logger, ICompositeViewEngine compositeViewEngine, IUmbracoContextAccessor umbracoContextAccessor, ITeamDataSource teamDataSource, IAuthorizationPolicy authorizationPolicy, - IPlayerDataSource playerDataSource) + IPlayerDataSource playerDataSource, + ITeamBreadcrumbBuilder breadcrumbBuilder) : base(logger, compositeViewEngine, umbracoContextAccessor) { _teamDataSource = teamDataSource ?? throw new ArgumentNullException(nameof(teamDataSource)); _authorizationPolicy = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy)); _playerDataSource = playerDataSource ?? throw new ArgumentNullException(nameof(playerDataSource)); + _breadcrumbBuilder = breadcrumbBuilder ?? throw new ArgumentNullException(nameof(breadcrumbBuilder)); } [HttpGet] @@ -60,11 +63,7 @@ public PlayersForTeamController(ILogger logger, model.Metadata.PageTitle = "Players for " + model.Team.TeamName + " stoolball team"; model.Metadata.Description = model.Team.Description(); - model.Breadcrumbs.Add(new Breadcrumb { Name = Constants.Pages.Teams, Url = new Uri(Constants.Pages.TeamsUrl, UriKind.Relative) }); - if (model.Team.Club != null) - { - model.Breadcrumbs.Add(new Breadcrumb { Name = model.Team.Club.ClubName, Url = new Uri(model.Team.Club.ClubRoute!, UriKind.Relative) }); - } + _breadcrumbBuilder.BuildBreadcrumbs(model.Breadcrumbs, model.Team, false); return CurrentTemplate(model); } diff --git a/Stoolball.Web/Teams/TeamActionsController.cs b/Stoolball.Web/Teams/TeamActionsController.cs index a5d8d9ddb..42cc89350 100644 --- a/Stoolball.Web/Teams/TeamActionsController.cs +++ b/Stoolball.Web/Teams/TeamActionsController.cs @@ -4,9 +4,9 @@ using Microsoft.AspNetCore.Mvc.ViewEngines; using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Stoolball.Web.Teams.Models; @@ -19,16 +19,19 @@ public class TeamActionsController : RenderController, IRenderControllerAsync { private readonly ITeamDataSource _teamDataSource; private readonly IAuthorizationPolicy _authorizationPolicy; + private readonly ITeamBreadcrumbBuilder _breadcrumbBuilder; public TeamActionsController(ILogger logger, ICompositeViewEngine compositeViewEngine, IUmbracoContextAccessor umbracoContextAccessor, ITeamDataSource teamDataSource, - IAuthorizationPolicy authorizationPolicy) + IAuthorizationPolicy authorizationPolicy, + ITeamBreadcrumbBuilder breadcrumbBuilder) : base(logger, compositeViewEngine, umbracoContextAccessor) { _teamDataSource = teamDataSource ?? throw new ArgumentNullException(nameof(teamDataSource)); _authorizationPolicy = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy)); + _breadcrumbBuilder = breadcrumbBuilder ?? throw new ArgumentNullException(nameof(breadcrumbBuilder)); } [HttpGet] @@ -53,12 +56,7 @@ public TeamActionsController(ILogger logger, model.Metadata.PageTitle = "Edit " + model.Team.TeamName; - model.Breadcrumbs.Add(new Breadcrumb { Name = Constants.Pages.Teams, Url = new Uri(Constants.Pages.TeamsUrl, UriKind.Relative) }); - if (model.Team.Club != null) - { - model.Breadcrumbs.Add(new Breadcrumb { Name = model.Team.Club.ClubName, Url = new Uri(model.Team.Club.ClubRoute!, UriKind.Relative) }); - } - model.Breadcrumbs.Add(new Breadcrumb { Name = model.Team.TeamName, Url = new Uri(model.Team.TeamRoute!, UriKind.Relative) }); + _breadcrumbBuilder.BuildBreadcrumbs(model.Breadcrumbs, model.Team, true); return CurrentTemplate(model); } diff --git a/Stoolball.Web/Teams/TeamController.cs b/Stoolball.Web/Teams/TeamController.cs index 40007a0a3..1053a5455 100644 --- a/Stoolball.Web/Teams/TeamController.cs +++ b/Stoolball.Web/Teams/TeamController.cs @@ -5,9 +5,9 @@ using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; using Stoolball.Email; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Stoolball.Web.Teams.Models; @@ -21,18 +21,21 @@ public class TeamController : RenderController, IRenderControllerAsync private readonly ITeamDataSource _teamDataSource; private readonly IAuthorizationPolicy _authorizationPolicy; private readonly IEmailProtector _emailProtector; + private readonly ITeamBreadcrumbBuilder _breadcrumbBuilder; public TeamController(ILogger logger, ICompositeViewEngine compositeViewEngine, IUmbracoContextAccessor umbracoContextAccessor, ITeamDataSource teamDataSource, IAuthorizationPolicy authorizationPolicy, - IEmailProtector emailProtector) + IEmailProtector emailProtector, + ITeamBreadcrumbBuilder breadcrumbBuilder) : base(logger, compositeViewEngine, umbracoContextAccessor) { - _teamDataSource = teamDataSource ?? throw new System.ArgumentNullException(nameof(teamDataSource)); - _authorizationPolicy = authorizationPolicy ?? throw new System.ArgumentNullException(nameof(authorizationPolicy)); - _emailProtector = emailProtector ?? throw new System.ArgumentNullException(nameof(emailProtector)); + _teamDataSource = teamDataSource ?? throw new ArgumentNullException(nameof(teamDataSource)); + _authorizationPolicy = authorizationPolicy ?? throw new ArgumentNullException(nameof(authorizationPolicy)); + _emailProtector = emailProtector ?? throw new ArgumentNullException(nameof(emailProtector)); + _breadcrumbBuilder = breadcrumbBuilder ?? throw new ArgumentNullException(nameof(breadcrumbBuilder)); } [HttpGet] @@ -60,11 +63,7 @@ public TeamController(ILogger logger, model.Team.PlayingTimes = _emailProtector.ProtectEmailAddresses(model.Team.PlayingTimes, User.Identity?.IsAuthenticated ?? false); model.Team.PublicContactDetails = _emailProtector.ProtectEmailAddresses(model.Team.PublicContactDetails, User.Identity?.IsAuthenticated ?? false); - model.Breadcrumbs.Add(new Breadcrumb { Name = Constants.Pages.Teams, Url = new Uri(Constants.Pages.TeamsUrl, UriKind.Relative) }); - if (model.Team.Club != null) - { - model.Breadcrumbs.Add(new Breadcrumb { Name = model.Team.Club.ClubName, Url = new Uri(model.Team.Club.ClubRoute, UriKind.Relative) }); - } + _breadcrumbBuilder.BuildBreadcrumbs(model.Breadcrumbs, model.Team, false); return CurrentTemplate(model); } diff --git a/Stoolball.Web/Teams/TeamStatisticsController.cs b/Stoolball.Web/Teams/TeamStatisticsController.cs index 0b3666eee..fa4cb9291 100644 --- a/Stoolball.Web/Teams/TeamStatisticsController.cs +++ b/Stoolball.Web/Teams/TeamStatisticsController.cs @@ -5,9 +5,9 @@ using Microsoft.AspNetCore.Mvc.ViewEngines; using Microsoft.Extensions.Logging; using Stoolball.Data.Abstractions; -using Stoolball.Navigation; using Stoolball.Statistics; using Stoolball.Teams; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Stoolball.Web.Statistics.Models; @@ -24,6 +24,7 @@ public class TeamStatisticsController : RenderController, IRenderControllerAsync private readonly IBestPlayerTotalStatisticsDataSource _bestPlayerTotalDataSource; private readonly IStatisticsFilterQueryStringParser _statisticsFilterQueryStringParser; private readonly IStatisticsFilterHumanizer _statisticsFilterHumanizer; + private readonly ITeamBreadcrumbBuilder _breadcrumbBuilder; public TeamStatisticsController(ILogger logger, ICompositeViewEngine compositeViewEngine, @@ -33,7 +34,8 @@ public TeamStatisticsController(ILogger logger, IInningsStatisticsDataSource inningsStatisticsDataSource, IBestPlayerTotalStatisticsDataSource bestPlayerTotalDataSource, IStatisticsFilterQueryStringParser statisticsFilterQueryStringParser, - IStatisticsFilterHumanizer statisticsFilterHumanizer) + IStatisticsFilterHumanizer statisticsFilterHumanizer, + ITeamBreadcrumbBuilder breadcrumbBuilder) : base(logger, compositeViewEngine, umbracoContextAccessor) { _teamDataSource = teamDataSource ?? throw new ArgumentNullException(nameof(teamDataSource)); @@ -42,6 +44,7 @@ public TeamStatisticsController(ILogger logger, _bestPlayerTotalDataSource = bestPlayerTotalDataSource ?? throw new ArgumentNullException(nameof(bestPlayerTotalDataSource)); _statisticsFilterQueryStringParser = statisticsFilterQueryStringParser ?? throw new ArgumentNullException(nameof(statisticsFilterQueryStringParser)); _statisticsFilterHumanizer = statisticsFilterHumanizer ?? throw new ArgumentNullException(nameof(statisticsFilterHumanizer)); + _breadcrumbBuilder = breadcrumbBuilder ?? throw new ArgumentNullException(nameof(breadcrumbBuilder)); } [HttpGet] @@ -71,11 +74,7 @@ public TeamStatisticsController(ILogger logger, model.MostWickets = (await _bestPlayerTotalDataSource.ReadMostWickets(model.AppliedFilter)).ToList(); model.MostCatches = (await _bestPlayerTotalDataSource.ReadMostCatches(model.AppliedFilter)).ToList(); - model.Breadcrumbs.Add(new Breadcrumb { Name = Constants.Pages.Teams, Url = new Uri(Constants.Pages.TeamsUrl, UriKind.Relative) }); - if (model.Context.Club != null) - { - model.Breadcrumbs.Add(new Breadcrumb { Name = model.Context.Club.ClubName, Url = new Uri(model.Context.Club.ClubRoute!, UriKind.Relative) }); - } + _breadcrumbBuilder.BuildBreadcrumbs(model.Breadcrumbs, model.Context, false); var appliedFilterWithoutDefaultFilter = model.AppliedFilter.Clone(); appliedFilterWithoutDefaultFilter.Team = null; diff --git a/Stoolball.Web/Teams/TransientTeamController.cs b/Stoolball.Web/Teams/TransientTeamController.cs index e7fc90fab..a9e0d9645 100644 --- a/Stoolball.Web/Teams/TransientTeamController.cs +++ b/Stoolball.Web/Teams/TransientTeamController.cs @@ -9,10 +9,10 @@ using Stoolball.Dates; using Stoolball.Email; using Stoolball.Matches; -using Stoolball.Navigation; using Stoolball.Security; using Stoolball.Teams; using Stoolball.Web.Matches.Models; +using Stoolball.Web.Navigation; using Stoolball.Web.Routing; using Stoolball.Web.Security; using Stoolball.Web.Teams.Models; diff --git a/Stoolball.Web/Views/Master.cshtml b/Stoolball.Web/Views/Master.cshtml index a4f24dc6e..c9cee86f6 100644 --- a/Stoolball.Web/Views/Master.cshtml +++ b/Stoolball.Web/Views/Master.cshtml @@ -2,7 +2,7 @@ @inject IHostEnvironment environment @using Microsoft.Extensions.Hosting @using Smidge.Models -@using Stoolball.Navigation +@using Stoolball.Web.Navigation @{ Layout = null; SmidgeHelper.RequiresCss(new CssFile("~/css/base.min.css") { Order = 1 }); diff --git a/Stoolball.Web/Views/Partials/_Breadcrumb.cshtml b/Stoolball.Web/Views/Partials/_Breadcrumb.cshtml index a7e9b8f3f..c4132e664 100644 --- a/Stoolball.Web/Views/Partials/_Breadcrumb.cshtml +++ b/Stoolball.Web/Views/Partials/_Breadcrumb.cshtml @@ -1,5 +1,5 @@ @model List -@using Stoolball.Navigation; +@using Stoolball.Web.Navigation @if (Model != null && Model.Count > 1) {