Added Favicon support, Progressive Web App support, page title and url support, and private/public user registration options
This commit is contained in:
@ -15,6 +15,14 @@
|
||||
<input class="form-control" @bind="@_name" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Title" class="control-label">Title: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@_title" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Path: </label>
|
||||
@ -74,6 +82,14 @@
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Url" class="control-label">Url: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@_url" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Personalizable? </label>
|
||||
@ -151,12 +167,14 @@
|
||||
|
||||
List<Theme> _themeList;
|
||||
List<Page> _pageList;
|
||||
string _name;
|
||||
string _name = "";
|
||||
string _title = "";
|
||||
string _path = "";
|
||||
string _parentid;
|
||||
string _insert = ">>";
|
||||
List<Page> _children;
|
||||
int _childid = -1;
|
||||
string _url = "";
|
||||
string _isnavigation = "True";
|
||||
string _ispersonalizable = "False";
|
||||
string _mode = "view";
|
||||
@ -244,6 +262,7 @@
|
||||
page = new Page();
|
||||
page.SiteId = PageState.Page.SiteId;
|
||||
page.Name = _name;
|
||||
page.Title = _title;
|
||||
if (_path == "")
|
||||
{
|
||||
_path = _name;
|
||||
@ -289,6 +308,7 @@
|
||||
break;
|
||||
}
|
||||
page.IsNavigation = (_isnavigation == null ? true : Boolean.Parse(_isnavigation));
|
||||
page.Url = _url;
|
||||
page.EditMode = (_mode == "edit" ? true : false);
|
||||
page.ThemeType = _themetype;
|
||||
page.LayoutType = (_layouttype == null ? "" : _layouttype);
|
||||
|
@ -15,6 +15,14 @@
|
||||
<input class="form-control" @bind="@_name" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Title" class="control-label">Title: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@_title" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Path: </label>
|
||||
@ -74,6 +82,14 @@
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Url" class="control-label">Url: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@_url" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Navigation? </label>
|
||||
@ -153,7 +169,7 @@
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<label for="Name" class="control-label">Permissions: </label>
|
||||
<PermissionGrid EntityName="@EntityNames.Page" Permissions="@_permissions" @ref="_permissionGrid" />
|
||||
<PermissionGrid EntityName="@EntityNames.Page" Permissions="@_permissions" @ref="_permissionGrid" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -173,14 +189,16 @@
|
||||
List<Theme> _themeList;
|
||||
List<Page> _pageList;
|
||||
int _pageId;
|
||||
string _name;
|
||||
string _path;
|
||||
string _name = "";
|
||||
string _title = "";
|
||||
string _path = "";
|
||||
string _currentparentid;
|
||||
string _parentid;
|
||||
string _insert = "=";
|
||||
List<Page> _children;
|
||||
int _childid = -1;
|
||||
string _isnavigation;
|
||||
string _url = "";
|
||||
string _ispersonalizable;
|
||||
string _mode;
|
||||
string _themetype;
|
||||
@ -213,6 +231,7 @@
|
||||
if (page != null)
|
||||
{
|
||||
_name = page.Name;
|
||||
_title = page.Title;
|
||||
_path = page.Path;
|
||||
if (_path.Contains("/"))
|
||||
{
|
||||
@ -228,6 +247,7 @@
|
||||
}
|
||||
_currentparentid = _parentid;
|
||||
_isnavigation = page.IsNavigation.ToString();
|
||||
_url = page.Url;
|
||||
_ispersonalizable = page.IsPersonalizable.ToString();
|
||||
_mode = (page.EditMode) ? "edit" : "view";
|
||||
_themetype = page.ThemeType;
|
||||
@ -313,6 +333,7 @@
|
||||
string currentPath = page.Path;
|
||||
|
||||
page.Name = _name;
|
||||
page.Title = _title;
|
||||
if (_path == "" && _name.ToLower() != "home")
|
||||
{
|
||||
_path = _name;
|
||||
@ -361,6 +382,7 @@
|
||||
}
|
||||
}
|
||||
page.IsNavigation = (_isnavigation == null || Boolean.Parse(_isnavigation));
|
||||
page.Url = _url;
|
||||
page.EditMode = (_mode == "edit");
|
||||
page.ThemeType = _themetype;
|
||||
page.LayoutType = _layouttype ?? "";
|
||||
|
@ -12,7 +12,7 @@
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<label class="control-label">Name: </label>
|
||||
<label class="control-label">Name: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@_name" />
|
||||
@ -20,7 +20,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label class="control-label">Tenant: </label>
|
||||
<label class="control-label">Tenant: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@_tenant" readonly />
|
||||
@ -28,7 +28,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label class="control-label">Aliases: </label>
|
||||
<label class="control-label">Aliases: </label>
|
||||
</td>
|
||||
<td>
|
||||
<textarea class="form-control" @bind="@_urls" rows="3"></textarea>
|
||||
@ -36,15 +36,23 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label class="control-label">Logo: </label>
|
||||
<label class="control-label">Logo: </label>
|
||||
</td>
|
||||
<td>
|
||||
<FileManager FileId="@_logofileid.ToString()" @ref="_filemanager" />
|
||||
<FileManager FileId="@_logofileid.ToString()" Filter="@Constants.ImageFiles" @ref="_logofilemanager" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label class="control-label">Default Theme: </label>
|
||||
<label class="control-label">Favicon: </label>
|
||||
</td>
|
||||
<td>
|
||||
<FileManager FileId="@_faviconfileid.ToString()" Filter="ico" @ref="_faviconfilemanager" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label class="control-label">Default Theme: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @onchange="(e => ThemeChanged(e))">
|
||||
@ -65,7 +73,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label class="control-label">Default Layout: </label>
|
||||
<label class="control-label">Default Layout: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@_layouttype">
|
||||
@ -79,7 +87,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label class="control-label">Default Container: </label>
|
||||
<label class="control-label">Default Container: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@_containertype">
|
||||
@ -93,7 +101,18 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label class="control-label">Is Deleted? </label>
|
||||
<label class="control-label">Allow User Registration? </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@_allowregistration">
|
||||
<option value="True">Yes</option>
|
||||
<option value="False">No</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label class="control-label">Is Deleted? </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@_isdeleted">
|
||||
@ -111,7 +130,7 @@
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<label class="control-label">Host: </label>
|
||||
<label class="control-label">Host: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@_smtphost" />
|
||||
@ -119,7 +138,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label class="control-label">Port: </label>
|
||||
<label class="control-label">Port: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@_smtpport" />
|
||||
@ -127,7 +146,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label class="control-label">SSL Enabled: </label>
|
||||
<label class="control-label">SSL Enabled: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@_smtpssl" />
|
||||
@ -135,7 +154,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label class="control-label">Username: </label>
|
||||
<label class="control-label">Username: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input class="form-control" @bind="@_smtpusername" />
|
||||
@ -143,7 +162,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label class="control-label">Password: </label>
|
||||
<label class="control-label">Password: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" class="form-control" @bind="@_smtppassword" />
|
||||
@ -151,6 +170,43 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<a data-toggle="collapse" class="app-link-unstyled" href="#PWA" aria-expanded="false" aria-controls="PWA">
|
||||
<h5><i class="oi oi-chevron-bottom"></i> Progressive Web Application Settings</h5><hr class="app-rule" />
|
||||
</a>
|
||||
<div class="collapse" id="PWA">
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<label class="control-label">Is Enabled? </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @bind="@_pwaisenabled">
|
||||
<option value="True">Yes</option>
|
||||
<option value="False">No</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label class="control-label">App Icon: </label>
|
||||
</td>
|
||||
<td>
|
||||
<FileManager FileId="@_pwaappiconfileid.ToString()" Filter="png" @ref="_pwaappiconfilemanager" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label class="control-label">Splash Icon: </label>
|
||||
</td>
|
||||
<td>
|
||||
<FileManager FileId="@_pwasplashiconfileid.ToString()" Filter="png" @ref="_pwasplashiconfilemanager" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<button type="button" class="btn btn-success" @onclick="SaveSite">Save</button>
|
||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||
@ -173,10 +229,13 @@
|
||||
List<Alias> _aliasList;
|
||||
string _urls = "";
|
||||
int _logofileid = -1;
|
||||
FileManager _filemanager;
|
||||
FileManager _logofilemanager;
|
||||
int _faviconfileid = -1;
|
||||
FileManager _faviconfilemanager;
|
||||
string _themetype;
|
||||
string _layouttype;
|
||||
string _containertype;
|
||||
string _allowregistration;
|
||||
|
||||
string _smtphost = "";
|
||||
string _smtpport = "";
|
||||
@ -184,6 +243,12 @@
|
||||
string _smtpusername = "";
|
||||
string _smtppassword = "";
|
||||
|
||||
string _pwaisenabled;
|
||||
int _pwaappiconfileid = -1;
|
||||
FileManager _pwaappiconfilemanager;
|
||||
int _pwasplashiconfileid = -1;
|
||||
FileManager _pwasplashiconfilemanager;
|
||||
|
||||
string _createdby;
|
||||
DateTime _createdon;
|
||||
string _modifiedby;
|
||||
@ -212,10 +277,15 @@
|
||||
{
|
||||
_logofileid = site.LogoFileId.Value;
|
||||
}
|
||||
if (site.FaviconFileId != null)
|
||||
{
|
||||
_faviconfileid = site.FaviconFileId.Value;
|
||||
}
|
||||
_themetype = site.DefaultThemeType;
|
||||
_panelayouts = ThemeService.GetPaneLayoutTypes(_themeList, _themetype);
|
||||
_layouttype = site.DefaultLayoutType;
|
||||
_containertype = site.DefaultContainerType;
|
||||
_allowregistration = site.AllowRegistration.ToString();
|
||||
|
||||
Dictionary<string, string> settings = await SettingService.GetSiteSettingsAsync(site.SiteId);
|
||||
_smtphost = SettingService.GetSetting(settings, "SMTPHost", "");
|
||||
@ -224,6 +294,16 @@
|
||||
_smtpusername = SettingService.GetSetting(settings, "SMTPUsername", "");
|
||||
_smtppassword = SettingService.GetSetting(settings, "SMTPPassword", "");
|
||||
|
||||
_pwaisenabled = site.PwaIsEnabled.ToString();
|
||||
if (site.PwaAppIconFileId != null)
|
||||
{
|
||||
_pwaappiconfileid = site.PwaAppIconFileId.Value;
|
||||
}
|
||||
if (site.PwaSplashIconFileId != null)
|
||||
{
|
||||
_pwasplashiconfileid = site.PwaSplashIconFileId.Value;
|
||||
}
|
||||
|
||||
_createdby = site.CreatedBy;
|
||||
_createdon = site.CreatedOn;
|
||||
_modifiedby = site.ModifiedBy;
|
||||
@ -286,16 +366,34 @@
|
||||
{
|
||||
site.Name = _name;
|
||||
site.LogoFileId = null;
|
||||
int logofileid = _filemanager.GetFileId();
|
||||
int logofileid = _logofilemanager.GetFileId();
|
||||
if (logofileid != -1)
|
||||
{
|
||||
site.LogoFileId = logofileid;
|
||||
}
|
||||
int faviconfileid = _faviconfilemanager.GetFileId();
|
||||
if (faviconfileid != -1)
|
||||
{
|
||||
site.FaviconFileId = faviconfileid;
|
||||
}
|
||||
site.DefaultThemeType = _themetype;
|
||||
site.DefaultLayoutType = (_layouttype == null ? "" : _layouttype);
|
||||
site.DefaultContainerType = _containertype;
|
||||
site.AllowRegistration = (_allowregistration == null ? true : Boolean.Parse(_allowregistration));
|
||||
site.IsDeleted = (_isdeleted == null ? true : Boolean.Parse(_isdeleted));
|
||||
|
||||
site.PwaIsEnabled = (_pwaisenabled == null ? true : Boolean.Parse(_pwaisenabled));
|
||||
int pwaappiconfileid = _pwaappiconfilemanager.GetFileId();
|
||||
if (pwaappiconfileid != -1)
|
||||
{
|
||||
site.PwaAppIconFileId = pwaappiconfileid;
|
||||
}
|
||||
int pwasplashiconfileid = _pwasplashiconfilemanager.GetFileId();
|
||||
if (pwasplashiconfileid != -1)
|
||||
{
|
||||
site.PwaSplashIconFileId = pwasplashiconfileid;
|
||||
}
|
||||
|
||||
site = await SiteService.UpdateSiteAsync(site, PageState.Alias);
|
||||
|
||||
_urls = _urls.Replace("\n", ",");
|
||||
|
@ -248,9 +248,14 @@ else
|
||||
site.TenantId = int.Parse(_tenantid);
|
||||
site.Name = _name;
|
||||
site.LogoFileId = null;
|
||||
site.FaviconFileId = null;
|
||||
site.DefaultThemeType = _themetype;
|
||||
site.DefaultLayoutType = (_layouttype == null ? "" : _layouttype);
|
||||
site.DefaultContainerType = _containertype;
|
||||
site.PwaIsEnabled = false;
|
||||
site.PwaAppIconFileId = null;
|
||||
site.PwaSplashIconFileId = null;
|
||||
site.AllowRegistration = false;
|
||||
site.SiteTemplateType = _sitetemplatetype;
|
||||
site = await SiteService.AddSiteAsync(site, aliases[0]);
|
||||
|
||||
|
@ -87,9 +87,7 @@ namespace Oqtane.Modules
|
||||
|
||||
public string ContentUrl(int fileid)
|
||||
{
|
||||
string url = (PageState.Alias.Path == "") ? "/~" : PageState.Alias.Path;
|
||||
url += Constants.ContentUrl + fileid.ToString();
|
||||
return url;
|
||||
return Utilities.ContentUrl(PageState.Alias.Path, fileid);
|
||||
}
|
||||
|
||||
// user feedback methods
|
||||
|
Reference in New Issue
Block a user