Merge pull request #4281 from sbwalker/dev
fix #4279 - remove Theme Settings tab from Add Page UI
This commit is contained in:
commit
eda7be627c
|
@ -198,12 +198,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
@if (_themeSettingsType != null)
|
|
||||||
{
|
|
||||||
<TabPanel Name="ThemeSettings" Heading=@Localizer["Theme.Heading"] ResourceKey="ThemeSettings">
|
|
||||||
@_themeSettingsComponent
|
|
||||||
</TabPanel>
|
|
||||||
}
|
|
||||||
</TabStrip>
|
</TabStrip>
|
||||||
<br />
|
<br />
|
||||||
<button type="button" class="btn btn-success" @onclick="SavePage">@SharedLocalizer["Save"]</button>
|
<button type="button" class="btn btn-success" @onclick="SavePage">@SharedLocalizer["Save"]</button>
|
||||||
|
@ -238,9 +232,6 @@
|
||||||
private string _bodycontent;
|
private string _bodycontent;
|
||||||
private string _permissions = null;
|
private string _permissions = null;
|
||||||
private PermissionGrid _permissionGrid;
|
private PermissionGrid _permissionGrid;
|
||||||
private Type _themeSettingsType;
|
|
||||||
private object _themeSettings;
|
|
||||||
private RenderFragment _themeSettingsComponent { get; set; }
|
|
||||||
private bool _refresh = false;
|
private bool _refresh = false;
|
||||||
protected Page _parent = null;
|
protected Page _parent = null;
|
||||||
protected Dictionary<string, string> _icons;
|
protected Dictionary<string, string> _icons;
|
||||||
|
@ -281,7 +272,6 @@
|
||||||
}
|
}
|
||||||
_effectivedate = Utilities.UtcAsLocalDate(PageState.Page.EffectiveDate);
|
_effectivedate = Utilities.UtcAsLocalDate(PageState.Page.EffectiveDate);
|
||||||
_expirydate = Utilities.UtcAsLocalDate(PageState.Page.ExpiryDate);
|
_expirydate = Utilities.UtcAsLocalDate(PageState.Page.ExpiryDate);
|
||||||
ThemeSettings();
|
|
||||||
_initialized = true;
|
_initialized = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -324,7 +314,6 @@
|
||||||
_themetype = (string)e.Value;
|
_themetype = (string)e.Value;
|
||||||
_containers = ThemeService.GetContainerControls(PageState.Site.Themes, _themetype);
|
_containers = ThemeService.GetContainerControls(PageState.Site.Themes, _themetype);
|
||||||
_containertype = _containers.First().TypeName;
|
_containertype = _containers.First().TypeName;
|
||||||
ThemeSettings();
|
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
|
|
||||||
// if theme chosen is different than default site theme, display warning message to user
|
// if theme chosen is different than default site theme, display warning message to user
|
||||||
|
@ -334,28 +323,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ThemeSettings()
|
|
||||||
{
|
|
||||||
_themeSettingsType = null;
|
|
||||||
_themeSettingsComponent = null;
|
|
||||||
var theme = PageState.Site.Themes.FirstOrDefault(item => item.Themes.Any(themecontrol => themecontrol.TypeName.Equals(_themetype)));
|
|
||||||
if (theme != null && !string.IsNullOrEmpty(theme.ThemeSettingsType))
|
|
||||||
{
|
|
||||||
_themeSettingsType = Type.GetType(theme.ThemeSettingsType);
|
|
||||||
if (_themeSettingsType != null)
|
|
||||||
{
|
|
||||||
_themeSettingsComponent = builder =>
|
|
||||||
{
|
|
||||||
builder.OpenComponent(0, _themeSettingsType);
|
|
||||||
builder.AddAttribute(1, "RenderModeBoundary", RenderModeBoundary);
|
|
||||||
builder.AddComponentReferenceCapture(2, inst => { _themeSettings = Convert.ChangeType(inst, _themeSettingsType); });
|
|
||||||
builder.CloseComponent();
|
|
||||||
};
|
|
||||||
}
|
|
||||||
_refresh = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task SavePage()
|
private async Task SavePage()
|
||||||
{
|
{
|
||||||
validated = true;
|
validated = true;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user