diff --git a/League/Configuration/Tenant.A-Beach.Development.config b/League/Configuration/Tenant.A-Beach.Development.config deleted file mode 100644 index 3ab759db..00000000 --- a/League/Configuration/Tenant.A-Beach.Development.config +++ /dev/null @@ -1,105 +0,0 @@ - - - a-beach - BF2E2412-C610-4521-AE20-7BDA286E3380 - false - - - - - a-beach - - a-beach - .LeagueABeach - .LeagueABeach - false - - teamphoto - personphoto - - - - - Beachrunde Augsburg -
a-beach@volleyball-liga.de
-
- - Beachrunde Augsburg -
a-beach@volleyball-liga.de
-
- - Beachrunde Augsburg -
a-beach@volleyball-liga.de
-
- - Beachrunde Augsburg -
a-beach@volleyball-liga.de
-
- - Beachrunde Augsburg -
a-beach@volleyball-liga.de
-
-
-
- - ABeachConnectionString - a-beach - dbo - 15 - - - Beachvolleyballrunde Augsburg - Beachrunde Augsburg - Die Beachvolleyballrunde Augsburg ist eine Liga für gemischte Teams mit zwei oder vier SpielerInnen. Es wird auf Sand gespielt. - https://volleyball-liga.de/a-beach - - true - axuno - Beachrunde Augsburg - Fidor Bank AG - FDDODEMMXXX - DE61 700 222 000 020 137 800 - 19.00 - EUR - - - - 3 - false - 2018-05-04T00:00:00 - 3 - - 3 - 3 - 3 - - - 18:00:00 - 21:00:00 - - 00:02:00:00 - true - true - true - false - true - - - -1 - - - True - True - - Monday - Tuesday - Wednesday - Thursday - Friday - Saturday - Sunday - - False - - - -
\ No newline at end of file diff --git a/League/Configuration/Tenant.A-Beach.Production.config b/League/Configuration/Tenant.A-Beach.Production.config deleted file mode 100644 index 269835ea..00000000 --- a/League/Configuration/Tenant.A-Beach.Production.config +++ /dev/null @@ -1,105 +0,0 @@ - - - a-beach - BF2E2412-C610-4521-AE20-7BDA286E3380 - false - - - - - a-beach - - a-beach - .LeagueABeach - .LeagueABeach - false - - teamphoto - personphoto - - - - - Beachrunde Augsburg -
a-beach@volleyball-liga.de
-
- - Beachrunde Augsburg -
a-beach@volleyball-liga.de
-
- - Beachrunde Augsburg -
a-beach@volleyball-liga.de
-
- - Beachrunde Augsburg -
a-beach@volleyball-liga.de
-
- - Beachrunde Augsburg -
a-beach@volleyball-liga.de
-
-
-
- - leagueConnectionString - a-beach - dbo - 15 - - - Beachvolleyballrunde Augsburg - Beachrunde Augsburg - Die Beachvolleyballrunde Augsburg ist eine Liga für gemischte Teams mit zwei oder vier SpielerInnen. Es wird auf Sand gespielt. - https://volleyball-liga.de/a-beach - - true - axuno - Beachrunde Augsburg - Fidor Bank AG - FDDODEMMXXX - DE61 700 222 000 020 137 800 - 19.00 - EUR - - - - 3 - false - 2018-05-04T00:00:00 - 3 - - 3 - 3 - 3 - - - 18:00:00 - 21:00:00 - - 00:02:00:00 - true - true - true - false - true - - - -1 - - - True - True - - Monday - Tuesday - Wednesday - Thursday - Friday - Saturday - Sunday - - False - - - -
\ No newline at end of file diff --git a/League/Configuration/Tenant.A-Indoor.Development.config b/League/Configuration/Tenant.A-Indoor.Development.config deleted file mode 100644 index 35ae7572..00000000 --- a/League/Configuration/Tenant.A-Indoor.Development.config +++ /dev/null @@ -1,105 +0,0 @@ - - - a-indoor - BF2E2412-C610-4521-AE20-7BDA286E4480 - false - - - - - augsburg - - a-indoor - .LeagueAugsburg - .LeagueAugsburg - false - - teamphoto - personphoto - - - - - Mixedliga Augsburg -
a-indoor@volleyball-liga.de
-
- - Mixedliga Augsburg -
a-indoor@volleyball-liga.de
-
- - Mixedliga Augsburg -
a-indoor@volleyball-liga.de
-
- - Mixedliga Augsburg -
a-indoor@volleyball-liga.de
-
- - Mixedliga Augsburg -
a-indoor@volleyball-liga.de
-
-
-
- - AIndoorConnectionString - a-indoor - dbo - 15 - - - Volleyball-Mixedliga Augsburg - Mixedliga Augsburg - Die Volleyball-Mixedliga Augsburg ist eine Hallenliga für gemischte Teams aus dem Großraum Augsburg. Sie besteht seit über 20 Jahren. - https://volleyball-liga.de/augsburg - - true - axuno - Mixedliga Augsburg - Fidor Bank AG - FDDODEMMXXX - DE61 700 222 000 020 137 800 - 40.00 - EUR - - - - 23 - false - 2020-09-30T00:00:00 - 23 - - 23 - 23 - 23 - - - 18:00:00 - 21:00:00 - - 00:02:00:00 - true - true - true - false - true - - - -1 - - - True - True - - Monday - Tuesday - Wednesday - Thursday - Friday - Saturday - Sunday - - False - - - -
\ No newline at end of file diff --git a/League/Configuration/Tenant.Default.Development.config b/League/Configuration/Tenant.Default.Development.config index 6b370e7c..f99eda43 100644 --- a/League/Configuration/Tenant.Default.Development.config +++ b/League/Configuration/Tenant.Default.Development.config @@ -55,14 +55,14 @@ Fidor Bank AG FDDODEMMXXX DE61 700 222 000 020 137 800 - 19.00 + 0.00 EUR 0 true - 2020-05-04T00:00:00 + 2021-01-01T00:00:00 0 0 diff --git a/League/Configuration/Tenant.A-Indoor.Production.config b/League/Configuration/Tenant.Default.Production.config similarity index 59% rename from League/Configuration/Tenant.A-Indoor.Production.config rename to League/Configuration/Tenant.Default.Production.config index 2553363a..2187d940 100644 --- a/League/Configuration/Tenant.A-Indoor.Production.config +++ b/League/Configuration/Tenant.Default.Production.config @@ -1,43 +1,40 @@  - a-indoor - BF2E2412-C610-4521-AE20-7BDA286E4480 - false - - - - - augsburg + League + BF2E2412-C610-4521-AE15-7BDA286E4480 + true + + + - a-indoor - .LeagueAugsburg - .LeagueAugsburg - false + + .League + .League + true teamphoto personphoto - - Mixedliga Augsburg -
a-indoor@volleyball-liga.de
+ Volleyball-Liga +
league@volleyball-liga.de
- Mixedliga Augsburg -
a-indoor@volleyball-liga.de
+ Volleyball-Liga +
league@volleyball-liga.de
- Mixedliga Augsburg -
a-indoor@volleyball-liga.de
+ Volleyball-Liga +
league@volleyball-liga.de
- Mixedliga Augsburg -
a-indoor@volleyball-liga.de
+ Volleyball-Liga +
league@volleyball-liga.de
- Mixedliga Augsburg -
a-indoor@volleyball-liga.de
+ Volleyball-Liga +
league@volleyball-liga.de
@@ -48,29 +45,29 @@ 15 - Volleyball-Mixedliga Augsburg - Mixedliga Augsburg - Die Volleyball-Mixedliga Augsburg ist eine Hallenliga für gemischte Teams aus dem Großraum Augsburg. Sie besteht seit über 20 Jahren. - https://volleyball-liga.de/augsburg + volleyball-liga.de + volleyball-liga.de + + https://volleyball-liga.de/ true - axuno - Mixedliga Augsburg + axuno gemeinnuetzige GmbH - Testorganization Augsburg Fidor Bank AG FDDODEMMXXX DE61 700 222 000 020 137 800 - 40.00 + 0.00 EUR - 23 - false - 2020-09-30T00:00:00 - 23 + 0 + true + 2021-01-01T00:00:00 + 0 - 23 - 23 - 23 + 0 + 0 + 0 18:00:00 diff --git a/League/League.csproj b/League/League.csproj index ccd18966..96718c00 100644 --- a/League/League.csproj +++ b/League/League.csproj @@ -63,6 +63,7 @@ + @@ -74,10 +75,7 @@ - - - - + diff --git a/League/Navigation/HomeNavigationTreeBuilder.cs b/League/Navigation/HomeNavigationTreeBuilder.cs index 75f637d3..b8c8e435 100644 --- a/League/Navigation/HomeNavigationTreeBuilder.cs +++ b/League/Navigation/HomeNavigationTreeBuilder.cs @@ -35,7 +35,7 @@ public Task> BuildTree(NavigationTreeBuilderService ser } else { - topNode = new NavigationNode { Text = string.Empty, Url = _tenantContext.SiteContext.UrlSegmentValue, IconCssClass = "fas fa-1x fa-home", Key = "Home"}; + topNode = new NavigationNode { Text = string.Empty, Url = "/" + _tenantContext.SiteContext.UrlSegmentValue, IconCssClass = "fas fa-1x fa-home", Key = "Home"}; } var treeNode = new TreeNode(topNode); diff --git a/League/Program.cs b/League/Program.cs index 10c5448d..691b5cad 100644 --- a/League/Program.cs +++ b/League/Program.cs @@ -17,6 +17,8 @@ public class Program /// public const string ConfigurationFolder = "Configuration"; + private static string _absoluteConfigurationPath = string.Empty; + public static void Main(string[] args) { // NLog: setup the logger first to catch all errors @@ -49,24 +51,23 @@ public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureAppConfiguration((hostingContext, config) => { - var configPath = Path.Combine(hostingContext.HostingEnvironment.ContentRootPath, ConfigurationFolder); - config.SetBasePath(configPath) + _absoluteConfigurationPath = Path.Combine(hostingContext.HostingEnvironment.ContentRootPath, ConfigurationFolder); + config.SetBasePath(_absoluteConfigurationPath) .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .AddJsonFile($"appsettings.{hostingContext.HostingEnvironment.EnvironmentName}.json", optional: true, reloadOnChange: true) .AddJsonFile(@"credentials.json", optional: false, reloadOnChange: true) .AddJsonFile($"credentials.{hostingContext.HostingEnvironment.EnvironmentName}.json", optional: false, reloadOnChange: true) .AddEnvironmentVariables() .AddCommandLine(args); - - var secretsFolder = Path.Combine(configPath, @"..\..\..\Secrets"); + if (hostingContext.HostingEnvironment.IsDevelopment()) { - if (!Directory.Exists(secretsFolder)) throw new DirectoryNotFoundException("Secrets folder not found"); + var secretsFolder = GetSecretsFolder(); config.AddJsonFile(Path.Combine(secretsFolder, @"credentials.json"), false); config.AddJsonFile(Path.Combine(secretsFolder, $"credentials.{hostingContext.HostingEnvironment.EnvironmentName}.json"), false); } - NLogBuilder.ConfigureNLog(Path.Combine(configPath, $"NLog.{hostingContext.HostingEnvironment.EnvironmentName}.config")); + NLogBuilder.ConfigureNLog(Path.Combine(_absoluteConfigurationPath, $"NLog.{hostingContext.HostingEnvironment.EnvironmentName}.config")); }) .ConfigureWebHostDefaults(webHostBuilder => { @@ -79,5 +80,19 @@ public static IHostBuilder CreateHostBuilder(string[] args) => logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); }) .UseNLog(); // NLog: Setup NLog for dependency injection; + + + /// + /// Gets the name of the folder containing credentials and other data of the live website. + /// + /// The name of the folder containing credentials and other data of the live website + /// + public static string GetSecretsFolder() + { + var folder = Path.Combine(_absoluteConfigurationPath, @"..\..\..\Secrets"); + if (!Directory.Exists(folder)) throw new DirectoryNotFoundException("Secrets folder not found"); + return folder; + } } + } diff --git a/League/Startup.cs b/League/Startup.cs index 023f6d6e..9e0b6582 100644 --- a/League/Startup.cs +++ b/League/Startup.cs @@ -42,10 +42,8 @@ using System.Threading.Tasks; using Axuno.BackgroundTask; using League.BackgroundTasks; -using TournamentManager.Data; using League.BackgroundTasks.Email; using League.ConfigurationPoco; -using League.MultiTenancy; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Rewrite; using TournamentManager.DI; @@ -165,15 +163,27 @@ public void ConfigureServices(IServiceCollection services) // DO NOT USE `options => options.ResourcesPath = "..."` because then resource files in other locations won't be recognized (e.g. resx in the same folder as the controller class) services.AddLocalization(); - #region **** New Multi Tenancy (new in v4.3.0) ***************************** + #region **** New Multi Tenancy (since v4.3.0) ***************************** services.AddSingleton(sp => { var store = (TenantStore) new TenantStore(Configuration, sp.GetRequiredService>()) { GetTenantConfigurationFiles = () => - Directory.GetFiles(Path.Combine(WebHostEnvironment.ContentRootPath, Program.ConfigurationFolder), - $"Tenant.*.{WebHostEnvironment.EnvironmentName}.config", SearchOption.TopDirectoryOnly) + { + var configFolderFiles = Directory.GetFiles( + Path.Combine(WebHostEnvironment.ContentRootPath, Program.ConfigurationFolder), + $"Tenant.*.{WebHostEnvironment.EnvironmentName}.config", SearchOption.TopDirectoryOnly).ToList(); + + if (WebHostEnvironment.IsDevelopment()) + { + configFolderFiles.AddRange(Directory.GetFiles( + Path.Combine(Program.GetSecretsFolder()), + $"Tenant.*.{WebHostEnvironment.EnvironmentName}.config", SearchOption.TopDirectoryOnly)); + } + + return configFolderFiles.ToArray(); + } }.LoadTenants(); ConfigureLlblgenPro(store); return store; diff --git a/League/Views/Account/ConfirmEmailError.cshtml b/League/Views/Account/ConfirmEmailError.cshtml index f1fa86c1..7e985aa4 100644 --- a/League/Views/Account/ConfirmEmailError.cshtml +++ b/League/Views/Account/ConfirmEmailError.cshtml @@ -4,7 +4,7 @@ @inject ITenantContext TenantContext @{ ViewData["Title"] = Localizer["Your email could not be confirmed"].Value; - var organizationRoute = TenantContext.SiteContext.UrlSegmentValue; + var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue; }

@ViewData["Title"].


@@ -20,6 +20,6 @@ @Localizer["Please consider to create an account again. Then, another confirmation email will be sent to you."]

- @Localizer["Create Account"] + @Localizer["Create Account"]

diff --git a/League/Views/Account/CreateAccount.cshtml b/League/Views/Account/CreateAccount.cshtml index 08145813..484052dc 100644 --- a/League/Views/Account/CreateAccount.cshtml +++ b/League/Views/Account/CreateAccount.cshtml @@ -8,7 +8,7 @@ @inject ITenantContext TenantContext @{ ViewData["Title"] = Localizer["Create a new user account"]; - var organizationRoute = TenantContext.SiteContext.UrlSegmentValue; + var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue; }

@ViewData["Title"]

@@ -22,7 +22,7 @@ if (loginProviders.Count != 0) {

@Localizer["Register with a social network account"]

-
+
@foreach (var provider in loginProviders) { @@ -41,7 +41,7 @@ @Localizer["We will send you a message containing the confirmation code to your email address."]
@Localizer["Once your email is confirmed, you can finalize the registration."]

- + @Localizer["Input has some issues"]: diff --git a/League/Views/Account/ExternalSignInConfirmation.cshtml b/League/Views/Account/ExternalSignInConfirmation.cshtml index 8fb8a690..9b35231e 100644 --- a/League/Views/Account/ExternalSignInConfirmation.cshtml +++ b/League/Views/Account/ExternalSignInConfirmation.cshtml @@ -6,7 +6,7 @@ @model ExternalSignConfirmationViewModel @{ ViewData["Title"] = Localizer["Associate social network account"]; - var organizationRoute = TenantContext.SiteContext.UrlSegmentValue; + var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue; List GenderList() { return new List {new SelectListItem {Value = string.Empty, Text = Localizer["Please choose"].Value}, @@ -16,7 +16,7 @@ }

@(Localizer.GetHtml("Associate your {0} account", ViewData["LoginProvider"])).


- + @(Localizer.GetHtml("You have successfully authenticated with {0}", ViewData["LoginProvider"])). diff --git a/League/Views/Account/ExternalSignInFailure.cshtml b/League/Views/Account/ExternalSignInFailure.cshtml index 2a2425f7..6428f3ae 100644 --- a/League/Views/Account/ExternalSignInFailure.cshtml +++ b/League/Views/Account/ExternalSignInFailure.cshtml @@ -3,7 +3,7 @@ @inject IViewLocalizer Localizer @inject ITenantContext TenantContext @{ ViewData["Title"] = Localizer["Sign-in with the social network account failed"]; - var organizationRoute = TenantContext.SiteContext.UrlSegmentValue; } + var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue; }

@ViewData["Title"].


@@ -12,6 +12,6 @@ @(Localizer["Please try to sign-in later, or use another account"]).

- @Localizer["Sign in"] + @Localizer["Sign in"]

diff --git a/League/Views/Account/ForgotPassword.cshtml b/League/Views/Account/ForgotPassword.cshtml index ae093f59..31ce9ee7 100644 --- a/League/Views/Account/ForgotPassword.cshtml +++ b/League/Views/Account/ForgotPassword.cshtml @@ -6,11 +6,11 @@ @model ForgotPasswordViewModel @{ ViewData["Title"] = Localizer["Forgot your password?"]; - var organizationRoute = TenantContext.SiteContext.UrlSegmentValue; + var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue; }

@(ViewData["Title"])


- +

@(Localizer["Please enter the primary email address or the username of your account. We will send and email with a code to reset the password to this email address."])

diff --git a/League/Views/Account/Register.cshtml b/League/Views/Account/Register.cshtml index 4c9c0e6f..05b77894 100644 --- a/League/Views/Account/Register.cshtml +++ b/League/Views/Account/Register.cshtml @@ -6,7 +6,7 @@ @inject ITenantContext TenantContext @{ ViewData["Title"] = Localizer["Create a new user account"]; - var organizationRoute = TenantContext.SiteContext.UrlSegmentValue; + var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue; List GenderList() { return new List {new SelectListItem {Value = string.Empty, Text = Localizer["Please choose"].Value}, @@ -19,7 +19,7 @@
- + @Localizer["Input has some issues"]: diff --git a/League/Views/Account/ResetPassword.cshtml b/League/Views/Account/ResetPassword.cshtml index 241f0859..6ccc117c 100644 --- a/League/Views/Account/ResetPassword.cshtml +++ b/League/Views/Account/ResetPassword.cshtml @@ -6,12 +6,12 @@ @model ResetPasswordViewModel @{ ViewData["Title"] = Localizer["Reset password"]; - var organizationRoute = TenantContext.SiteContext.UrlSegmentValue; + var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue; }

@ViewData["Title"]


- + @Localizer["Input has some issues"]: diff --git a/League/Views/Account/ResetPasswordConfirmation.cshtml b/League/Views/Account/ResetPasswordConfirmation.cshtml index 5637217f..c4c4e733 100644 --- a/League/Views/Account/ResetPasswordConfirmation.cshtml +++ b/League/Views/Account/ResetPasswordConfirmation.cshtml @@ -3,7 +3,7 @@ @inject IViewLocalizer Localizer @inject ITenantContext TenantContext @{ ViewData["Title"] = Localizer["New Password Confirmation"].Value; - var organizationRoute = TenantContext.SiteContext.UrlSegmentValue; } + var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue; }

@ViewData["Title"].


@@ -11,6 +11,6 @@ @Localizer["The new password is saved and activated"].

- @Localizer["Sign-in now"]. + @Localizer["Sign-in now"].

diff --git a/League/Views/Account/SignIn.cshtml b/League/Views/Account/SignIn.cshtml index ea72dfdc..53c6d2a7 100644 --- a/League/Views/Account/SignIn.cshtml +++ b/League/Views/Account/SignIn.cshtml @@ -8,7 +8,7 @@ @inject IViewLocalizer Localizer @{ ViewData["Title"] = Localizer["Sign in"]; - var organizationRoute = TenantContext.SiteContext.UrlSegmentValue; + var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue; }

@ViewData["Title"]

@{ @@ -19,7 +19,7 @@

@Localizer["Sign-in using a social network account"]

- + @if (ViewData["Form"]?.ToString() == "SocialMedia") { @@ -38,7 +38,7 @@

@Localizer["Sign-in with your user account credentials"]

- + @if (ViewData["Form"]?.ToString() != "SocialMedia") { @@ -80,10 +80,10 @@ diff --git a/League/Views/Account/SignInRejected.cshtml b/League/Views/Account/SignInRejected.cshtml index 045b5b99..8746f129 100644 --- a/League/Views/Account/SignInRejected.cshtml +++ b/League/Views/Account/SignInRejected.cshtml @@ -4,7 +4,7 @@ @inject ITenantContext TenantContext @model Microsoft.AspNetCore.Identity.SignInResult @{ - var organizationRoute = TenantContext.SiteContext.UrlSegmentValue; + var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue; if (Model == Microsoft.AspNetCore.Identity.SignInResult.LockedOut) { ViewData["Title"] = Localizer["Account has been locked out"]; @@ -25,6 +25,6 @@ @(Localizer["Please try to sign-in later"]).

- @Localizer["Sign in"] + @Localizer["Sign in"]

diff --git a/League/Views/Account/SignInRejectedEmailNotConfirmed.cshtml b/League/Views/Account/SignInRejectedEmailNotConfirmed.cshtml index a48601fd..f77ac659 100644 --- a/League/Views/Account/SignInRejectedEmailNotConfirmed.cshtml +++ b/League/Views/Account/SignInRejectedEmailNotConfirmed.cshtml @@ -4,7 +4,7 @@ @inject ITenantContext TenantContext @{ ViewData["Title"] = Localizer["Account is currently disabled"]; - var organizationRoute = TenantContext.SiteContext.UrlSegmentValue; + var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue; }

@ViewData["Title"].

@@ -12,6 +12,6 @@ @Localizer["Your account is currently disabled, because your email address has not been confirmed yet"]

- @Localizer["Sign in"] + @Localizer["Sign in"]

diff --git a/League/Views/Error/AccessDenied.cshtml b/League/Views/Error/AccessDenied.cshtml index 80d6fea4..ec5c3223 100644 --- a/League/Views/Error/AccessDenied.cshtml +++ b/League/Views/Error/AccessDenied.cshtml @@ -5,7 +5,7 @@ @{ ViewData["Title"] = Localizer["Access denied"]; var returnUrl = ViewData["ReturnUrl"]; - var organizationRoute = TenantContext.SiteContext.UrlSegmentValue; + var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue; }

@ViewData["Title"].

@@ -13,12 +13,12 @@ { @* Signed in, but account does not have enough privileges *@

@Localizer["Your user account is not permitted to access the requested page"]

-

@Localizer["Sign-in with another account"]

+

@Localizer["Sign-in with another account"]

} else { @* With Asp.Net Core Identity this will never show, because there is an immediate redirect to sign-in *@

@Localizer["You must be signed in to access the requested page"]

-

@Localizer["Sign-in now"]

+

@Localizer["Sign-in now"]

}
diff --git a/League/Views/LeagueViewLocationExpander.cs b/League/Views/LeagueViewLocationExpander.cs index df5346e7..dfa5f2cd 100644 --- a/League/Views/LeagueViewLocationExpander.cs +++ b/League/Views/LeagueViewLocationExpander.cs @@ -6,7 +6,7 @@ namespace League.Views { /// - /// Expands the default search path list by organization specific folders per HttpRequest. + /// Expands the default search path list by tenant-specific folders per HttpRequest. /// /// /// The ViewLocationExpander must be added to like so: @@ -16,7 +16,7 @@ namespace League.Views /// public class LeagueViewLocationExpander : IViewLocationExpander { - private readonly List _organizationSearchPaths = new List(); + private readonly List _tenantSearchPaths = new List(); public void PopulateValues(ViewLocationExpanderContext context) { @@ -26,10 +26,10 @@ public void PopulateValues(ViewLocationExpanderContext context) try { var tenantContext = (TournamentManager.MultiTenancy.ITenantContext)context.ActionContext.HttpContext.RequestServices.GetService(typeof(TournamentManager.MultiTenancy.ITenantContext)); - _organizationSearchPaths.Clear(); + _tenantSearchPaths.Clear(); if (!tenantContext.IsDefault) { - _organizationSearchPaths.AddRange(new[] + _tenantSearchPaths.AddRange(new[] { $"/Views/{{1}}/{tenantContext.SiteContext.FolderName}/{{0}}.cshtml", $"/Views/Emails/{tenantContext.SiteContext.FolderName}/{{0}}.cshtml", @@ -45,7 +45,7 @@ public void PopulateValues(ViewLocationExpanderContext context) public IEnumerable ExpandViewLocations(ViewLocationExpanderContext context, IEnumerable viewLocations) { - return _organizationSearchPaths.Union(viewLocations); // in order to replace all existing locations, leave "Union" away. + return _tenantSearchPaths.Union(viewLocations); // in order to replace all existing locations, leave "Union" away. } } } diff --git a/League/Views/Manage/Index.cshtml b/League/Views/Manage/Index.cshtml index c4cd9754..1f41808a 100644 --- a/League/Views/Manage/Index.cshtml +++ b/League/Views/Manage/Index.cshtml @@ -8,7 +8,7 @@ @model IndexViewModel @{ ViewData["Title"] = Localizer["Change account settings"]; - var organizationRoute = TenantContext.SiteContext.UrlSegmentValue; + var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue; }

@ViewData["Title"]

@@ -19,7 +19,7 @@
  • @(Metadata.GetDisplayName(nameof(ChangeUsernameViewModel.Username)))
  • @(User.Identity.Name)
  • -
  • +
  • @(Metadata.GetDisplayName(nameof(RegisterViewModel.Password)))
  • @@ -36,38 +36,38 @@
  • @if (Model.HasPassword) { - + } else { - + }
  • @Localizer["Personal Details"]
  • @Model.ApplicationUser.CompleteName
  • -
  • +
  • @(Metadata.GetDisplayName(nameof(ChangeEmailViewModel.Email)))
  • @Model.ApplicationUser.Email
  • -
  • +
  • @(Metadata.GetDisplayName(nameof(EditEmail2ViewModel.Email2)))
  • @(Model.ApplicationUser.Email2 ?? Localizer["[Not set]"].Value)
  • -
  • +
  • @(Metadata.GetDisplayName(nameof(EditPhoneViewModel.PhoneNumber)))
  • @Html.Raw(string.IsNullOrEmpty(Model.ApplicationUser.PhoneNumber) ? Localizer["[Not set]"].Value : Model.ApplicationUser.PhoneNumber)
  • -
  • +
  • @(Metadata.GetDisplayName(nameof(EditPhone2ViewModel.PhoneNumber2)))
  • @Html.Raw(string.IsNullOrEmpty(Model.ApplicationUser.PhoneNumber2) ? Localizer["[Not set]"].Value : Model.ApplicationUser.PhoneNumber2)
  • -
  • +
  • @Localizer["Linked Social Logins"]
  • @@ -83,13 +83,13 @@ } } -
  • +

@Localizer["Danger Zone"]

  • @Localizer["Delete Account"]
  • @Localizer["Caution: Once the account is deleted, this is final."]
  • -
  • +
@{ var zonedTime = Model.TimeZoneConverter.ToZonedTime(Model.ApplicationUser.ModifiedOn);} diff --git a/League/Views/Manage/_ChangeEmailModalPartial.cshtml b/League/Views/Manage/_ChangeEmailModalPartial.cshtml index 631dd41b..f5b33a34 100644 --- a/League/Views/Manage/_ChangeEmailModalPartial.cshtml +++ b/League/Views/Manage/_ChangeEmailModalPartial.cshtml @@ -4,7 +4,7 @@ @inject IViewLocalizer Localizer @inject ITenantContext TenantContext @model ChangeEmailViewModel -@{var organizationRoute = TenantContext.SiteContext.UrlSegmentValue;} +@{var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue;} @@ -12,7 +12,7 @@

@Localizer["For changing your primary email address we will send a confirmation code to the new email."]

@Localizer["The primary email address will be changed only after the confirmation link in our message was submitted."]

- +
diff --git a/League/Views/Manage/_ChangePasswordModalPartial.cshtml b/League/Views/Manage/_ChangePasswordModalPartial.cshtml index fb3d7c1e..02211499 100644 --- a/League/Views/Manage/_ChangePasswordModalPartial.cshtml +++ b/League/Views/Manage/_ChangePasswordModalPartial.cshtml @@ -4,11 +4,11 @@ @inject IViewLocalizer Localizer @inject ITenantContext TenantContext @model ChangePasswordViewModel -@{var organizationRoute = TenantContext.SiteContext.UrlSegmentValue;} +@{var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue;} - +
diff --git a/League/Views/Manage/_ChangeUsernameModalPartial.cshtml b/League/Views/Manage/_ChangeUsernameModalPartial.cshtml index f92aa03a..185029c5 100644 --- a/League/Views/Manage/_ChangeUsernameModalPartial.cshtml +++ b/League/Views/Manage/_ChangeUsernameModalPartial.cshtml @@ -8,14 +8,14 @@ @inject IUserValidator userValidator @{ var UserValidator = (LeagueUserValidator)this.userValidator; ViewContext.ClientValidationEnabled = false; - var tenantRoute = TenantContext.SiteContext.UrlSegmentValue;} + var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue;} @model ChangeUsernameViewModel @{ var allowedUsernameCharacters = Axuno.Tools.StringFormatter.GroupedValidCharacters(UserManager.Options.User.AllowedUserNameCharacters);} @* Form with only 1 input field can be submitted with enter key. So we have to prevent default submit behavior and trigger a click on saveBtn *@ - +
diff --git a/League/Views/Manage/_DeleteAccountModalPartial.cshtml b/League/Views/Manage/_DeleteAccountModalPartial.cshtml index 88931256..87c0fad6 100644 --- a/League/Views/Manage/_DeleteAccountModalPartial.cshtml +++ b/League/Views/Manage/_DeleteAccountModalPartial.cshtml @@ -4,14 +4,14 @@ @inject IViewLocalizer Localizer @inject ITenantContext TenantContext @model ChangeEmailViewModel -@{var organizationRoute = TenantContext.SiteContext.UrlSegmentValue;} +@{var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue;}

@Localizer["Once you delete your user account, there is no going back. Please be certain."]

- +
diff --git a/League/Views/Manage/_EditEmail2ModalPartial.cshtml b/League/Views/Manage/_EditEmail2ModalPartial.cshtml index cea9f412..27e84d1d 100644 --- a/League/Views/Manage/_EditEmail2ModalPartial.cshtml +++ b/League/Views/Manage/_EditEmail2ModalPartial.cshtml @@ -6,7 +6,7 @@ @model EditEmail2ViewModel @{ const string BtnRemove = "btn-remove"; ViewContext.ClientValidationEnabled = true; - var organizationRoute = TenantContext.SiteContext.UrlSegmentValue; + var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue; } @@ -14,7 +14,7 @@

@Localizer["The Additional Email will receive the same messages as the Primary Email."]

-
+
diff --git a/League/Views/Manage/_EditPersonalDetailsModalPartial.cshtml b/League/Views/Manage/_EditPersonalDetailsModalPartial.cshtml index 3d8c7e61..4b4a39c2 100644 --- a/League/Views/Manage/_EditPersonalDetailsModalPartial.cshtml +++ b/League/Views/Manage/_EditPersonalDetailsModalPartial.cshtml @@ -6,7 +6,7 @@ @inject ITenantContext TenantContext @{ ViewContext.ClientValidationEnabled = true; - var organizationRoute = TenantContext.SiteContext.UrlSegmentValue; + var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue; List GenderList() { var genderList = new List(); @@ -19,7 +19,7 @@ - +
diff --git a/League/Views/Manage/_EditPhone2ModalPartial.cshtml b/League/Views/Manage/_EditPhone2ModalPartial.cshtml index 50fcd453..5a5f0652 100644 --- a/League/Views/Manage/_EditPhone2ModalPartial.cshtml +++ b/League/Views/Manage/_EditPhone2ModalPartial.cshtml @@ -5,11 +5,11 @@ @inject ITenantContext TenantContext @model EditPhone2ViewModel @{ const string BtnRemove = "btn-remove"; - ViewContext.ClientValidationEnabled = true; var organizationRoute = TenantContext.SiteContext.UrlSegmentValue;} + ViewContext.ClientValidationEnabled = true; var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue;} - +
diff --git a/League/Views/Manage/_EditPhoneModalPartial.cshtml b/League/Views/Manage/_EditPhoneModalPartial.cshtml index 1e1274f6..9fbd2c87 100644 --- a/League/Views/Manage/_EditPhoneModalPartial.cshtml +++ b/League/Views/Manage/_EditPhoneModalPartial.cshtml @@ -7,12 +7,12 @@ @{ const string BtnRemove = "btn-remove"; ViewContext.ClientValidationEnabled = true; - var organizationRoute = TenantContext.SiteContext.UrlSegmentValue; + var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue; } - +
diff --git a/League/Views/Manage/_ManageLoginsModalPartial.cshtml b/League/Views/Manage/_ManageLoginsModalPartial.cshtml index b088da03..6b8822e2 100644 --- a/League/Views/Manage/_ManageLoginsModalPartial.cshtml +++ b/League/Views/Manage/_ManageLoginsModalPartial.cshtml @@ -4,7 +4,7 @@ @inject IViewLocalizer Localizer @inject ITenantContext TenantContext @model ManageLoginsViewModel -@{var organizationRoute = TenantContext.SiteContext.UrlSegmentValue;} +@{var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue;} @@ -20,7 +20,7 @@
@if (Model.ShowRemoveButton) { - + @@ -29,7 +29,7 @@ } else { - + @Localizer["Set a local password before you remove the social login"] @@ -45,7 +45,7 @@

@Localizer["Add New Social Login"]


- +

@foreach (var provider in Model.OtherLogins) diff --git a/League/Views/Manage/_SetPasswordModalPartial.cshtml b/League/Views/Manage/_SetPasswordModalPartial.cshtml index f012b75e..2a4e5053 100644 --- a/League/Views/Manage/_SetPasswordModalPartial.cshtml +++ b/League/Views/Manage/_SetPasswordModalPartial.cshtml @@ -7,14 +7,14 @@ @inject UserManager UserManager @{ ViewData["Title"] = Localizer["Set Password"].Value; - var organizationRoute = TenantContext.SiteContext.UrlSegmentValue; + var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue; ViewContext.ClientValidationEnabled = true; } @model SetPasswordViewModel - +

@Localizer["You do not have a local password for this site. Add a local password so you can sign in without an external login."] diff --git a/League/Views/Match/EditFixture.cshtml b/League/Views/Match/EditFixture.cshtml index 84553389..7223ec96 100644 --- a/League/Views/Match/EditFixture.cshtml +++ b/League/Views/Match/EditFixture.cshtml @@ -10,12 +10,12 @@ @model League.Models.MatchViewModels.EditFixtureViewModel @{ ViewData["Title"] = Localizer["Edit Fixture"].Value + " - " + Model.Tournament.Name; - var organizationRoute = TenantContext.SiteContext.UrlSegmentValue; + var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue; }

@ViewData["Title"]


- + @* needed for unobtrusive validation *@ @@ -85,7 +85,7 @@
diff --git a/League/Views/Match/EnterResult.cshtml b/League/Views/Match/EnterResult.cshtml index 782805f8..4c715a78 100644 --- a/League/Views/Match/EnterResult.cshtml +++ b/League/Views/Match/EnterResult.cshtml @@ -10,7 +10,7 @@ @model League.Models.MatchViewModels.EnterResultViewModel @{ ViewData["Title"] = Localizer["Enter Match Result"].Value + " - " + Model.Tournament.Name; - var organizationRoute = TenantContext.SiteContext.UrlSegmentValue; + var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue; string AddSetErr(int setIndex) { @@ -25,7 +25,7 @@

@ViewData["Title"]


- + @* needed for unobtrusive validation *@ @@ -127,7 +127,7 @@ } else { - @Localizer["Cancel"] + @Localizer["Cancel"] } } diff --git a/League/Views/Match/Fixtures.cshtml b/League/Views/Match/Fixtures.cshtml index f426b1ab..312f9d6d 100644 --- a/League/Views/Match/Fixtures.cshtml +++ b/League/Views/Match/Fixtures.cshtml @@ -9,7 +9,7 @@ @model League.Models.MatchViewModels.FixturesViewModel @{ ViewData["Title"] = Localizer["Fixtures"].Value + " - " + Model.Tournament.Name; - var organizationRoute = TenantContext.SiteContext.UrlSegmentValue; + var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue; if (Model.PlannedMatches.Count == 0) { diff --git a/League/Views/Match/Results.cshtml b/League/Views/Match/Results.cshtml index adb92a22..e2851555 100644 --- a/League/Views/Match/Results.cshtml +++ b/League/Views/Match/Results.cshtml @@ -8,7 +8,7 @@ @model League.Models.MatchViewModels.ResultsViewModel @{ ViewData["Title"] = Localizer["Match Results"].Value + " - " + Model.Tournament.Name; - var organizationRoute = TenantContext.SiteContext.UrlSegmentValue; + var tenantUrlSegment = TenantContext.SiteContext.UrlSegmentValue; if (Model.CompletedMatches.Count == 0) {
@@ -139,7 +139,7 @@