abstract namespace specification to template.json so that module and theme templates can use their own naming conventions
This commit is contained in:
		| @ -102,7 +102,8 @@ | ||||
|         { | ||||
|             if (IsValid(_owner) && IsValid(_theme) && _owner != _theme && _template != "-") | ||||
|             { | ||||
|                 var theme = new Theme { Owner = _owner, Name = _theme, Template = _template, Version = _reference }; | ||||
|                 var template = _templates.FirstOrDefault(item => item.Name == _template); | ||||
|                 var theme = new Theme { Owner = _owner, Name = _theme, Template = _template, Version = _reference, ThemeName = template.Namespace }; | ||||
|                 theme = await ThemeService.CreateThemeAsync(theme); | ||||
|                 GetLocation(); | ||||
|                 AddModuleMessage(string.Format(Localizer["Success.Theme.Create"], NavigateUrl("admin/system")), MessageType.Success); | ||||
| @ -142,8 +143,14 @@ | ||||
|         if (_owner != "" && _theme != "" && _template != "-") | ||||
|         { | ||||
|             var template = _templates.FirstOrDefault(item => item.Name == _template); | ||||
|             _location = template.Location + _owner + ".Theme." + _theme; | ||||
|  | ||||
|             if (!string.IsNullOrEmpty(template.Namespace)) | ||||
|             { | ||||
|                 _location = template.Location + template.Namespace.Replace("[Owner]", _owner).Replace("[Theme]", _theme); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 _location = template.Location + _owner + ".Theme." + _theme; | ||||
|             } | ||||
|         } | ||||
|         StateHasChanged(); | ||||
|     } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 sbwalker
					sbwalker