improve module/theme creation UI to support internal/external scenarios
This commit is contained in:
@ -127,11 +127,18 @@
|
||||
if (string.IsNullOrEmpty(_description)) _description = _module;
|
||||
if (IsValidXML(_description))
|
||||
{
|
||||
if (_type == "Internal")
|
||||
{
|
||||
AddModuleMessage(Localizer["Success.Module.Create.Internal"], MessageType.Success);
|
||||
}
|
||||
var template = _templates.FirstOrDefault(item => item.Name == _template);
|
||||
var moduleDefinition = new ModuleDefinition { Owner = _owner, Name = _module, Description = _description, Template = _template, Version = _reference, ModuleDefinitionName = template.Namespace };
|
||||
moduleDefinition = await ModuleDefinitionService.CreateModuleDefinitionAsync(moduleDefinition);
|
||||
GetLocation();
|
||||
AddModuleMessage(string.Format(Localizer["Success.Module.Create"], NavigateUrl("admin/system")), MessageType.Success);
|
||||
if (_type == "External")
|
||||
{
|
||||
GetLocation();
|
||||
AddModuleMessage(string.Format(Localizer["Success.Module.Create.External"], NavigateUrl("admin/system")), MessageType.Success);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -89,8 +89,8 @@
|
||||
AddModuleMessage(Localizer["Info.Theme.CreatorIntent"], MessageType.Info);
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -109,11 +109,18 @@
|
||||
{
|
||||
if (IsValid(_owner) && IsValid(_theme) && _owner != _theme && _template != "-")
|
||||
{
|
||||
if (_type == "Internal")
|
||||
{
|
||||
AddModuleMessage(Localizer["Success.Theme.Create.Internal"], MessageType.Success);
|
||||
}
|
||||
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);
|
||||
if (_type == "External")
|
||||
{
|
||||
GetLocation();
|
||||
AddModuleMessage(string.Format(Localizer["Success.Theme.Create.External"], NavigateUrl("admin/system")), MessageType.Success);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -168,7 +168,10 @@
|
||||
<data name="Location.Text" xml:space="preserve">
|
||||
<value>Location: </value>
|
||||
</data>
|
||||
<data name="Success.Module.Create" xml:space="preserve">
|
||||
<data name="Success.Module.Create.Internal" xml:space="preserve">
|
||||
<value>The Source Code For Your Module Has Been Created In Your Solution And Must Be Compiled In Order To Make It Functional</value>
|
||||
</data>
|
||||
<data name="Success.Module.Create.External" xml:space="preserve">
|
||||
<value>The Source Code For Your Module Has Been Created At The Location Specified Below And Must Be Compiled In Order To Make It Functional. Once It Has Been Compiled You Must <a href={0}>Restart</a> Your Application To Activate The Module.</value>
|
||||
</data>
|
||||
</root>
|
||||
|
||||
@ -141,7 +141,10 @@
|
||||
<data name="Info.Theme.CreatorIntent" xml:space="preserve">
|
||||
<value>Please Note That The Theme Creator Is Only Intended To Be Used In A Development Environment</value>
|
||||
</data>
|
||||
<data name="Success.Theme.Create" xml:space="preserve">
|
||||
<data name="Success.Theme.Create.Internal" xml:space="preserve">
|
||||
<value>The Source Code For Your Theme Has Been Created In Your Solution And Must Be Compiled In Order To Make It Functional</value>
|
||||
</data>
|
||||
<data name="Success.Theme.Create.External" xml:space="preserve">
|
||||
<value>The Source Code For Your Theme Has Been Created At The Location Specified Below And Must Be Compiled In Order To Make It Functional. Once It Has Been Compiled You Must <a href={0}>Restart</a> Your Application To Activate The Theme.</value>
|
||||
</data>
|
||||
<data name="Message.Required.ValidName" xml:space="preserve">
|
||||
|
||||
Reference in New Issue
Block a user