Localize non components in users pages
This commit is contained in:
		@ -4,6 +4,7 @@
 | 
			
		||||
@inject IUserService UserService
 | 
			
		||||
@inject IProfileService ProfileService
 | 
			
		||||
@inject ISettingService SettingService
 | 
			
		||||
@inject IStringLocalizer<Add> Localizer
 | 
			
		||||
 | 
			
		||||
<TabStrip>
 | 
			
		||||
    <TabPanel Name="Identity" ResourceKey="Identity">
 | 
			
		||||
@ -12,15 +13,15 @@
 | 
			
		||||
            <table class="table table-borderless">
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <label class="control-label">Username: </label>
 | 
			
		||||
                    </td>
 | 
			
		||||
                        <label class="control-label">@Localizer["Username:"] </label>
 | 
			
		||||
</td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <input class="form-control" @bind="@username" />
 | 
			
		||||
                    </td>
 | 
			
		||||
                </tr>
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <label class="control-label">Password: </label>
 | 
			
		||||
                        <label class="control-label">@Localizer["Password:"] </label>
 | 
			
		||||
                    </td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <input type="password" class="form-control" @bind="@password" />
 | 
			
		||||
@ -28,7 +29,7 @@
 | 
			
		||||
                </tr>
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <label class="control-label">Confirm Password: </label>
 | 
			
		||||
                        <label class="control-label">@Localizer["Confirm Password:"] </label>
 | 
			
		||||
                    </td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <input type="password" class="form-control" @bind="@confirm" />
 | 
			
		||||
@ -36,7 +37,7 @@
 | 
			
		||||
                </tr>
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <label class="control-label">Email: </label>
 | 
			
		||||
                        <label class="control-label">@Localizer["Email:"] </label>
 | 
			
		||||
                    </td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <input class="form-control" @bind="@email" />
 | 
			
		||||
@ -44,7 +45,7 @@
 | 
			
		||||
                </tr>
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <label class="control-label">Full Name: </label>
 | 
			
		||||
                        <label class="control-label">@Localizer["Full Name:"] </label>
 | 
			
		||||
                    </td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <input class="form-control" @bind="@displayname" />
 | 
			
		||||
@ -56,42 +57,42 @@
 | 
			
		||||
    <TabPanel Name="Profile" ResourceKey="Profile">
 | 
			
		||||
        @if (profiles != null)
 | 
			
		||||
        {
 | 
			
		||||
        <table class="table table-borderless">
 | 
			
		||||
            @foreach (Profile profile in profiles)
 | 
			
		||||
            {
 | 
			
		||||
                var p = profile;
 | 
			
		||||
                if (p.Category != category)
 | 
			
		||||
            <table class="table table-borderless">
 | 
			
		||||
                @foreach (Profile profile in profiles)
 | 
			
		||||
                {
 | 
			
		||||
                    var p = profile;
 | 
			
		||||
                    if (p.Category != category)
 | 
			
		||||
                    {
 | 
			
		||||
                        <tr>
 | 
			
		||||
                            <th colspan="2" style="text-align: center;">
 | 
			
		||||
                                @p.Category
 | 
			
		||||
                            </th>
 | 
			
		||||
                        </tr>
 | 
			
		||||
                        category = p.Category;
 | 
			
		||||
                    }
 | 
			
		||||
                    <tr>
 | 
			
		||||
                        <th colspan="2" style="text-align: center;">
 | 
			
		||||
                            @p.Category
 | 
			
		||||
                        </th>
 | 
			
		||||
                        <td>
 | 
			
		||||
                            <Label For="@p.Name" HelpText="@p.Description">@p.Title</Label>
 | 
			
		||||
                        </td>
 | 
			
		||||
                        <td>
 | 
			
		||||
                            @if (p.IsRequired)
 | 
			
		||||
                            {
 | 
			
		||||
                                <input id="@p.Name" class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" required @onchange="@(e => ProfileChanged(e, p.Name))" />
 | 
			
		||||
                            }
 | 
			
		||||
                            else
 | 
			
		||||
                            {
 | 
			
		||||
                                <input id="@p.Name" class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" @onchange="@(e => ProfileChanged(e, p.Name))" />
 | 
			
		||||
                            }
 | 
			
		||||
                        </td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                    category = p.Category;
 | 
			
		||||
                }
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <Label For="@p.Name" HelpText="@p.Description">@p.Title</Label>
 | 
			
		||||
                    </td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        @if (p.IsRequired)
 | 
			
		||||
                        {
 | 
			
		||||
                            <input id="@p.Name" class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" required @onchange="@(e => ProfileChanged(e, p.Name))" />
 | 
			
		||||
                        }
 | 
			
		||||
                        else
 | 
			
		||||
                        {
 | 
			
		||||
                            <input id="@p.Name" class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" @onchange="@(e => ProfileChanged(e, p.Name))" />
 | 
			
		||||
                        }
 | 
			
		||||
                    </td>
 | 
			
		||||
                </tr>
 | 
			
		||||
            }
 | 
			
		||||
        </table>
 | 
			
		||||
            </table>
 | 
			
		||||
        }
 | 
			
		||||
    </TabPanel>
 | 
			
		||||
</TabStrip>
 | 
			
		||||
 | 
			
		||||
<button type="button" class="btn btn-primary" @onclick="SaveUser">Save</button>
 | 
			
		||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
 | 
			
		||||
<button type="button" class="btn btn-primary" @onclick="SaveUser">@Localizer["Save"]</button>
 | 
			
		||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
 | 
			
		||||
 | 
			
		||||
@code {
 | 
			
		||||
    private string username = string.Empty;
 | 
			
		||||
@ -185,7 +186,7 @@
 | 
			
		||||
        }
 | 
			
		||||
        return valid;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    private void ProfileChanged(ChangeEventArgs e, string SettingName)
 | 
			
		||||
    {
 | 
			
		||||
        var value = (string)e.Value;
 | 
			
		||||
 | 
			
		||||
@ -4,6 +4,7 @@
 | 
			
		||||
@inject IUserService UserService
 | 
			
		||||
@inject IProfileService ProfileService
 | 
			
		||||
@inject ISettingService SettingService
 | 
			
		||||
@inject IStringLocalizer<Edit> Localizer
 | 
			
		||||
 | 
			
		||||
@if (PageState.User != null && photofileid != -1)
 | 
			
		||||
{
 | 
			
		||||
@ -20,7 +21,7 @@ else
 | 
			
		||||
            <table class="table table-borderless">
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <label class="control-label">Username: </label>
 | 
			
		||||
                        <label class="control-label">@Localizer["Username:"] </label>
 | 
			
		||||
                    </td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <input class="form-control" @bind="@username" readonly />
 | 
			
		||||
@ -28,7 +29,7 @@ else
 | 
			
		||||
                </tr>
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <label class="control-label">Password: </label>
 | 
			
		||||
                        <label class="control-label">@Localizer["Password:"] </label>
 | 
			
		||||
                    </td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <input type="password" class="form-control" @bind="@password" />
 | 
			
		||||
@ -36,7 +37,7 @@ else
 | 
			
		||||
                </tr>
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <label class="control-label">Confirm Password: </label>
 | 
			
		||||
                        <label class="control-label">@Localizer["Confirm Password:"] </label>
 | 
			
		||||
                    </td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <input type="password" class="form-control" @bind="@confirm" />
 | 
			
		||||
@ -44,7 +45,7 @@ else
 | 
			
		||||
                </tr>
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <label class="control-label">Email: </label>
 | 
			
		||||
                        <label class="control-label">@Localizer["Email:"] </label>
 | 
			
		||||
                    </td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <input class="form-control" @bind="@email" />
 | 
			
		||||
@ -52,7 +53,7 @@ else
 | 
			
		||||
                </tr>
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <label class="control-label">Full Name: </label>
 | 
			
		||||
                        <label class="control-label">@Localizer["Full Name:"] </label>
 | 
			
		||||
                    </td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <input class="form-control" @bind="@displayname" />
 | 
			
		||||
@ -60,7 +61,7 @@ else
 | 
			
		||||
                </tr>
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <label class="control-label">Photo: </label>
 | 
			
		||||
                        <label class="control-label">@Localizer["Photo:"] </label>
 | 
			
		||||
                    </td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <FileManager FileId="@photofileid" @ref="filemanager" />
 | 
			
		||||
@ -68,12 +69,12 @@ else
 | 
			
		||||
                </tr>
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <label class="control-label">Is Deleted? </label>
 | 
			
		||||
                        <label class="control-label">@Localizer["Is Deleted?"] </label>
 | 
			
		||||
                    </td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <select class="form-control" @bind="@isdeleted">
 | 
			
		||||
                            <option value="True">Yes</option>
 | 
			
		||||
                            <option value="False">No</option>
 | 
			
		||||
                            <option value="True">@Localizer["Yes"]</option>
 | 
			
		||||
                            <option value="False">@Localizer["No"]</option>
 | 
			
		||||
                        </select>
 | 
			
		||||
                    </td>
 | 
			
		||||
                </tr>
 | 
			
		||||
@ -83,43 +84,44 @@ else
 | 
			
		||||
    <TabPanel Name="Profile" ResourceKey="Profile">
 | 
			
		||||
        @if (profiles != null)
 | 
			
		||||
        {
 | 
			
		||||
        <table class="table table-borderless">
 | 
			
		||||
            @foreach (Profile profile in profiles)
 | 
			
		||||
            {
 | 
			
		||||
                var p = profile;
 | 
			
		||||
                if (p.Category != category)
 | 
			
		||||
            <table class="table table-borderless">
 | 
			
		||||
                @foreach (Profile profile in profiles)
 | 
			
		||||
                {
 | 
			
		||||
                    var p = profile;
 | 
			
		||||
                    if (p.Category != category)
 | 
			
		||||
                    {
 | 
			
		||||
                        <tr>
 | 
			
		||||
                            <th colspan="2" style="text-align: center;">
 | 
			
		||||
                                @p.Category
 | 
			
		||||
                            </th>
 | 
			
		||||
                        </tr>
 | 
			
		||||
                        category = p.Category;
 | 
			
		||||
                    }
 | 
			
		||||
                    <tr>
 | 
			
		||||
                        <th colspan="2" style="text-align: center;">
 | 
			
		||||
                            @p.Category
 | 
			
		||||
                        </th>
 | 
			
		||||
                        <td>
 | 
			
		||||
                            <Label For="@p.Name" HelpText="@p.Description">@p.Title</Label>
 | 
			
		||||
                        </td>
 | 
			
		||||
                        <td>
 | 
			
		||||
                            @if (p.IsRequired)
 | 
			
		||||
                            {
 | 
			
		||||
                                <input id="@p.Name" class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" required @onchange="@(e => ProfileChanged(e, p.Name))" />
 | 
			
		||||
                            }
 | 
			
		||||
                            else
 | 
			
		||||
                            {
 | 
			
		||||
                                <input id="@p.Name" class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" @onchange="@(e => ProfileChanged(e, p.Name))" />
 | 
			
		||||
                            }
 | 
			
		||||
                        </td>
 | 
			
		||||
                    </tr>
 | 
			
		||||
                    category = p.Category;
 | 
			
		||||
                }
 | 
			
		||||
                <tr>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        <Label For="@p.Name" HelpText="@p.Description">@p.Title</Label>
 | 
			
		||||
                    </td>
 | 
			
		||||
                    <td>
 | 
			
		||||
                        @if (p.IsRequired)
 | 
			
		||||
                        {
 | 
			
		||||
                            <input id="@p.Name" class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" required @onchange="@(e => ProfileChanged(e, p.Name))" />
 | 
			
		||||
                        }
 | 
			
		||||
                        else
 | 
			
		||||
                        {
 | 
			
		||||
                            <input id="@p.Name" class="form-control" maxlength="@p.MaxLength" value="@GetProfileValue(p.Name, p.DefaultValue)" @onchange="@(e => ProfileChanged(e, p.Name))" />
 | 
			
		||||
                        }
 | 
			
		||||
                    </td>
 | 
			
		||||
                </tr>
 | 
			
		||||
            }
 | 
			
		||||
        </table>
 | 
			
		||||
            </table>
 | 
			
		||||
        }
 | 
			
		||||
    </TabPanel>
 | 
			
		||||
</TabStrip>
 | 
			
		||||
 | 
			
		||||
<button type="button" class="btn btn-primary" @onclick="SaveUser">Save</button>
 | 
			
		||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
 | 
			
		||||
<br /><br />
 | 
			
		||||
<button type="button" class="btn btn-primary" @onclick="SaveUser">@Localizer["Save"]</button>
 | 
			
		||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
 | 
			
		||||
<br />
 | 
			
		||||
<br />
 | 
			
		||||
<AuditInfo CreatedBy="@createdby" CreatedOn="@createdon" ModifiedBy="@modifiedby" ModifiedOn="@modifiedon" DeletedBy="@deletedby" DeletedOn="@deletedon"></AuditInfo>
 | 
			
		||||
 | 
			
		||||
@code {
 | 
			
		||||
@ -246,7 +248,7 @@ else
 | 
			
		||||
        }
 | 
			
		||||
        return valid;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    private void ProfileChanged(ChangeEventArgs e, string SettingName)
 | 
			
		||||
    {
 | 
			
		||||
        var value = (string)e.Value;
 | 
			
		||||
 | 
			
		||||
@ -3,11 +3,12 @@
 | 
			
		||||
@inject IUserRoleService UserRoleService
 | 
			
		||||
@inject IUserService UserService
 | 
			
		||||
@inject ISettingService SettingService
 | 
			
		||||
@inject IStringLocalizer<Index> Localizer
 | 
			
		||||
 | 
			
		||||
@if (userroles == null)
 | 
			
		||||
{
 | 
			
		||||
    <p>
 | 
			
		||||
        <em>Loading...</em>
 | 
			
		||||
        <em>@Localizer["Loading..."]</em>
 | 
			
		||||
    </p>
 | 
			
		||||
}
 | 
			
		||||
else
 | 
			
		||||
@ -15,7 +16,7 @@ else
 | 
			
		||||
    <ActionLink Action="Add" Text="Add User" ResourceKey="AddUser" />
 | 
			
		||||
 | 
			
		||||
    <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>
 | 
			
		||||
 | 
			
		||||
    <Pager Items="@userroles">
 | 
			
		||||
@ -23,11 +24,11 @@ else
 | 
			
		||||
            <th style="width: 1px;"> </th>
 | 
			
		||||
            <th style="width: 1px;"> </th>
 | 
			
		||||
            <th style="width: 1px;"> </th>
 | 
			
		||||
            <th>Name</th>
 | 
			
		||||
            <th>@Localizer["Name"]</th>
 | 
			
		||||
        </Header>
 | 
			
		||||
        <Row>
 | 
			
		||||
            <td>
 | 
			
		||||
                <ActionLink Action="Edit" Parameters="@($"id=" + context.UserId.ToString())" ResourceKey="EditUser"/>
 | 
			
		||||
                <ActionLink Action="Edit" Parameters="@($"id=" + context.UserId.ToString())" ResourceKey="EditUser" />
 | 
			
		||||
            </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))" ResourceKey="DeleteUser" />
 | 
			
		||||
 | 
			
		||||
@ -3,10 +3,11 @@
 | 
			
		||||
@inject IRoleService RoleService
 | 
			
		||||
@inject IUserService UserService
 | 
			
		||||
@inject IUserRoleService UserRoleService
 | 
			
		||||
@inject IStringLocalizer<Roles> Localizer
 | 
			
		||||
 | 
			
		||||
@if (userroles == null)
 | 
			
		||||
{
 | 
			
		||||
    <p><em>Loading...</em></p>
 | 
			
		||||
    <p><em>@Localizer["Loading..."]</em></p>
 | 
			
		||||
}
 | 
			
		||||
else
 | 
			
		||||
{
 | 
			
		||||
@ -50,23 +51,23 @@ else
 | 
			
		||||
            </td>
 | 
			
		||||
        </tr>
 | 
			
		||||
    </table>
 | 
			
		||||
    <button type="button" class="btn btn-success" @onclick="SaveUserRole">Save</button>
 | 
			
		||||
    <NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
 | 
			
		||||
    <button type="button" class="btn btn-success" @onclick="SaveUserRole">@Localizer["Save"]</button>
 | 
			
		||||
    <NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
 | 
			
		||||
 | 
			
		||||
    <hr class="app-rule" />
 | 
			
		||||
    <p align="center">
 | 
			
		||||
        <Pager Items="@userroles">
 | 
			
		||||
            <Header>
 | 
			
		||||
                <th>Roles</th>
 | 
			
		||||
                <th>@Localizer["Roles"]</th>
 | 
			
		||||
                <th> </th>
 | 
			
		||||
            </Header>
 | 
			
		||||
            <Row>
 | 
			
		||||
                <td>@context.Role.Name</td>
 | 
			
		||||
                <td>
 | 
			
		||||
                    @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>
 | 
			
		||||
            </Row>
 | 
			
		||||
        </Pager>
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user