Merge pull request #69 from oqtane/dev

sync
This commit is contained in:
Shaun Walker 2020-11-19 15:54:32 -05:00 committed by GitHub
commit 2bf5e6c6b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
37 changed files with 405 additions and 347 deletions

View File

@ -87,7 +87,7 @@
private async Task Login() private async Task Login()
{ {
if (PageState.Runtime == Runtime.Server) if (PageState.Runtime == Oqtane.Shared.Runtime.Server)
{ {
// server-side Blazor // server-side Blazor
var user = new User(); var user = new User();

View File

@ -1,12 +1,13 @@
@namespace Oqtane.Modules.Admin.Roles @namespace Oqtane.Modules.Admin.Roles
@inherits ModuleBase @inherits ModuleBase
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@inject IRoleService RoleService @inject IRoleService RoleService
@inject IStringLocalizer<Add> Localizer
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
<td> <td>
<Label For="name" HelpText="Name Of The Role">Name:</Label> <Label For="name" HelpText="Name Of The Role" ResourceKey="Name">Name:</Label>
</td> </td>
<td> <td>
<input id="name" class="form-control" @bind="@_name" /> <input id="name" class="form-control" @bind="@_name" />
@ -14,7 +15,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="description" HelpText="A Short Description Of The Role Which Describes Its Purpose">Description:</Label> <Label For="description" HelpText="A Short Description Of The Role Which Describes Its Purpose" ResourceKey="Description">Description:</Label>
</td> </td>
<td> <td>
<textarea id="description" class="form-control" @bind="@_description" rows="5"></textarea> <textarea id="description" class="form-control" @bind="@_description" rows="5"></textarea>
@ -22,18 +23,18 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="isautoassigned" HelpText="Indicates Whether Or Not New Users Are Automatically Assigned To This Role">Auto Assigned?</Label> <Label For="isautoassigned" HelpText="Indicates Whether Or Not New Users Are Automatically Assigned To This Role" ResourceKey="AutoAssigned">Auto Assigned?</Label>
</td> </td>
<td> <td>
<select id="isautoassigned" class="form-control" @bind="@_isautoassigned"> <select id="isautoassigned" class="form-control" @bind="@_isautoassigned">
<option value="True">Yes</option> <option value="True">@Localizer["Yes"]</option>
<option value="False">No</option> <option value="False">@Localizer["No"]</option>
</select> </select>
</td> </td>
</tr> </tr>
</table> </table>
<button type="button" class="btn btn-success" @onclick="SaveRole">Save</button> <button type="button" class="btn btn-success" @onclick="SaveRole">@Localizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink> <NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
@code { @code {
private string _name = string.Empty; private string _name = string.Empty;

View File

@ -1,12 +1,13 @@
@namespace Oqtane.Modules.Admin.Roles @namespace Oqtane.Modules.Admin.Roles
@inherits ModuleBase @inherits ModuleBase
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@inject IRoleService RoleService @inject IRoleService RoleService
@inject IStringLocalizer<Edit> Localizer
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
<td> <td>
<Label For="name" HelpText="Name Of The Role">Name:</Label> <Label For="name" HelpText="Name Of The Role" ResourceKey="Name">Name:</Label>
</td> </td>
<td> <td>
<input id="name" class="form-control" @bind="@_name" /> <input id="name" class="form-control" @bind="@_name" />
@ -14,7 +15,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="description" HelpText="A Short Description Of The Role Which Describes Its Purpose">Description:</Label> <Label For="description" HelpText="A Short Description Of The Role Which Describes Its Purpose" ResourceKey="Description">Description:</Label>
</td> </td>
<td> <td>
<textarea id="description" class="form-control" @bind="@_description" rows="5"></textarea> <textarea id="description" class="form-control" @bind="@_description" rows="5"></textarea>
@ -22,18 +23,18 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="isautoassigned" HelpText="Indicates Whether Or Not New Users Are Automatically Assigned To This Role">Auto Assigned?</Label> <Label For="isautoassigned" HelpText="Indicates Whether Or Not New Users Are Automatically Assigned To This Role" ResourceKey="AutoAssigned">Auto Assigned?</Label>
</td> </td>
<td> <td>
<select id="isautoassigned" class="form-control" @bind="@_isautoassigned"> <select id="isautoassigned" class="form-control" @bind="@_isautoassigned">
<option value="True">Yes</option> <option value="True">@Localizer["Yes"]</option>
<option value="False">No</option> <option value="False">@Localizer["No"]</option>
</select> </select>
</td> </td>
</tr> </tr>
</table> </table>
<button type="button" class="btn btn-success" @onclick="SaveRole">Save</button> <button type="button" class="btn btn-success" @onclick="SaveRole">@Localizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink> <NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
@code { @code {
private int _roleid; private int _roleid;

View File

@ -1,26 +1,27 @@
@namespace Oqtane.Modules.Admin.Roles @namespace Oqtane.Modules.Admin.Roles
@inherits ModuleBase @inherits ModuleBase
@inject IRoleService RoleService @inject IRoleService RoleService
@inject IStringLocalizer<Index> Localizer
@if (_roles == null) @if (_roles == null)
{ {
<p><em>Loading...</em></p> <p><em>@Localizer["Loading..."]</em></p>
} }
else else
{ {
<ActionLink Action="Add" Text="Add Role" /> <ActionLink Action="Add" Text="Add Role" ResourceKey="AddRole" />
<Pager Items="@_roles"> <Pager Items="@_roles">
<Header> <Header>
<th style="width: 1px;">&nbsp;</th> <th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th> <th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th> <th style="width: 1px;">&nbsp;</th>
<th>Name</th> <th>@Localizer["Name"]</th>
</Header> </Header>
<Row> <Row>
<td><ActionLink Action="Edit" Parameters="@($"id=" + context.RoleId.ToString())" Disabled="@(context.IsSystem)" /></td> <td><ActionLink Action="Edit" Parameters="@($"id=" + context.RoleId.ToString())" Disabled="@(context.IsSystem)" ResourceKey="Edit" /></td>
<td><ActionDialog Header="Delete Role" Message="@("Are You Sure You Wish To Delete The " + context.Name + " Role?")" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteRole(context))" Disabled="@(context.IsSystem)" /></td> <td><ActionDialog Header="Delete Role" Message="@("Are You Sure You Wish To Delete The " + context.Name + " Role?")" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteRole(context))" Disabled="@(context.IsSystem)" ResourceKey="DeleteRole" /></td>
<td><ActionLink Action="Users" Parameters="@($"id=" + context.RoleId.ToString())" /></td> <td><ActionLink Action="Users" Parameters="@($"id=" + context.RoleId.ToString())" ResourceKey="Users" /></td>
<td>@context.Name</td> <td>@context.Name</td>
</Row> </Row>
</Pager> </Pager>

View File

@ -1,18 +1,19 @@
@namespace Oqtane.Modules.Admin.Roles @namespace Oqtane.Modules.Admin.Roles
@inherits ModuleBase @inherits ModuleBase
@inject IRoleService RoleService @inject IRoleService RoleService
@inject IUserRoleService UserRoleService @inject IUserRoleService UserRoleService
@inject IStringLocalizer<Users> Localizer
@if (userroles == null) @if (userroles == null)
{ {
<p><em>Loading...</em></p> <p><em>@Localizer["Loading..."]</em></p>
} }
else else
{ {
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
<td> <td>
<Label For="role" HelpText="The role you are assigning users to">Role: </Label> <Label For="role" HelpText="The role you are assigning users to" ResourceKey="Role">Role: </Label>
</td> </td>
<td> <td>
<input id="role" class="form-control" @bind="@name" disabled /> <input id="role" class="form-control" @bind="@name" disabled />
@ -20,7 +21,7 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="user" HelpText="Select a user">User: </Label> <Label For="user" HelpText="Select a user" ResourceKey="User">User: </Label>
</td> </td>
<td> <td>
<select id="user" class="form-control" @bind="@userid"> <select id="user" class="form-control" @bind="@userid">
@ -34,7 +35,7 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="effectiveDate" HelpText="The date that this role assignment is active">Effective Date: </Label> <Label For="effectiveDate" HelpText="The date that this role assignment is active" ResourceKey="EffectiveDate">Effective Date: </Label>
</td> </td>
<td> <td>
<input id="effectiveDate" class="form-control" @bind="@effectivedate" /> <input id="effectiveDate" class="form-control" @bind="@effectivedate" />
@ -42,27 +43,27 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="expiryDate" HelpText="The date that this role assignment expires">Expiry Date: </Label> <Label For="expiryDate" HelpText="The date that this role assignment expires" ResourceKey="ExpiryDate">Expiry Date: </Label>
</td> </td>
<td> <td>
<input id="expiryDate" class="form-control" @bind="@expirydate" /> <input id="expiryDate" class="form-control" @bind="@expirydate" />
</td> </td>
</tr> </tr>
</table> </table>
<button type="button" class="btn btn-success" @onclick="SaveUserRole">Save</button> <button type="button" class="btn btn-success" @onclick="SaveUserRole">@Localizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink> <NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
<hr class="app-rule" /> <hr class="app-rule" />
<p align="center"> <p align="center">
<Pager Items="@userroles"> <Pager Items="@userroles">
<Header> <Header>
<th>Users</th> <th>@Localizer["Users"]</th>
<th>&nbsp;</th> <th>&nbsp;</th>
</Header> </Header>
<Row> <Row>
<td>@context.User.DisplayName</td> <td>@context.User.DisplayName</td>
<td> <td>
<button type="button" class="btn btn-danger" @onclick=@(async () => await DeleteUserRole(context.UserRoleId))>Delete</button> <button type="button" class="btn btn-danger" @onclick=@(async () => await DeleteUserRole(context.UserRoleId))>@Localizer["Delete"]</button>
</td> </td>
</Row> </Row>
</Pager> </Pager>

View File

@ -1,4 +1,4 @@
@namespace Oqtane.Modules.Admin.Site @namespace Oqtane.Modules.Admin.Site
@inherits ModuleBase @inherits ModuleBase
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@inject ISiteService SiteService @inject ISiteService SiteService
@ -6,13 +6,14 @@
@inject IAliasService AliasService @inject IAliasService AliasService
@inject IThemeService ThemeService @inject IThemeService ThemeService
@inject ISettingService SettingService @inject ISettingService SettingService
@inject IStringLocalizer<Index> Localizer
@if (_initialized) @if (_initialized)
{ {
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
<td> <td>
<Label For="name" HelpText="Enter the site name">Name: </Label> <Label For="name" HelpText="Enter the site name" ResourceKey="Name">Name: </Label>
</td> </td>
<td> <td>
<input id="name" class="form-control" @bind="@_name" /> <input id="name" class="form-control" @bind="@_name" />
@ -20,7 +21,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="tenant" HelpText="Enter the tenant for the site">Tenant: </Label> <Label For="tenant" HelpText="Enter the tenant for the site" ResourceKey="Tenant">Tenant: </Label>
</td> </td>
<td> <td>
<input id="tenant" class="form-control" @bind="@_tenant" readonly /> <input id="tenant" class="form-control" @bind="@_tenant" readonly />
@ -28,7 +29,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="alias" HelpText="Enter the alias for the server">Aliases: </Label> <Label For="alias" HelpText="Enter the alias for the server" ResourceKey="Aliases">Aliases: </Label>
</td> </td>
<td> <td>
<textarea id="alias" class="form-control" @bind="@_urls" rows="3"></textarea> <textarea id="alias" class="form-control" @bind="@_urls" rows="3"></textarea>
@ -36,7 +37,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="logo" HelpText="Upload a logo for the site">Logo: </Label> <Label For="logo" HelpText="Upload a logo for the site" ResourceKey="Logo">Logo: </Label>
</td> </td>
<td> <td>
<FileManager FileId="@_logofileid" Filter="@Constants.ImageFiles" @ref="_logofilemanager" /> <FileManager FileId="@_logofileid" Filter="@Constants.ImageFiles" @ref="_logofilemanager" />
@ -44,7 +45,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="favicon" HelpText="Select Your default icon">Favicon: </Label> <Label For="favicon" HelpText="Select Your default icon" ResourceKey="FavoriteIcon">Favicon: </Label>
</td> </td>
<td> <td>
<FileManager FileId="@_faviconfileid" Filter="ico" @ref="_faviconfilemanager" /> <FileManager FileId="@_faviconfileid" Filter="ico" @ref="_faviconfilemanager" />
@ -52,11 +53,11 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="defaultTheme" HelpText="Select the sites default theme">Default Theme: </Label> <Label For="defaultTheme" HelpText="Select the sites default theme" ResourceKey="DefaultTheme">Default Theme: </Label>
</td> </td>
<td> <td>
<select id="defaultTheme" class="form-control" @onchange="(e => ThemeChanged(e))"> <select id="defaultTheme" class="form-control" @onchange="(e => ThemeChanged(e))">
<option value="-">&lt;Select Theme&gt;</option> <option value="-">&lt;@Localizer["Select Theme"]&gt;</option>
@foreach (var theme in _themes) @foreach (var theme in _themes)
{ {
if (theme.TypeName == _themetype) if (theme.TypeName == _themetype)
@ -75,11 +76,11 @@
{ {
<tr> <tr>
<td> <td>
<Label For="defaultLayout" HelpText="Select the sites default layout">Default Layout: </Label> <Label For="defaultLayout" HelpText="Select the sites default layout" ResourceKey="DefaultLayout">Default Layout: </Label>
</td> </td>
<td> <td>
<select id="defaultLayout" class="form-control" @bind="@_layouttype"> <select id="defaultLayout" class="form-control" @bind="@_layouttype">
<option value="-">&lt;Select Layout&gt;</option> <option value="-">&lt;@Localizer["Select Layout"]&gt;</option>
@foreach (var layout in _layouts) @foreach (var layout in _layouts)
{ {
<option value="@(layout.TypeName)">@(layout.Name)</option> <option value="@(layout.TypeName)">@(layout.Name)</option>
@ -90,11 +91,11 @@
} }
<tr> <tr>
<td> <td>
<Label For="defaultContainer" HelpText="Select the default container for the site">Default Container: </Label> <Label For="defaultContainer" HelpText="Select the default container for the site" ResourceKey="DefaultContainer">Default Container: </Label>
</td> </td>
<td> <td>
<select id="defaultContainer" class="form-control" @bind="@_containertype"> <select id="defaultContainer" class="form-control" @bind="@_containertype">
<option value="-">&lt;Select Container&gt;</option> <option value="-">&lt;@Localizer["Select Container"]&gt;</option>
@foreach (var container in _containers) @foreach (var container in _containers)
{ {
<option value="@container.TypeName">@container.Name</option> <option value="@container.TypeName">@container.Name</option>
@ -104,33 +105,33 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="allowRegister" HelpText="Do you want the users to be able to register for an account on the site">Allow User Registration? </Label> <Label For="allowRegister" HelpText="Do you want the users to be able to register for an account on the site" ResourceKey="AllowRegistration">Allow User Registration? </Label>
</td> </td>
<td> <td>
<select id="allowRegister" class="form-control" @bind="@_allowregistration"> <select id="allowRegister" class="form-control" @bind="@_allowregistration">
<option value="True">Yes</option> <option value="True">@Localizer["Yes"]</option>
<option value="False">No</option> <option value="False">@Localizer["No"]</option>
</select> </select>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="isDeleted" HelpText="Is this site deleted?">Is Deleted? </Label> <Label For="isDeleted" HelpText="Is this site deleted?" ResourceKey="IsDeleted">Is Deleted? </Label>
</td> </td>
<td> <td>
<select id="isDeleted" class="form-control" @bind="@_isdeleted"> <select id="isDeleted" class="form-control" @bind="@_isdeleted">
<option value="True">Yes</option> <option value="True">@Localizer["Yes"]</option>
<option value="False">No</option> <option value="False">@Localizer["No"]</option>
</select> </select>
</td> </td>
</tr> </tr>
</table> </table>
<Section Name="SMTP" Heading="SMTP Settings"> <Section Name="SMTP" ResourceKey="SMTPSettings">
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
<td> <td>
<Label For="host" HelpText="Enter the host name of the server">Host: </Label> <Label For="host" HelpText="Enter the host name of the server" ResourceKey="Host">Host: </Label>
</td> </td>
<td> <td>
<input id="host" class="form-control" @bind="@_smtphost" /> <input id="host" class="form-control" @bind="@_smtphost" />
@ -138,7 +139,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="port" HelpText="Enter the port number for the server">Port: </Label> <Label For="port" HelpText="Enter the port number for the server" ResourceKey="Port">Port: </Label>
</td> </td>
<td> <td>
<input id="port" class="form-control" @bind="@_smtpport" /> <input id="port" class="form-control" @bind="@_smtpport" />
@ -146,7 +147,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="enabledSSl" HelpText="Specifiy if SSL is enabled for your server">SSL Enabled: </Label> <Label For="enabledSSl" HelpText="Specifiy if SSL is enabled for your server" ResourceKey="UseSsl">SSL Enabled: </Label>
</td> </td>
<td> <td>
<input id="enabledSSl" class="form-control" @bind="@_smtpssl" /> <input id="enabledSSl" class="form-control" @bind="@_smtpssl" />
@ -154,7 +155,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="username" HelpText="Enter the username for the server">Username: </Label> <Label For="username" HelpText="Enter the username for the server" ResourceKey="SmptUsername">Username: </Label>
</td> </td>
<td> <td>
<input id="username" class="form-control" @bind="@_smtpusername" /> <input id="username" class="form-control" @bind="@_smtpusername" />
@ -162,7 +163,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="password" HelpText="Enter the password for the server">Password: </Label> <Label For="password" HelpText="Enter the password for the server" ResourceKey="SmtpPassword">Password: </Label>
</td> </td>
<td> <td>
<input id="password" type="password" class="form-control" @bind="@_smtppassword" /> <input id="password" type="password" class="form-control" @bind="@_smtppassword" />
@ -170,22 +171,22 @@
</tr> </tr>
</table> </table>
</Section> </Section>
<Section Name="PWA" Heading="Progressive Web Application Settings"> <Section Name="PWA" Heading="Progressive Web Application Settings" ResourceKey="PWASettings">
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
<td> <td>
<Label For="isEnabled" HelpText="Select whether you would like this site to be available as a Progressive Web Application (PWA)">Is Enabled? </Label> <Label For="isEnabled" HelpText="Select whether you would like this site to be available as a Progressive Web Application (PWA)" ResourceKey="EnablePWA">Is Enabled? </Label>
</td> </td>
<td> <td>
<select id="isEnabled" class="form-control" @bind="@_pwaisenabled"> <select id="isEnabled" class="form-control" @bind="@_pwaisenabled">
<option value="True">Yes</option> <option value="True">@Localizer["Yes"]</option>
<option value="False">No</option> <option value="False">@Localizer["No"]</option>
</select> </select>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="appIcon" HelpText="Include an application icon for your PWA. It should be a PNG which is 192 X 192 pixels in dimension.">App Icon: </Label> <Label For="appIcon" HelpText="Include an application icon for your PWA. It should be a PNG which is 192 X 192 pixels in dimension." ResourceKey="PwaApplicationIcon">App Icon: </Label>
</td> </td>
<td> <td>
<FileManager FileId="@_pwaappiconfileid" Filter="png" @ref="_pwaappiconfilemanager" /> <FileManager FileId="@_pwaappiconfileid" Filter="png" @ref="_pwaappiconfilemanager" />
@ -193,7 +194,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="splashIcon" HelpText="Include a splash icon for your PWA. It should be a PNG which is 512 X 512 pixels in dimension.">Splash Icon: </Label> <Label For="splashIcon" HelpText="Include a splash icon for your PWA. It should be a PNG which is 512 X 512 pixels in dimension." ResourceKey="PwaSplashIcon">Splash Icon: </Label>
</td> </td>
<td> <td>
<FileManager FileId="@_pwasplashiconfileid" Filter="png" @ref="_pwasplashiconfilemanager" /> <FileManager FileId="@_pwasplashiconfileid" Filter="png" @ref="_pwasplashiconfilemanager" />
@ -203,8 +204,8 @@
</Section> </Section>
<br /> <br />
<button type="button" class="btn btn-success" @onclick="SaveSite">Save</button> <button type="button" class="btn btn-success" @onclick="SaveSite">@Localizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink> <NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
<br /> <br />
<br /> <br />
<AuditInfo CreatedBy="@_createdby" CreatedOn="@_createdon" ModifiedBy="@_modifiedby" ModifiedOn="@_modifiedon" DeletedBy="@_deletedby" DeletedOn="@_deletedon"></AuditInfo> <AuditInfo CreatedBy="@_createdby" CreatedOn="@_createdon" ModifiedBy="@_modifiedby" ModifiedOn="@_modifiedon" DeletedBy="@_deletedby" DeletedOn="@_deletedon"></AuditInfo>

View File

@ -1,4 +1,4 @@
@namespace Oqtane.Modules.Admin.Sites @namespace Oqtane.Modules.Admin.Sites
@inherits ModuleBase @inherits ModuleBase
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@inject ITenantService TenantService @inject ITenantService TenantService
@ -8,17 +8,18 @@
@inject ISiteTemplateService SiteTemplateService @inject ISiteTemplateService SiteTemplateService
@inject IUserService UserService @inject IUserService UserService
@inject IInstallationService InstallationService @inject IInstallationService InstallationService
@inject IStringLocalizer<Add> Localizer
@if (_tenants == null) @if (_tenants == null)
{ {
<p><em>Loading...</em></p> <p><em>@Localizer["Loading..."]</em></p>
} }
else else
{ {
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
<td> <td>
<Label For="name" HelpText="Enter the name of the site">Site Name: </Label> <Label For="name" HelpText="Enter the name of the site" ResourceKey="Name">Site Name: </Label>
</td> </td>
<td> <td>
<input id="name" class="form-control" @bind="@_name" /> <input id="name" class="form-control" @bind="@_name" />
@ -26,7 +27,7 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="alias" HelpText="Enter the alias for the server">Aliases: </Label> <Label For="alias" HelpText="Enter the alias for the server" ResourceKey="Aliases">Aliases: </Label>
</td> </td>
<td> <td>
<textarea id="alias" class="form-control" @bind="@_urls" rows="3"></textarea> <textarea id="alias" class="form-control" @bind="@_urls" rows="3"></textarea>
@ -34,11 +35,11 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="defaultTheme" HelpText="Select the default theme for the website">Default Theme: </Label> <Label For="defaultTheme" HelpText="Select the default theme for the website" ResourceKey="DefaultTheme">Default Theme: </Label>
</td> </td>
<td> <td>
<select id="defaultTheme" class="form-control" @onchange="(e => ThemeChanged(e))"> <select id="defaultTheme" class="form-control" @onchange="(e => ThemeChanged(e))">
<option value="-">&lt;Select Theme&gt;</option> <option value="-">&lt;@Localizer["Select Theme"]&gt;</option>
@foreach (var theme in _themes) @foreach (var theme in _themes)
{ {
<option value="@theme.TypeName">@theme.Name</option> <option value="@theme.TypeName">@theme.Name</option>
@ -50,11 +51,11 @@ else
{ {
<tr> <tr>
<td> <td>
<Label For="defaultLayout" HelpText="Select the default layout for the site">Default Layout: </Label> <Label For="defaultLayout" HelpText="Select the default layout for the site" ResourceKey="DefaultLayout">Default Layout: </Label>
</td> </td>
<td> <td>
<select id="defaultLayout" class="form-control" @bind="@_layouttype"> <select id="defaultLayout" class="form-control" @bind="@_layouttype">
<option value="-">&lt;Select Layout&gt;</option> <option value="-">&lt;@Localizer["Select Layout"]&gt;</option>
@foreach (var layout in _layouts) @foreach (var layout in _layouts)
{ {
<option value="@(layout.TypeName)">@(layout.Name)</option> <option value="@(layout.TypeName)">@(layout.Name)</option>
@ -65,11 +66,11 @@ else
} }
<tr> <tr>
<td> <td>
<Label For="defaultContainer" HelpText="Select the default container for the site">Default Container: </Label> <Label For="defaultContainer" HelpText="Select the default container for the site" ResourceKey="DefaultContainer">Default Container: </Label>
</td> </td>
<td> <td>
<select id="defaultContainer" class="form-control" @bind="@_containertype"> <select id="defaultContainer" class="form-control" @bind="@_containertype">
<option value="-">&lt;Select Container&gt;</option> <option value="-">&lt;@Localizer["Select Container"]&gt;</option>
@foreach (var container in _containers) @foreach (var container in _containers)
{ {
<option value="@container.TypeName">@container.Name</option> <option value="@container.TypeName">@container.Name</option>
@ -79,11 +80,11 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="siteTemplate" HelpText="Select the site template">Site Template: </Label> <Label For="siteTemplate" HelpText="Select the site template" ResourceKey="SiteTemplate">Site Template: </Label>
</td> </td>
<td> <td>
<select id="siteTemplate" class="form-control" @bind="@_sitetemplatetype"> <select id="siteTemplate" class="form-control" @bind="@_sitetemplatetype">
<option value="-">&lt;Select Site Template&gt;</option> <option value="-">&lt;@Localizer["Select Site Template"]&gt;</option>
@foreach (SiteTemplate siteTemplate in _siteTemplates) @foreach (SiteTemplate siteTemplate in _siteTemplates)
{ {
<option value="@siteTemplate.TypeName">@siteTemplate.Name</option> <option value="@siteTemplate.TypeName">@siteTemplate.Name</option>
@ -93,12 +94,12 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="tenant" HelpText="Select the tenant for the site">Tenant: </Label> <Label For="tenant" HelpText="Select the tenant for the site" ResourceKey="Tenant">Tenant: </Label>
</td> </td>
<td> <td>
<select id="tenant" class="form-control" @onchange="(e => TenantChanged(e))"> <select id="tenant" class="form-control" @onchange="(e => TenantChanged(e))">
<option value="-">&lt;Select Tenant&gt;</option> <option value="-">&lt;@Localizer["Select Tenant"]&gt;</option>
<option value="+">&lt;Create New Tenant&gt;</option> <option value="+">&lt;@Localizer["Create New Tenant"]&gt;</option>
@foreach (Tenant tenant in _tenants) @foreach (Tenant tenant in _tenants)
{ {
<option value="@tenant.TenantId">@tenant.Name</option> <option value="@tenant.TenantId">@tenant.Name</option>
@ -115,7 +116,7 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="name" HelpText="Enter the name for the tenant">Tenant Name: </Label> <Label For="name" HelpText="Enter the name for the tenant" ResourceKey="TenantName">Tenant Name: </Label>
</td> </td>
<td> <td>
<input id="name" class="form-control" @bind="@_tenantname" /> <input id="name" class="form-control" @bind="@_tenantname" />
@ -123,18 +124,18 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="databaseType" HelpText="Select the database type for the tenant">Database Type: </Label> <Label For="databaseType" HelpText="Select the database type for the tenant" ResourceKey="DatabaseType">Database Type: </Label>
</td> </td>
<td> <td>
<select id="databaseType" class="custom-select" @bind="@_databasetype"> <select id="databaseType" class="custom-select" @bind="@_databasetype">
<option value="LocalDB">Local Database</option> <option value="LocalDB">@Localizer["Local Database"]</option>
<option value="SQLServer">SQL Server</option> <option value="SQLServer">@Localizer["SQL Server"]</option>
</select> </select>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="server" HelpText="Enter the server for the tenant">Server: </Label> <Label For="server" HelpText="Enter the server for the tenant" ResourceKey="DatabaseServer">Server: </Label>
</td> </td>
<td> <td>
<input id="server" type="text" class="form-control" @bind="@_server" /> <input id="server" type="text" class="form-control" @bind="@_server" />
@ -142,7 +143,7 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="database" HelpText="Enter the database for the tenant">Database: </Label> <Label For="database" HelpText="Enter the database for the tenant" ResourceKey="Database">Database: </Label>
</td> </td>
<td> <td>
<input id="database" type="text" class="form-control" @bind="@_database" /> <input id="database" type="text" class="form-control" @bind="@_database" />
@ -150,12 +151,12 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="integratedSecurity" HelpText="Select if you want integrated security or not">Integrated Security: </Label> <Label For="integratedSecurity" HelpText="Select if you want integrated security or not" ResourceKey="IntegratedSecurity">Integrated Security: </Label>
</td> </td>
<td> <td>
<select id="integratedSecurity" class="custom-select" @onchange="SetIntegratedSecurity"> <select id="integratedSecurity" class="custom-select" @onchange="SetIntegratedSecurity">
<option value="true" selected>True</option> <option value="true" selected>@Localizer["True"]</option>
<option value="false">False</option> <option value="false">@Localizer["False"]</option>
</select> </select>
</td> </td>
</tr> </tr>
@ -163,7 +164,7 @@ else
{ {
<tr> <tr>
<td> <td>
<Label For="username" HelpText="Enter the username for the integrated security">Database Username: </Label> <Label For="username" HelpText="Enter the username for the integrated security" ResourceKey="DatabaseUsername">Database Username: </Label>
</td> </td>
<td> <td>
<input id="username" type="text" class="form-control" @bind="@_username" /> <input id="username" type="text" class="form-control" @bind="@_username" />
@ -171,7 +172,7 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="password" HelpText="Enter the password for the integrated security">Database Password: </Label> <Label For="password" HelpText="Enter the password for the integrated security" ResourceKey="DatabasePassword">Database Password: </Label>
</td> </td>
<td> <td>
<input id="password" type="password" class="form-control" @bind="@_password" /> <input id="password" type="password" class="form-control" @bind="@_password" />
@ -180,7 +181,7 @@ else
} }
<tr> <tr>
<td> <td>
<Label For="hostUsername" HelpText="Enter the username of the host for this site">Host Username:</Label> <Label For="hostUsername" HelpText="Enter the username of the host for this site" ResourceKey="HostUsername">Host Username:</Label>
</td> </td>
<td> <td>
<input id="hostUsername" class="form-control" @bind="@_hostusername" readonly /> <input id="hostUsername" class="form-control" @bind="@_hostusername" readonly />
@ -188,7 +189,7 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="hostPassword" HelpText="Enter the password for the host of this site">Host Password:</Label> <Label For="hostPassword" HelpText="Enter the password for the host of this site" ResourceKey="HostPassword">Host Password:</Label>
</td> </td>
<td> <td>
<input id="hostPassword" type="password" class="form-control" @bind="@_hostpassword" /> <input id="hostPassword" type="password" class="form-control" @bind="@_hostpassword" />
@ -196,8 +197,8 @@ else
</tr> </tr>
} }
</table> </table>
<button type="button" class="btn btn-success" @onclick="SaveSite">Save</button> <button type="button" class="btn btn-success" @onclick="SaveSite">@Localizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink> <NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
} }
@code { @code {

View File

@ -1,17 +1,18 @@
@namespace Oqtane.Modules.Admin.Sites @namespace Oqtane.Modules.Admin.Sites
@inherits ModuleBase @inherits ModuleBase
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@inject ISiteService SiteService @inject ISiteService SiteService
@inject ITenantService TenantService @inject ITenantService TenantService
@inject IAliasService AliasService @inject IAliasService AliasService
@inject IThemeService ThemeService @inject IThemeService ThemeService
@inject IStringLocalizer<Edit> Localizer
@if (_initialized) @if (_initialized)
{ {
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
<td> <td>
<Label For="name" HelpText="Enter the name of the site">Name: </Label> <Label For="name" HelpText="Enter the name of the site" ResourceKey="Name">Name: </Label>
</td> </td>
<td> <td>
<input id="name" class="form-control" @bind="@_name" /> <input id="name" class="form-control" @bind="@_name" />
@ -19,7 +20,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="tenant" HelpText="Enter the tenant for the site">Tenant: </Label> <Label For="tenant" HelpText="Enter the tenant for the site" ResourceKey="Tenant">Tenant: </Label>
</td> </td>
<td> <td>
<input id="tenant" class="form-control" @bind="@_tenant" readonly /> <input id="tenant" class="form-control" @bind="@_tenant" readonly />
@ -27,7 +28,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="alias" HelpText="Enter the alias for the server">Aliases: </Label> <Label For="alias" HelpText="Enter the alias for the server" ResourceKey="Aliases">Aliases: </Label>
</td> </td>
<td> <td>
<textarea id="alias" class="form-control" @bind="@_urls" rows="3" /> <textarea id="alias" class="form-control" @bind="@_urls" rows="3" />
@ -35,11 +36,11 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="defaultTheme" HelpText="Select the default theme for the website">Default Theme: </Label> <Label For="defaultTheme" HelpText="Select the default theme for the website" ResourceKey="DefaultTheme">Default Theme: </Label>
</td> </td>
<td> <td>
<select id="defaultTheme" class="form-control" @onchange="(e => ThemeChanged(e))"> <select id="defaultTheme" class="form-control" @onchange="(e => ThemeChanged(e))">
<option value="-">&lt;Select Theme&gt;</option> <option value="-">&lt;@Localizer["Select Theme"]&gt;</option>
@foreach (var theme in _themes) @foreach (var theme in _themes)
{ {
if (theme.TypeName == _themetype) if (theme.TypeName == _themetype)
@ -58,11 +59,11 @@
{ {
<tr> <tr>
<td> <td>
<Label For="defaultLayout" HelpText="Select the default layout for the site">Default Layout: </Label> <Label For="defaultLayout" HelpText="Select the default layout for the site" ResourceKey="DefaultLayout">Default Layout: </Label>
</td> </td>
<td> <td>
<select id="defaultLayout" class="form-control" @bind="@_layouttype"> <select id="defaultLayout" class="form-control" @bind="@_layouttype">
<option value="-">&lt;Select Layout&gt;</option> <option value="-">&lt;@Localizer["Select Layout"]&gt;</option>
@foreach (var layout in _layouts) @foreach (var layout in _layouts)
{ {
<option value="@(layout.TypeName)">@(layout.Name)</option> <option value="@(layout.TypeName)">@(layout.Name)</option>
@ -73,11 +74,11 @@
} }
<tr> <tr>
<td> <td>
<Label For="defaultContainer" HelpText="Select the default container for the site">Default Container: </Label> <Label For="defaultContainer" HelpText="Select the default container for the site" ResourceKey="DefaultContainer">Default Container: </Label>
</td> </td>
<td> <td>
<select id="defaultIdea" class="form-control" @bind="@_containertype"> <select id="defaultIdea" class="form-control" @bind="@_containertype">
<option value="-">&lt;Select Container&gt;</option> <option value="-">&lt;@Localizer["Select Container"]&gt;</option>
@foreach (var container in _containers) @foreach (var container in _containers)
{ {
<option value="@container.TypeName">@container.Name</option> <option value="@container.TypeName">@container.Name</option>
@ -87,19 +88,19 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="isDeleted" HelpText="Has this site been deleted?">Is Deleted? </Label> <Label For="isDeleted" HelpText="Has this site been deleted?" ResourceKey="IsDeleted">Is Deleted? </Label>
</td> </td>
<td> <td>
<select id="isDeleted" class="form-control" @bind="@_isdeleted"> <select id="isDeleted" class="form-control" @bind="@_isdeleted">
<option value="True">Yes</option> <option value="True">@Localizer["Yes"]</option>
<option value="False">No</option> <option value="False">@Localizer["No"]</option>
</select> </select>
</td> </td>
</tr> </tr>
</table> </table>
<br /> <br />
<button type="button" class="btn btn-success" @onclick="SaveSite">Save</button> <button type="button" class="btn btn-success" @onclick="SaveSite">@Localizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink> <NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
<br /> <br />
<br /> <br />
<AuditInfo CreatedBy="@_createdby" CreatedOn="@_createdon" ModifiedBy="@_modifiedby" ModifiedOn="@_modifiedon" DeletedBy="@_deletedby" DeletedOn="@_deletedon"></AuditInfo> <AuditInfo CreatedBy="@_createdby" CreatedOn="@_createdon" ModifiedBy="@_modifiedby" ModifiedOn="@_modifiedon" DeletedBy="@_deletedby" DeletedOn="@_deletedon"></AuditInfo>
@ -256,7 +257,7 @@
} }
} }
await Log(_alias, LogLevel.Information,PermissionNames.Edit, null, "Site Saved {Site}", site); await Log(_alias, LogLevel.Information, PermissionNames.Edit, null, "Site Saved {Site}", site);
NavigationManager.NavigateTo(NavigateUrl()); NavigationManager.NavigateTo(NavigateUrl());
} }
@ -277,4 +278,4 @@
AddModuleMessage("Error Saving Site", MessageType.Error); AddModuleMessage("Error Saving Site", MessageType.Error);
} }
} }
} }

View File

@ -1,8 +1,9 @@
@namespace Oqtane.Modules.Admin.Sites @namespace Oqtane.Modules.Admin.Sites
@inherits ModuleBase @inherits ModuleBase
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@inject IAliasService AliasService @inject IAliasService AliasService
@inject ISiteService SiteService @inject ISiteService SiteService
@inject IStringLocalizer<Index> Localizer
@if (_sites == null) @if (_sites == null)
{ {
@ -10,17 +11,17 @@
} }
else else
{ {
<ActionLink Action="Add" Text="Add Site" /> <ActionLink Action="Add" Text="Add Site" ResourceKey="AddSite" />
<Pager Items="@_sites"> <Pager Items="@_sites">
<Header> <Header>
<th style="width: 1px;">&nbsp;</th> <th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th> <th style="width: 1px;">&nbsp;</th>
<th>Name</th> <th>@Localizer["Name"]</th>
</Header> </Header>
<Row> <Row>
<td><ActionLink Action="Edit" Parameters="@($"id=" + context.AliasId.ToString())" /></td> <td><ActionLink Action="Edit" Parameters="@($"id=" + context.AliasId.ToString())" ResourceKey="EditSite" /></td>
<td><ActionDialog Header="Delete Site" Message="@("Are You Sure You Wish To Delete The " + context.Name + " Site?")" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteSite(context))" /></td> <td><ActionDialog Header="Delete Site" Message="@("Are You Sure You Wish To Delete The " + context.Name + " Site?")" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteSite(context))" ResourceKey="DeleteSite" /></td>
<td><a href="@(_scheme + context.Name)">@context.Name</a></td> <td><a href="@(_scheme + context.Name)">@context.Name</a></td>
</Row> </Row>
</Pager> </Pager>

View File

@ -1,8 +1,9 @@
@namespace Oqtane.Modules.Admin.Sql @namespace Oqtane.Modules.Admin.Sql
@inherits ModuleBase @inherits ModuleBase
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@inject ITenantService TenantService @inject ITenantService TenantService
@inject ISqlService SqlService @inject ISqlService SqlService
@inject IStringLocalizer<Index> Localizer
@if (_tenants == null) @if (_tenants == null)
{ {
@ -13,11 +14,11 @@ else
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
<td> <td>
<Label For="tenant" HelpText="Select the tenant for the SQL server">Tenant: </Label> <Label For="tenant" HelpText="Select the tenant for the SQL server" ResourceKey="Tenant">Tenant: </Label>
</td> </td>
<td> <td>
<select id="teneant" class="form-control" @bind="_tenantid"> <select id="teneant" class="form-control" @bind="_tenantid">
<option value="-1">&lt;Select Tenant&gt;</option> <option value="-1">&lt;@Localizer["Select Tenant"]&gt;</option>
@foreach (Tenant tenant in _tenants) @foreach (Tenant tenant in _tenants)
{ {
<option value="@tenant.TenantId">@tenant.Name</option> <option value="@tenant.TenantId">@tenant.Name</option>
@ -27,15 +28,16 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="sqlQeury" HelpText="Enter the query for the SQL server">SQL Query: </Label> <Label For="sqlQeury" HelpText="Enter the query for the SQL server" ResourceKey="SqlQuery">SQL Query: </Label>
</td> </td>
<td> <td>
<textarea id="sqlQeury" class="form-control" @bind="@_sql" rows="5"></textarea> <textarea id="sqlQeury" class="form-control" @bind="@_sql" rows="5"></textarea>
</td> </td>
</tr> </tr>
</table> </table>
<button type="button" class="btn btn-success" @onclick="Execute">Execute</button> <button type="button" class="btn btn-success" @onclick="Execute">@Localizer["Execute"]</button>
<br /><br /> <br />
<br />
@if (!string.IsNullOrEmpty(_results)) @if (!string.IsNullOrEmpty(_results))
{ {
@((MarkupString)_results) @((MarkupString)_results)

View File

@ -1,11 +1,12 @@
@namespace Oqtane.Modules.Admin.SystemInfo @namespace Oqtane.Modules.Admin.SystemInfo
@inherits ModuleBase @inherits ModuleBase
@inject ISystemService SystemService @inject ISystemService SystemService
@inject IStringLocalizer<Index> Localizer
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
<td> <td>
<Label For="version" HelpText="Framework Version">Framework Version: </Label> <Label For="version" HelpText="Framework Version" ResourceKey="FrameworkVersion">Framework Version: </Label>
</td> </td>
<td> <td>
<input id="version" class="form-control" @bind="@_version" readonly /> <input id="version" class="form-control" @bind="@_version" readonly />
@ -13,7 +14,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="runtime" HelpText="Blazor Runtime (Server or WebAssembly)">Blazor Runtime: </Label> <Label For="runtime" HelpText="Blazor Runtime (Server or WebAssembly)" ResourceKey="BlazorRunime">Blazor Runtime: </Label>
</td> </td>
<td> <td>
<input id="runtime" class="form-control" @bind="@_runtime" readonly /> <input id="runtime" class="form-control" @bind="@_runtime" readonly />
@ -21,7 +22,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="clrversion" HelpText="Common Language Runtime Version">CLR Version: </Label> <Label For="clrversion" HelpText="Common Language Runtime Version" ResourceKey="ClrVerion">CLR Version: </Label>
</td> </td>
<td> <td>
<input id="clrversion" class="form-control" @bind="@_clrversion" readonly /> <input id="clrversion" class="form-control" @bind="@_clrversion" readonly />
@ -29,7 +30,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="osversion" HelpText="Operating System Version">OS Version: </Label> <Label For="osversion" HelpText="Operating System Version" ResourceKey="OsVersion">OS Version: </Label>
</td> </td>
<td> <td>
<input id="osversion" class="form-control" @bind="@_osversion" readonly /> <input id="osversion" class="form-control" @bind="@_osversion" readonly />
@ -37,7 +38,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="serverpath" HelpText="Server Path">Server Path: </Label> <Label For="serverpath" HelpText="Server Path" ResourceKey="ServerPath">Server Path: </Label>
</td> </td>
<td> <td>
<input id="serverpath" class="form-control" @bind="@_serverpath" readonly /> <input id="serverpath" class="form-control" @bind="@_serverpath" readonly />
@ -45,14 +46,14 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="servertime" HelpText="Server Time">Server Time: </Label> <Label For="servertime" HelpText="Server Time" ResourceKey="ServerTime">Server Time: </Label>
</td> </td>
<td> <td>
<input id="servertime" class="form-control" @bind="@_servertime" readonly /> <input id="servertime" class="form-control" @bind="@_servertime" readonly />
</td> </td>
</tr> </tr>
</table> </table>
<a class="btn btn-primary" href="swagger/index.html" target="_new">Access Framework API</a> <a class="btn btn-primary" href="swagger/index.html" target="_new">@Localizer["Access Framework API"]</a>
@code { @code {
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host; public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;

View File

@ -1,12 +1,13 @@
@namespace Oqtane.Modules.Admin.Tenants @namespace Oqtane.Modules.Admin.Tenants
@inherits ModuleBase @inherits ModuleBase
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@inject ITenantService TenantService @inject ITenantService TenantService
@inject IStringLocalizer<Edit> Localizer
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
<td> <td>
<Label For="name" HelpText="The name of the tenant">Name: </Label> <Label For="name" HelpText="The name of the tenant" ResourceKey="Name">Name: </Label>
</td> </td>
<td> <td>
@if (name == TenantNames.Master) @if (name == TenantNames.Master)
@ -21,7 +22,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="connectionstring" HelpText="The database connection string">Connection String: </Label> <Label For="connectionstring" HelpText="The database connection string" ResourceKey="ConnectionString">Connection String: </Label>
</td> </td>
<td> <td>
<textarea id="connectionstring" class="form-control" @bind="@connectionstring" rows="3" readonly></textarea> <textarea id="connectionstring" class="form-control" @bind="@connectionstring" rows="3" readonly></textarea>
@ -29,8 +30,8 @@
</tr> </tr>
</table> </table>
<button type="button" class="btn btn-success" @onclick="SaveTenant">Save</button> <button type="button" class="btn btn-success" @onclick="SaveTenant">@Localizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink> <NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
@code { @code {
private int tenantid; private int tenantid;

View File

@ -1,11 +1,12 @@
@namespace Oqtane.Modules.Admin.Tenants @namespace Oqtane.Modules.Admin.Tenants
@inherits ModuleBase @inherits ModuleBase
@inject ITenantService TenantService @inject ITenantService TenantService
@inject IAliasService AliasService @inject IAliasService AliasService
@inject IStringLocalizer<Index> Localizer
@if (tenants == null) @if (tenants == null)
{ {
<p><em>Loading...</em></p> <p><em>@Localizer["Loading..."]</em></p>
} }
else else
{ {
@ -13,11 +14,11 @@ else
<Header> <Header>
<th style="width: 1px;">&nbsp;</th> <th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th> <th style="width: 1px;">&nbsp;</th>
<th>Name</th> <th>@Localizer["Name"]</th>
</Header> </Header>
<Row> <Row>
<td><ActionLink Action="Edit" Parameters="@($"id=" + context.TenantId.ToString())" /></td> <td><ActionLink Action="Edit" Parameters="@($"id=" + context.TenantId.ToString())" ResourceKey="EditTenant" /></td>
<td><ActionDialog Header="Delete Tenant" Message="@("Are You Sure You Wish To Delete The " + context.Name + " Tenant?")" Action="Delete" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await DeleteTenant(context))" Disabled="@(context.Name == TenantNames.Master)" /></td> <td><ActionDialog Header="Delete Tenant" Message="@("Are You Sure You Wish To Delete The " + context.Name + " Tenant?")" Action="Delete" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await DeleteTenant(context))" Disabled="@(context.Name == TenantNames.Master)" ResourceKey="DeleteTenant" /></td>
<td>@context.Name</td> <td>@context.Name</td>
</Row> </Row>
</Pager> </Pager>

View File

@ -1,38 +1,39 @@
@namespace Oqtane.Modules.Admin.Themes @namespace Oqtane.Modules.Admin.Themes
@inherits ModuleBase @inherits ModuleBase
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@inject IFileService FileService @inject IFileService FileService
@inject IThemeService ThemeService @inject IThemeService ThemeService
@inject IPackageService PackageService @inject IPackageService PackageService
@inject IStringLocalizer<Add> Localizer
@if (_packages != null) @if (_packages != null)
{ {
<TabStrip> <TabStrip>
@if (_packages.Count > 0) @if (_packages.Count > 0)
{ {
<TabPanel Name="Download"> <TabPanel Name="Download" ResourceKey="Download">
<ModuleMessage Type="MessageType.Info" Message="Download one or more themes from the list below. Once you are ready click Install to complete the installation."></ModuleMessage> <ModuleMessage Type="MessageType.Info" Message="Download one or more themes from the list below. Once you are ready click Install to complete the installation."></ModuleMessage>
<Pager Items="@_packages"> <Pager Items="@_packages">
<Header> <Header>
<th>Name</th> <th>@Localizer["Name"]</th>
<th>Version</th> <th>@Localizer["Version"]</th>
<th style="width: 1px;"></th> <th style="width: 1px;"></th>
</Header> </Header>
<Row> <Row>
<td>@context.Name</td> <td>@context.Name</td>
<td>@context.Version</td> <td>@context.Version</td>
<td> <td>
<button type="button" class="btn btn-primary" @onclick=@(async () => await DownloadTheme(context.PackageId, context.Version))>Download</button> <button type="button" class="btn btn-primary" @onclick=@(async () => await DownloadTheme(context.PackageId, context.Version))>@Localizer["Download"]</button>
</td> </td>
</Row> </Row>
</Pager> </Pager>
</TabPanel> </TabPanel>
} }
<TabPanel Name="Upload"> <TabPanel Name="Upload" ResourceKey="Upload">
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
<td> <td>
<Label HelpText="Upload one or more theme packages. Once they are uploaded click Install to complete the installation.">Theme: </Label> <Label HelpText="Upload one or more theme packages. Once they are uploaded click Install to complete the installation." ResourceKey="Theme">Theme: </Label>
</td> </td>
<td> <td>
<FileManager Filter="nupkg" ShowFiles="false" Folder="Themes" UploadMultiple="@true" /> <FileManager Filter="nupkg" ShowFiles="false" Folder="Themes" UploadMultiple="@true" />
@ -42,8 +43,8 @@
</TabPanel> </TabPanel>
</TabStrip> </TabStrip>
<button type="button" class="btn btn-success" @onclick="InstallThemes">Install</button> <button type="button" class="btn btn-success" @onclick="InstallThemes">@Localizer["Install"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink> <NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
} }
@code { @code {

View File

@ -1,9 +1,10 @@
@namespace Oqtane.Modules.Admin.Themes @namespace Oqtane.Modules.Admin.Themes
@using System.Net @using System.Net
@inherits ModuleBase @inherits ModuleBase
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@inject IThemeService ThemeService @inject IThemeService ThemeService
@inject IPackageService PackageService @inject IPackageService PackageService
@inject IStringLocalizer<Index> Localizer
@if (_themes == null) @if (_themes == null)
{ {
@ -17,16 +18,16 @@ else
<Header> <Header>
<th style="width: 1px;">&nbsp;</th> <th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th> <th style="width: 1px;">&nbsp;</th>
<th scope="col">Name</th> <th scope="col">@Localizer["Name"]</th>
<th scope="col">Version</th> <th scope="col">@Localizer["Version"]</th>
<th>&nbsp;</th> <th>&nbsp;</th>
</Header> </Header>
<Row> <Row>
<td><ActionLink Action="View" Parameters="@($"name=" + WebUtility.UrlEncode(context.ThemeName))" /></td> <td><ActionLink Action="View" Parameters="@($"name=" + WebUtility.UrlEncode(context.ThemeName))" ResourceKey="ViewTheme" /></td>
<td> <td>
@if (context.AssemblyName != "Oqtane.Client") @if (context.AssemblyName != "Oqtane.Client")
{ {
<ActionDialog Header="Delete Theme" Message="@("Are You Sure You Wish To Delete The " + context.Name + " Theme?")" Action="Delete" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await DeleteTheme(context))" /> <ActionDialog Header="Delete Theme" Message="@("Are You Sure You Wish To Delete The " + context.Name + " Theme?")" Action="Delete" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await DeleteTheme(context))" ResourceKey="DeleteTheme" />
} }
</td> </td>
<td>@context.Name</td> <td>@context.Name</td>
@ -34,7 +35,7 @@ else
<td> <td>
@if (UpgradeAvailable(context.ThemeName, context.Version)) @if (UpgradeAvailable(context.ThemeName, context.Version))
{ {
<button type="button" class="btn btn-success" @onclick=@(async () => await DownloadTheme(context.ThemeName, context.Version))>Upgrade</button> <button type="button" class="btn btn-success" @onclick=@(async () => await DownloadTheme(context.ThemeName, context.Version))>@Localizer["Upgrade"]</button>
} }
</td> </td>
<td></td> <td></td>

View File

@ -1,13 +1,14 @@
@namespace Oqtane.Modules.Admin.Themes @namespace Oqtane.Modules.Admin.Themes
@using System.Net @using System.Net
@inherits ModuleBase @inherits ModuleBase
@inject IThemeService ThemeService @inject IThemeService ThemeService
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@inject IStringLocalizer<View> Localizer
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
<td> <td>
<Label For="name" HelpText="The name of the theme">Name: </Label> <Label For="name" HelpText="The name of the theme" ResourceKey="Name">Name: </Label>
</td> </td>
<td> <td>
<input id="name" class="form-control" @bind="@_name" disabled /> <input id="name" class="form-control" @bind="@_name" disabled />
@ -15,7 +16,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="themename" HelpText="The internal name of the module">Internal Name: </Label> <Label For="themename" HelpText="The internal name of the module" ResourceKey="InternalName">Internal Name: </Label>
</td> </td>
<td> <td>
<input id="themename" class="form-control" @bind="@_themeName" disabled /> <input id="themename" class="form-control" @bind="@_themeName" disabled />
@ -23,7 +24,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="version" HelpText="The version of the thene">Version: </Label> <Label For="version" HelpText="The version of the thene" ResourceKey="Version">Version: </Label>
</td> </td>
<td> <td>
<input id="version" class="form-control" @bind="@_version" disabled /> <input id="version" class="form-control" @bind="@_version" disabled />
@ -31,7 +32,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="owner" HelpText="The owner or creator of the theme">Owner: </Label> <Label For="owner" HelpText="The owner or creator of the theme" ResourceKey="Owner">Owner: </Label>
</td> </td>
<td> <td>
<input id="owner" class="form-control" @bind="@_owner" disabled /> <input id="owner" class="form-control" @bind="@_owner" disabled />
@ -39,7 +40,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="url" HelpText="The reference url of the theme">Reference Url: </Label> <Label For="url" HelpText="The reference url of the theme" ResourceKey="ReferenceUrl">Reference Url: </Label>
</td> </td>
<td> <td>
<input id="url" class="form-control" @bind="@_url" disabled /> <input id="url" class="form-control" @bind="@_url" disabled />
@ -47,7 +48,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="contact" HelpText="The contact for the theme">Contact: </Label> <Label For="contact" HelpText="The contact for the theme" ResourceKey="Contact">Contact: </Label>
</td> </td>
<td> <td>
<input id="contact" class="form-control" @bind="@_contact" disabled /> <input id="contact" class="form-control" @bind="@_contact" disabled />
@ -55,14 +56,14 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="license" HelpText="The license of the theme">License: </Label> <Label For="license" HelpText="The license of the theme" ResourceKey="License">License: </Label>
</td> </td>
<td> <td>
<textarea id="license" class="form-control" @bind="@_license" rows="5" disabled></textarea> <textarea id="license" class="form-control" @bind="@_license" rows="5" disabled></textarea>
</td> </td>
</tr> </tr>
</table> </table>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink> <NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
@code { @code {
private string _themeName = ""; private string _themeName = "";

View File

@ -1,36 +1,37 @@
@namespace Oqtane.Modules.Admin.Upgrade @namespace Oqtane.Modules.Admin.Upgrade
@inherits ModuleBase @inherits ModuleBase
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@inject IFileService FileService @inject IFileService FileService
@inject IPackageService PackageService @inject IPackageService PackageService
@inject IInstallationService InstallationService @inject IInstallationService InstallationService
@inject IStringLocalizer<Index> Localizer
@if (_package != null) @if (_package != null)
{ {
<TabStrip> <TabStrip>
<TabPanel Name="Download"> <TabPanel Name="Download" ResourceKey="Download">
@if (_upgradeavailable) @if (_upgradeavailable)
{ {
<ModuleMessage Type="MessageType.Info" Message="Select The Upgrade Button To Install a New Framework Version"></ModuleMessage> <ModuleMessage Type="MessageType.Info" Message="Select The Upgrade Button To Install a New Framework Version"></ModuleMessage>
<button type="button" class="btn btn-success" @onclick=@(async () => await Download(Constants.PackageId, @_package.Version))>Upgrade To @_package.Version</button> <button type="button" class="btn btn-success" @onclick=@(async () => await Download(Constants.PackageId, @_package.Version))>@Localizer["Upgrade To"] @_package.Version</button>
} }
else else
{ {
<ModuleMessage Type="MessageType.Info" Message="Framework Is Already Up To Date"></ModuleMessage> <ModuleMessage Type="MessageType.Info" Message="Framework Is Already Up To Date"></ModuleMessage>
} }
</TabPanel> </TabPanel>
<TabPanel Name="Upload"> <TabPanel Name="Upload" ResourceKey="Upload">
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
<td> <td>
<Label HelpText="Upload a framework package and select Install to complete the installation">Framework: </Label> <Label HelpText="Upload a framework package and select Install to complete the installation" ResourceKey="Framework">Framework: </Label>
</td> </td>
<td> <td>
<FileManager Filter="nupkg" ShowFiles="false" Folder="Framework" /> <FileManager Filter="nupkg" ShowFiles="false" Folder="Framework" />
</td> </td>
</tr> </tr>
</table> </table>
<button type="button" class="btn btn-success" @onclick="Upgrade">Install</button> <button type="button" class="btn btn-success" @onclick="Upgrade">@Localizer["Install"]</button>
</TabPanel> </TabPanel>
</TabStrip> </TabStrip>
} }

View File

@ -1,15 +1,16 @@
@namespace Oqtane.Modules.Admin.UserProfile @namespace Oqtane.Modules.Admin.UserProfile
@inherits ModuleBase @inherits ModuleBase
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@inject IUserService UserService @inject IUserService UserService
@inject INotificationService NotificationService @inject INotificationService NotificationService
@inject IStringLocalizer<Add> Localizer
@if (PageState.User != null) @if (PageState.User != null)
{ {
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
<td> <td>
<Label For="to" HelpText="Enter the username you wish to send a message to">To: </Label> <Label For="to" HelpText="Enter the username you wish to send a message to" ResourceKey="To">To: </Label>
</td> </td>
<td> <td>
<input id="to" class="form-control" @bind="@username" /> <input id="to" class="form-control" @bind="@username" />
@ -17,7 +18,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="subject" HelpText="Enter the subject of the message">Subject: </Label> <Label For="subject" HelpText="Enter the subject of the message" ResourceKey="Subject">Subject: </Label>
</td> </td>
<td> <td>
<input id="subject" class="form-control" @bind="@subject" /> <input id="subject" class="form-control" @bind="@subject" />
@ -25,15 +26,15 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="message" HelpText="Enter the message">Message: </Label> <Label For="message" HelpText="Enter the message" ResourceKey="Message">Message: </Label>
</td> </td>
<td> <td>
<textarea id="message" class="form-control" @bind="@body" rows="5" /> <textarea id="message" class="form-control" @bind="@body" rows="5" />
</td> </td>
</tr> </tr>
</table> </table>
<button type="button" class="btn btn-primary" @onclick="Send">Send</button> <button type="button" class="btn btn-primary" @onclick="Send">@Localizer["Send"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink> <NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
} }
@code { @code {

View File

@ -5,6 +5,7 @@
@inject IProfileService ProfileService @inject IProfileService ProfileService
@inject ISettingService SettingService @inject ISettingService SettingService
@inject INotificationService NotificationService @inject INotificationService NotificationService
@inject IStringLocalizer<Index> Localizer
@if (PageState.User != null && photofileid != -1) @if (PageState.User != null && photofileid != -1)
{ {
@ -15,13 +16,13 @@ else
<br /> <br />
} }
<TabStrip> <TabStrip>
<TabPanel Name="Identity"> <TabPanel Name="Identity" ResourceKey="Identity">
@if (PageState.User != null) @if (PageState.User != null)
{ {
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
<td> <td>
<label for="Name" class="control-label">Username: </label> <label for="Name" class="control-label">@Localizer["Username:"] </label>
</td> </td>
<td> <td>
<input class="form-control" @bind="@username" readonly /> <input class="form-control" @bind="@username" readonly />
@ -29,7 +30,7 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<label for="Name" class="control-label">Password: </label> <label for="Name" class="control-label">@Localizer["Password:"] </label>
</td> </td>
<td> <td>
<input type="password" class="form-control" @bind="@password" autocomplete="new-password" /> <input type="password" class="form-control" @bind="@password" autocomplete="new-password" />
@ -37,7 +38,7 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<label for="Name" class="control-label">Confirm Password: </label> <label for="Name" class="control-label">@Localizer["Confirm Password:"] </label>
</td> </td>
<td> <td>
<input type="password" class="form-control" @bind="@confirm" autocomplete="new-password" /> <input type="password" class="form-control" @bind="@confirm" autocomplete="new-password" />
@ -45,7 +46,7 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<label for="Name" class="control-label">Email: </label> <label for="Name" class="control-label">@Localizer["Email:"] </label>
</td> </td>
<td> <td>
<input class="form-control" @bind="@email" /> <input class="form-control" @bind="@email" />
@ -53,7 +54,7 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<label for="Name" class="control-label">Full Name: </label> <label for="Name" class="control-label">@Localizer["Full Name:"] </label>
</td> </td>
<td> <td>
<input class="form-control" @bind="@displayname" /> <input class="form-control" @bind="@displayname" />
@ -61,18 +62,18 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<label for="Name" class="control-label">Photo: </label> <label for="Name" class="control-label">@Localizer["Photo:"] </label>
</td> </td>
<td> <td>
<FileManager FileId="@photofileid" @ref="filemanager" /> <FileManager FileId="@photofileid" @ref="filemanager" />
</td> </td>
</tr> </tr>
</table> </table>
<button type="button" class="btn btn-primary" @onclick="Save">Save</button> <button type="button" class="btn btn-primary" @onclick="Save">@Localizer["Save"]</button>
<button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button> <button type="button" class="btn btn-secondary" @onclick="Cancel">@Localizer["Cancel"]</button>
} }
</TabPanel> </TabPanel>
<TabPanel Name="Profile"> <TabPanel Name="Profile" ResourceKey="Profile">
@if (profiles != null && settings != null) @if (profiles != null && settings != null)
{ {
<table class="table table-borderless"> <table class="table table-borderless">
@ -127,14 +128,14 @@ else
} }
} }
</table> </table>
<button type="button" class="btn btn-primary" @onclick="Save">Save</button> <button type="button" class="btn btn-primary" @onclick="Save">@Localizer["Save"]</button>
<button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button> <button type="button" class="btn btn-secondary" @onclick="Cancel">@Localizer["Cancel"]</button>
} }
</TabPanel> </TabPanel>
<TabPanel Name="Notifications"> <TabPanel Name="Notifications" ResourceKey="Notifications">
@if (notifications != null) @if (notifications != null)
{ {
<ActionLink Action="Add" Text="Send Notification" Security="SecurityAccessLevel.View" EditMode="false" /> <ActionLink Action="Add" Text="Send Notification" Security="SecurityAccessLevel.View" EditMode="false" ResourceKey="SendNotification" />
<br /><br /> <br /><br />
@if (filter == "to") @if (filter == "to")
{ {
@ -142,13 +143,13 @@ else
<Header> <Header>
<th style="width: 1px;">&nbsp;</th> <th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th> <th style="width: 1px;">&nbsp;</th>
<th>From</th> <th>@Localizer["From"]</th>
<th>Subject</th> <th>@Localizer["Subject"]</th>
<th>Received</th> <th>@Localizer["Received"]</th>
</Header> </Header>
<Row> <Row>
<td><ActionLink Action="View" Parameters="@($"id=" + context.NotificationId.ToString())" Security="SecurityAccessLevel.View" EditMode="false" /></td> <td><ActionLink Action="View" Parameters="@($"id=" + context.NotificationId.ToString())" Security="SecurityAccessLevel.View" EditMode="false" ResourceKey="ViewNotification" /></td>
<td><ActionDialog Header="Delete Notification" Message="@("Are You Sure You Wish To Delete This Notification?")" Action="Delete" Security="SecurityAccessLevel.View" Class="btn btn-danger" OnClick="@(async () => await Delete(context))" EditMode="false" /></td> <td><ActionDialog Header="Delete Notification" Message="@("Are You Sure You Wish To Delete This Notification?")" Action="Delete" Security="SecurityAccessLevel.View" Class="btn btn-danger" OnClick="@(async () => await Delete(context))" EditMode="false" ResourceKey="DeleteNotification" /></td>
<td>@context.FromDisplayName</td> <td>@context.FromDisplayName</td>
<td>@context.Subject</td> <td>@context.Subject</td>
<td>@context.CreatedOn</td> <td>@context.CreatedOn</td>
@ -174,13 +175,13 @@ else
<Header> <Header>
<th>&nbsp;</th> <th>&nbsp;</th>
<th>&nbsp;</th> <th>&nbsp;</th>
<th>To</th> <th>@Localizer["To"]</th>
<th>Subject</th> <th>@Localizer["Subject"]</th>
<th>Sent</th> <th>@Localizer["Sent"]</th>
</Header> </Header>
<Row> <Row>
<td><ActionLink Action="View" Parameters="@($"id=" + context.NotificationId.ToString())" Security="SecurityAccessLevel.View" EditMode="false" /></td> <td><ActionLink Action="View" Parameters="@($"id=" + context.NotificationId.ToString())" Security="SecurityAccessLevel.View" EditMode="false" ResourceKey="ViewNotification" /></td>
<td><ActionDialog Header="Delete Notification" Message="@("Are You Sure You Wish To Delete This Notification?")" Action="Delete" Security="SecurityAccessLevel.View" Class="btn btn-danger" OnClick="@(async () => await Delete(context))" EditMode="false" /></td> <td><ActionDialog Header="Delete Notification" Message="@("Are You Sure You Wish To Delete This Notification?")" Action="Delete" Security="SecurityAccessLevel.View" Class="btn btn-danger" OnClick="@(async () => await Delete(context))" EditMode="false" ResourceKey="DeleteNotification" /></td>
<td>@context.ToDisplayName</td> <td>@context.ToDisplayName</td>
<td>@context.Subject</td> <td>@context.Subject</td>
<td>@context.CreatedOn</td> <td>@context.CreatedOn</td>
@ -202,8 +203,8 @@ else
} }
<br /><hr /> <br /><hr />
<select class="form-control" @onchange="(e => FilterChanged(e))"> <select class="form-control" @onchange="(e => FilterChanged(e))">
<option value="to">Inbox</option> <option value="to">@Localizer["Inbox"]</option>
<option value="from">Sent Items</option> <option value="from">@Localizer["Sent Items"]</option>
</select> </select>
} }
</TabPanel> </TabPanel>

View File

@ -1,8 +1,9 @@
@namespace Oqtane.Modules.Admin.UserProfile @namespace Oqtane.Modules.Admin.UserProfile
@inherits ModuleBase @inherits ModuleBase
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@inject IUserService UserService @inject IUserService UserService
@inject INotificationService NotificationService @inject INotificationService NotificationService
@inject IStringLocalizer<View> Localizer
@if (PageState.User != null) @if (PageState.User != null)
{ {
@ -26,7 +27,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<label class="control-label">Subject: </label> <label class="control-label">@Localizer["Subject:"] </label>
</td> </td>
@if (title == "From") @if (title == "From")
{ {
@ -45,7 +46,7 @@
{ {
<tr> <tr>
<td> <td>
<label class="control-label">Date: </label> <label class="control-label">@Localizer["Date:"] </label>
</td> </td>
<td> <td>
<input class="form-control" @bind="@createdon" readonly /> <input class="form-control" @bind="@createdon" readonly />
@ -56,7 +57,7 @@
{ {
<tr> <tr>
<td> <td>
<label class="control-label">Message: </label> <label class="control-label">@Localizer["Message:"] </label>
</td> </td>
<td> <td>
<textarea class="form-control" @bind="@body" rows="5" readonly /> <textarea class="form-control" @bind="@body" rows="5" readonly />
@ -67,7 +68,7 @@
{ {
<tr> <tr>
<td> <td>
<label class="control-label">Message: </label> <label class="control-label">@Localizer["Message:"] </label>
</td> </td>
<td> <td>
<textarea class="form-control" @bind="@body" rows="5" /> <textarea class="form-control" @bind="@body" rows="5" />
@ -79,24 +80,26 @@
@if (reply != string.Empty) @if (reply != string.Empty)
{ {
<button type="button" class="btn btn-primary" @onclick="Send">Send</button> } <button type="button" class="btn btn-primary" @onclick="Send">@Localizer["Send"]</button>
}
else else
{ {
if (title == "From") if (title == "From")
{ {
<button type="button" class="btn btn-primary" @onclick="Reply">Reply</button>} <button type="button" class="btn btn-primary" @onclick="Reply">@Localizer["Reply"]</button>
} }
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink> }
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
<br /> <br />
<br /> <br />
@if (title == "To") @if (title == "To")
{ {
<div class="control-group"> <div class="control-group">
<label class="control-label">Original Message </label> <label class="control-label">@Localizer["Original Message"] </label>
<textarea class="form-control" @bind="@reply" rows="5" readonly /> <textarea class="form-control" @bind="@reply" rows="5" readonly />
</div> </div>
} }
} }
@code { @code {
private int notificationid; private int notificationid;

View File

@ -1,26 +1,27 @@
@namespace Oqtane.Modules.Admin.Users @namespace Oqtane.Modules.Admin.Users
@inherits ModuleBase @inherits ModuleBase
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@inject IUserService UserService @inject IUserService UserService
@inject IProfileService ProfileService @inject IProfileService ProfileService
@inject ISettingService SettingService @inject ISettingService SettingService
@inject IStringLocalizer<Add> Localizer
<TabStrip> <TabStrip>
<TabPanel Name="Identity"> <TabPanel Name="Identity" ResourceKey="Identity">
@if (profiles != null) @if (profiles != null)
{ {
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
<td> <td>
<label class="control-label">Username: </label> <label class="control-label">@Localizer["Username:"] </label>
</td> </td>
<td> <td>
<input class="form-control" @bind="@username" /> <input class="form-control" @bind="@username" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<label class="control-label">Password: </label> <label class="control-label">@Localizer["Password:"] </label>
</td> </td>
<td> <td>
<input type="password" class="form-control" @bind="@password" /> <input type="password" class="form-control" @bind="@password" />
@ -28,7 +29,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<label class="control-label">Confirm Password: </label> <label class="control-label">@Localizer["Confirm Password:"] </label>
</td> </td>
<td> <td>
<input type="password" class="form-control" @bind="@confirm" /> <input type="password" class="form-control" @bind="@confirm" />
@ -36,7 +37,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<label class="control-label">Email: </label> <label class="control-label">@Localizer["Email:"] </label>
</td> </td>
<td> <td>
<input class="form-control" @bind="@email" /> <input class="form-control" @bind="@email" />
@ -44,7 +45,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<label class="control-label">Full Name: </label> <label class="control-label">@Localizer["Full Name:"] </label>
</td> </td>
<td> <td>
<input class="form-control" @bind="@displayname" /> <input class="form-control" @bind="@displayname" />
@ -53,7 +54,7 @@
</table> </table>
} }
</TabPanel> </TabPanel>
<TabPanel Name="Profile"> <TabPanel Name="Profile" ResourceKey="Profile">
@if (profiles != null) @if (profiles != null)
{ {
<table class="table table-borderless"> <table class="table table-borderless">
@ -90,8 +91,8 @@
</TabPanel> </TabPanel>
</TabStrip> </TabStrip>
<button type="button" class="btn btn-primary" @onclick="SaveUser">Save</button> <button type="button" class="btn btn-primary" @onclick="SaveUser">@Localizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink> <NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
@code { @code {
private string username = string.Empty; private string username = string.Empty;

View File

@ -1,9 +1,10 @@
@namespace Oqtane.Modules.Admin.Users @namespace Oqtane.Modules.Admin.Users
@inherits ModuleBase @inherits ModuleBase
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@inject IUserService UserService @inject IUserService UserService
@inject IProfileService ProfileService @inject IProfileService ProfileService
@inject ISettingService SettingService @inject ISettingService SettingService
@inject IStringLocalizer<Edit> Localizer
@if (PageState.User != null && photofileid != -1) @if (PageState.User != null && photofileid != -1)
{ {
@ -14,13 +15,13 @@ else
<br /> <br />
} }
<TabStrip> <TabStrip>
<TabPanel Name="Identity"> <TabPanel Name="Identity" ResourceKey="Identity">
@if (profiles != null) @if (profiles != null)
{ {
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
<td> <td>
<label class="control-label">Username: </label> <label class="control-label">@Localizer["Username:"] </label>
</td> </td>
<td> <td>
<input class="form-control" @bind="@username" readonly /> <input class="form-control" @bind="@username" readonly />
@ -28,7 +29,7 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<label class="control-label">Password: </label> <label class="control-label">@Localizer["Password:"] </label>
</td> </td>
<td> <td>
<input type="password" class="form-control" @bind="@password" /> <input type="password" class="form-control" @bind="@password" />
@ -36,7 +37,7 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<label class="control-label">Confirm Password: </label> <label class="control-label">@Localizer["Confirm Password:"] </label>
</td> </td>
<td> <td>
<input type="password" class="form-control" @bind="@confirm" /> <input type="password" class="form-control" @bind="@confirm" />
@ -44,7 +45,7 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<label class="control-label">Email: </label> <label class="control-label">@Localizer["Email:"] </label>
</td> </td>
<td> <td>
<input class="form-control" @bind="@email" /> <input class="form-control" @bind="@email" />
@ -52,7 +53,7 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<label class="control-label">Full Name: </label> <label class="control-label">@Localizer["Full Name:"] </label>
</td> </td>
<td> <td>
<input class="form-control" @bind="@displayname" /> <input class="form-control" @bind="@displayname" />
@ -60,7 +61,7 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<label class="control-label">Photo: </label> <label class="control-label">@Localizer["Photo:"] </label>
</td> </td>
<td> <td>
<FileManager FileId="@photofileid" @ref="filemanager" /> <FileManager FileId="@photofileid" @ref="filemanager" />
@ -68,19 +69,19 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<label class="control-label">Is Deleted? </label> <label class="control-label">@Localizer["Is Deleted?"] </label>
</td> </td>
<td> <td>
<select class="form-control" @bind="@isdeleted"> <select class="form-control" @bind="@isdeleted">
<option value="True">Yes</option> <option value="True">@Localizer["Yes"]</option>
<option value="False">No</option> <option value="False">@Localizer["No"]</option>
</select> </select>
</td> </td>
</tr> </tr>
</table> </table>
} }
</TabPanel> </TabPanel>
<TabPanel Name="Profile"> <TabPanel Name="Profile" ResourceKey="Profile">
@if (profiles != null) @if (profiles != null)
{ {
<table class="table table-borderless"> <table class="table table-borderless">
@ -117,9 +118,10 @@ else
</TabPanel> </TabPanel>
</TabStrip> </TabStrip>
<button type="button" class="btn btn-primary" @onclick="SaveUser">Save</button> <button type="button" class="btn btn-primary" @onclick="SaveUser">@Localizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink> <NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
<br /><br /> <br />
<br />
<AuditInfo CreatedBy="@createdby" CreatedOn="@createdon" ModifiedBy="@modifiedby" ModifiedOn="@modifiedon" DeletedBy="@deletedby" DeletedOn="@deletedon"></AuditInfo> <AuditInfo CreatedBy="@createdby" CreatedOn="@createdon" ModifiedBy="@modifiedby" ModifiedOn="@modifiedon" DeletedBy="@deletedby" DeletedOn="@deletedon"></AuditInfo>
@code { @code {

View File

@ -1,21 +1,22 @@
@namespace Oqtane.Modules.Admin.Users @namespace Oqtane.Modules.Admin.Users
@inherits ModuleBase @inherits ModuleBase
@inject IUserRoleService UserRoleService @inject IUserRoleService UserRoleService
@inject IUserService UserService @inject IUserService UserService
@inject ISettingService SettingService @inject ISettingService SettingService
@inject IStringLocalizer<Index> Localizer
@if (userroles == null) @if (userroles == null)
{ {
<p> <p>
<em>Loading...</em> <em>@Localizer["Loading..."]</em>
</p> </p>
} }
else else
{ {
<ActionLink Action="Add" Text="Add User"/> <ActionLink Action="Add" Text="Add User" ResourceKey="AddUser" />
<div class="d-flex p-1"> <div class="d-flex p-1">
<input class="form-control mr-4" @bind="@_search"/><button class="btn btn-outline-primary ml-1" @onclick="OnSearch">Search</button> <input class="form-control mr-4" @bind="@_search" /><button class="btn btn-outline-primary ml-1" @onclick="OnSearch">@Localizer["Search"]</button>
</div> </div>
<Pager Items="@userroles"> <Pager Items="@userroles">
@ -23,17 +24,17 @@ else
<th style="width: 1px;">&nbsp;</th> <th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th> <th style="width: 1px;">&nbsp;</th>
<th style="width: 1px;">&nbsp;</th> <th style="width: 1px;">&nbsp;</th>
<th>Name</th> <th>@Localizer["Name"]</th>
</Header> </Header>
<Row> <Row>
<td> <td>
<ActionLink Action="Edit" Parameters="@($"id=" + context.UserId.ToString())"/> <ActionLink Action="Edit" Parameters="@($"id=" + context.UserId.ToString())" ResourceKey="EditUser" />
</td> </td>
<td> <td>
<ActionDialog Header="Delete User" Message="@("Are You Sure You Wish To Delete " + context.User.DisplayName + "?")" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteUser(context))"/> <ActionDialog Header="Delete User" Message="@("Are You Sure You Wish To Delete " + context.User.DisplayName + "?")" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteUser(context))" ResourceKey="DeleteUser" />
</td> </td>
<td> <td>
<ActionLink Action="Roles" Parameters="@($"id=" + context.UserId.ToString())"/> <ActionLink Action="Roles" Parameters="@($"id=" + context.UserId.ToString())" ResourceKey="Roles" />
</td> </td>
<td>@context.User.DisplayName</td> <td>@context.User.DisplayName</td>
</Row> </Row>

View File

@ -1,19 +1,20 @@
@namespace Oqtane.Modules.Admin.Users @namespace Oqtane.Modules.Admin.Users
@inherits ModuleBase @inherits ModuleBase
@inject IRoleService RoleService @inject IRoleService RoleService
@inject IUserService UserService @inject IUserService UserService
@inject IUserRoleService UserRoleService @inject IUserRoleService UserRoleService
@inject IStringLocalizer<Roles> Localizer
@if (userroles == null) @if (userroles == null)
{ {
<p><em>Loading...</em></p> <p><em>@Localizer["Loading..."]</em></p>
} }
else else
{ {
<table class="table table-borderless"> <table class="table table-borderless">
<tr> <tr>
<td> <td>
<Label For="user" HelpText="The user you are assigning roles to">User: </Label> <Label For="user" HelpText="The user you are assigning roles to" resource="User">User: </Label>
</td> </td>
<td> <td>
<input id="user" class="form-control" @bind="@name" disabled /> <input id="user" class="form-control" @bind="@name" disabled />
@ -21,7 +22,7 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="role" HelpText="Select a role">Role: </Label> <Label For="role" HelpText="Select a role" ResourceKey="Role">Role: </Label>
</td> </td>
<td> <td>
<select id="role" class="form-control" @bind="@roleid"> <select id="role" class="form-control" @bind="@roleid">
@ -35,7 +36,7 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="effectiveDate" HelpText="The date that this role assignment is active">Effective Date: </Label> <Label For="effectiveDate" HelpText="The date that this role assignment is active" resource="EffectiveDate">Effective Date: </Label>
</td> </td>
<td> <td>
<input id="effectiveDate" class="form-control" @bind="@effectivedate" /> <input id="effectiveDate" class="form-control" @bind="@effectivedate" />
@ -43,21 +44,21 @@ else
</tr> </tr>
<tr> <tr>
<td> <td>
<Label For="expiryDate" HelpText="The date that this role assignment expires">Expiry Date: </Label> <Label For="expiryDate" HelpText="The date that this role assignment expires" ResourceKey="ExpiryDate">Expiry Date: </Label>
</td> </td>
<td> <td>
<input id="expiryDate" class="form-control" @bind="@expirydate" /> <input id="expiryDate" class="form-control" @bind="@expirydate" />
</td> </td>
</tr> </tr>
</table> </table>
<button type="button" class="btn btn-success" @onclick="SaveUserRole">Save</button> <button type="button" class="btn btn-success" @onclick="SaveUserRole">@Localizer["Save"]</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink> <NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
<hr class="app-rule" /> <hr class="app-rule" />
<p align="center"> <p align="center">
<Pager Items="@userroles"> <Pager Items="@userroles">
<Header> <Header>
<th>Roles</th> <th>@Localizer["Roles"]</th>
<th>&nbsp;</th> <th>&nbsp;</th>
</Header> </Header>
<Row> <Row>
@ -65,7 +66,7 @@ else
<td> <td>
@if (context.Role.Name != RoleNames.Registered) @if (context.Role.Name != RoleNames.Registered)
{ {
<button type="button" class="btn btn-danger" @onclick=@(async () => await DeleteUserRole(context.UserRoleId))>Delete</button> <button type="button" class="btn btn-danger" @onclick=@(async () => await DeleteUserRole(context.UserRoleId))>@Localizer["Delete"]</button>
} }
</td> </td>
</Row> </Row>

View File

@ -99,8 +99,8 @@
if (IsLocalizable) if (IsLocalizable)
{ {
Header = Localize(nameof(Header)); Header = Localize(nameof(Header), Header);
Message = Localize(nameof(Message)); Message = Localize(nameof(Message), Message);
} }
_authorized = IsAuthorized(); _authorized = IsAuthorized();

View File

@ -44,9 +44,15 @@ else
_openLabel += ">"; _openLabel += ">";
if (IsLocalizable) if (IsLocalizable)
{
var value = Localize("Text");
var key = $"{ResourceKey}.Text";
if (!value.Equals(key))
{ {
ChildContent =@<text>@Localize("Text")</text>; ChildContent =@<text>@Localize("Text")</text>;
HelpText = Localize(nameof(HelpText)); }
HelpText = Localize(nameof(HelpText), HelpText);
} }
} }
} }

View File

@ -28,6 +28,21 @@ namespace Oqtane.Modules.Controls
return _localizer?[key] ?? name; return _localizer?[key] ?? name;
} }
protected string Localize(string name, string defaultValue)
{
var key = $"{ResourceKey}.{name}";
var value = Localize(name);
if (value == key)
{
return defaultValue;
}
else
{
return value;
}
}
protected override void OnParametersSet() protected override void OnParametersSet()
{ {
if (!String.IsNullOrEmpty(ResourceKey)) if (!String.IsNullOrEmpty(ResourceKey))

View File

@ -49,8 +49,8 @@
if (IsLocalizable) if (IsLocalizable)
{ {
_heading = !string.IsNullOrEmpty(Heading) _heading = !string.IsNullOrEmpty(Heading)
? Localize(nameof(Heading)) ? Localize(nameof(Heading), Heading)
: Localize(nameof(Name)); : Localize(nameof(Name), Name);
} }
} }
} }

View File

@ -44,11 +44,11 @@ else
{ {
if (string.IsNullOrEmpty(Heading)) if (string.IsNullOrEmpty(Heading))
{ {
Name = Localize(nameof(Name)); Name = Localize(nameof(Name), Name);
} }
else else
{ {
Heading = Localize(nameof(Heading)); Heading = Localize(nameof(Heading), Heading);
} }
} }
} }

View File

@ -1,10 +1,10 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop; using Microsoft.JSInterop;
using Oqtane.Providers; using Oqtane.Providers;
using Oqtane.Services; using Oqtane.Services;
using Oqtane.UI; using Oqtane.Shared;
namespace Oqtane.Themes.Controls namespace Oqtane.Themes.Controls
{ {

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Oqtane.Models; using Oqtane.Models;
@ -19,6 +19,6 @@ namespace Oqtane.UI
public string Action { get; set; } public string Action { get; set; }
public bool EditMode { get; set; } public bool EditMode { get; set; }
public DateTime LastSyncDate { get; set; } public DateTime LastSyncDate { get; set; }
public Runtime Runtime { get; set; } public Oqtane.Shared.Runtime Runtime { get; set; }
} }
} }

View File

@ -1,5 +1,8 @@
namespace Oqtane.UI using System;
namespace Oqtane.UI
{ {
[Obsolete("This enum is deprecated and will be removed in the upcoming major release, please use Oqtane.Shared.Runtime instead.")]
public enum Runtime public enum Runtime
{ {
Server, Server,

View File

@ -549,8 +549,8 @@
return pageresources; return pageresources;
} }
private Runtime GetRuntime() private Oqtane.Shared.Runtime GetRuntime()
=> RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER")) => RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER"))
? Runtime.WebAssembly ? Oqtane.Shared.Runtime.WebAssembly
: Runtime.Server; : Oqtane.Shared.Runtime.Server;
} }

View File

@ -7,6 +7,7 @@
@using Microsoft.AspNetCore.Components.Authorization @using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.AspNetCore.Components.Routing @using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web @using Microsoft.AspNetCore.Components.Web
@using Microsoft.Extensions.Localization
@using Microsoft.JSInterop @using Microsoft.JSInterop
@using Oqtane.Models @using Oqtane.Models

View File

@ -8,7 +8,6 @@ using Oqtane.Infrastructure;
using Oqtane.Modules; using Oqtane.Modules;
using Oqtane.Services; using Oqtane.Services;
using Oqtane.Shared; using Oqtane.Shared;
using Oqtane.UI;
// ReSharper disable once CheckNamespace // ReSharper disable once CheckNamespace
namespace Microsoft.Extensions.DependencyInjection namespace Microsoft.Extensions.DependencyInjection

View File

@ -21,7 +21,6 @@ using Oqtane.Repository;
using Oqtane.Security; using Oqtane.Security;
using Oqtane.Services; using Oqtane.Services;
using Oqtane.Shared; using Oqtane.Shared;
using Oqtane.UI;
namespace Oqtane namespace Oqtane
{ {

View File

@ -0,0 +1,8 @@
namespace Oqtane.Shared
{
public enum Runtime
{
Server,
WebAssembly
}
}