Merge pull request #894 from hishamco/localize-user-profiles-pages
Localize User Profile Pages
This commit is contained in:
		| @ -1,15 +1,16 @@ | ||||
| @namespace Oqtane.Modules.Admin.UserProfile | ||||
| @namespace Oqtane.Modules.Admin.UserProfile | ||||
| @inherits ModuleBase | ||||
| @inject NavigationManager NavigationManager | ||||
| @inject IUserService UserService | ||||
| @inject INotificationService NotificationService | ||||
| @inject INotificationService NotificationService | ||||
| @inject IStringLocalizer<Add> Localizer | ||||
|  | ||||
| @if (PageState.User != null) | ||||
| { | ||||
|     <table class="table table-borderless"> | ||||
|         <tr> | ||||
|             <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> | ||||
|                 <input id="to" class="form-control" @bind="@username" /> | ||||
| @ -17,7 +18,7 @@ | ||||
|         </tr> | ||||
|         <tr> | ||||
|             <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> | ||||
|                 <input id="subject" class="form-control" @bind="@subject" /> | ||||
| @ -25,15 +26,15 @@ | ||||
|         </tr> | ||||
|         <tr> | ||||
|             <td> | ||||
|                 <Label For="message" HelpText="Enter the message">Message: </Label> | ||||
|                 <Label For="message" HelpText="Enter the message" ResourceKey="Message">Message: </Label> | ||||
|             </td> | ||||
|             <td> | ||||
|                 <textarea id="message" class="form-control" @bind="@body" rows="5" /> | ||||
|             </td> | ||||
|         </tr> | ||||
|     </table> | ||||
|     <button type="button" class="btn btn-primary" @onclick="Send">Send</button> | ||||
|     <NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink> | ||||
|     <button type="button" class="btn btn-primary" @onclick="Send">@Localizer["Send"]</button> | ||||
|     <NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink> | ||||
| } | ||||
|  | ||||
| @code { | ||||
|  | ||||
| @ -5,6 +5,7 @@ | ||||
| @inject IProfileService ProfileService | ||||
| @inject ISettingService SettingService | ||||
| @inject INotificationService NotificationService | ||||
| @inject IStringLocalizer<Index> Localizer | ||||
|  | ||||
| @if (PageState.User != null && photofileid != -1) | ||||
| { | ||||
| @ -15,13 +16,13 @@ else | ||||
|     <br /> | ||||
| } | ||||
| <TabStrip> | ||||
|     <TabPanel Name="Identity"> | ||||
|     <TabPanel Name="Identity" ResourceKey="Identity"> | ||||
|         @if (PageState.User != null) | ||||
|         { | ||||
|             <table class="table table-borderless"> | ||||
|                 <tr> | ||||
|                     <td> | ||||
|                         <label for="Name" class="control-label">Username: </label> | ||||
|                         <label for="Name" class="control-label">@Localizer["Username:"] </label> | ||||
|                     </td> | ||||
|                     <td> | ||||
|                         <input class="form-control" @bind="@username" readonly /> | ||||
| @ -29,7 +30,7 @@ else | ||||
|                 </tr> | ||||
|                 <tr> | ||||
|                     <td> | ||||
|                         <label for="Name" class="control-label">Password: </label> | ||||
|                         <label for="Name" class="control-label">@Localizer["Password:"] </label> | ||||
|                     </td> | ||||
|                     <td> | ||||
|                         <input type="password" class="form-control" @bind="@password" autocomplete="new-password" /> | ||||
| @ -37,7 +38,7 @@ else | ||||
|                 </tr> | ||||
|                 <tr> | ||||
|                     <td> | ||||
|                         <label for="Name" class="control-label">Confirm Password: </label> | ||||
|                         <label for="Name" class="control-label">@Localizer["Confirm Password:"] </label> | ||||
|                     </td> | ||||
|                     <td> | ||||
|                         <input type="password" class="form-control" @bind="@confirm" autocomplete="new-password" /> | ||||
| @ -45,7 +46,7 @@ else | ||||
|                 </tr> | ||||
|                 <tr> | ||||
|                     <td> | ||||
|                         <label for="Name" class="control-label">Email: </label> | ||||
|                         <label for="Name" class="control-label">@Localizer["Email:"] </label> | ||||
|                     </td> | ||||
|                     <td> | ||||
|                         <input class="form-control" @bind="@email" /> | ||||
| @ -53,7 +54,7 @@ else | ||||
|                 </tr> | ||||
|                 <tr> | ||||
|                     <td> | ||||
|                         <label for="Name" class="control-label">Full Name: </label> | ||||
|                         <label for="Name" class="control-label">@Localizer["Full Name:"] </label> | ||||
|                     </td> | ||||
|                     <td> | ||||
|                         <input class="form-control" @bind="@displayname" /> | ||||
| @ -61,18 +62,18 @@ else | ||||
|                 </tr> | ||||
|                 <tr> | ||||
|                     <td> | ||||
|                         <label for="Name" class="control-label">Photo: </label> | ||||
|                         <label for="Name" class="control-label">@Localizer["Photo:"] </label> | ||||
|                     </td> | ||||
|                     <td> | ||||
|                         <FileManager FileId="@photofileid" @ref="filemanager" /> | ||||
|                     </td> | ||||
|                 </tr> | ||||
|             </table> | ||||
|             <button type="button" class="btn btn-primary" @onclick="Save">Save</button> | ||||
|             <button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button> | ||||
|             <button type="button" class="btn btn-primary" @onclick="Save">@Localizer["Save"]</button> | ||||
|             <button type="button" class="btn btn-secondary" @onclick="Cancel">@Localizer["Cancel"]</button> | ||||
|         } | ||||
|     </TabPanel> | ||||
|     <TabPanel Name="Profile"> | ||||
|     <TabPanel Name="Profile" ResourceKey="Profile"> | ||||
|         @if (profiles != null && settings != null) | ||||
|         { | ||||
|         <table class="table table-borderless"> | ||||
| @ -127,14 +128,14 @@ else | ||||
|                 } | ||||
|             } | ||||
|         </table> | ||||
|             <button type="button" class="btn btn-primary" @onclick="Save">Save</button> | ||||
|             <button type="button" class="btn btn-secondary" @onclick="Cancel">Cancel</button> | ||||
|             <button type="button" class="btn btn-primary" @onclick="Save">@Localizer["Save"]</button> | ||||
|             <button type="button" class="btn btn-secondary" @onclick="Cancel">@Localizer["Cancel"]</button> | ||||
|         } | ||||
|     </TabPanel> | ||||
|     <TabPanel Name="Notifications"> | ||||
|     <TabPanel Name="Notifications" ResourceKey="Notifications"> | ||||
|         @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 /> | ||||
|             @if (filter == "to") | ||||
|             { | ||||
| @ -142,13 +143,13 @@ else | ||||
|                     <Header> | ||||
|                         <th style="width: 1px;"> </th> | ||||
|                         <th style="width: 1px;"> </th> | ||||
|                         <th>From</th> | ||||
|                         <th>Subject</th> | ||||
|                         <th>Received</th> | ||||
|                         <th>@Localizer["From"]</th> | ||||
|                         <th>@Localizer["Subject"]</th> | ||||
|                         <th>@Localizer["Received"]</th> | ||||
|                     </Header> | ||||
|                     <Row> | ||||
|                         <td><ActionLink Action="View" Parameters="@($"id=" + context.NotificationId.ToString())" Security="SecurityAccessLevel.View" 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" /></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" ResourceKey="DeleteNotification" /></td> | ||||
|                         <td>@context.FromDisplayName</td> | ||||
|                         <td>@context.Subject</td> | ||||
|                         <td>@context.CreatedOn</td> | ||||
| @ -174,13 +175,13 @@ else | ||||
|                     <Header> | ||||
|                         <th> </th> | ||||
|                         <th> </th> | ||||
|                         <th>To</th> | ||||
|                         <th>Subject</th> | ||||
|                         <th>Sent</th> | ||||
|                         <th>@Localizer["To"]</th> | ||||
|                         <th>@Localizer["Subject"]</th> | ||||
|                         <th>@Localizer["Sent"]</th> | ||||
|                     </Header> | ||||
|                     <Row> | ||||
|                         <td><ActionLink Action="View" Parameters="@($"id=" + context.NotificationId.ToString())" Security="SecurityAccessLevel.View" 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" /></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" ResourceKey="DeleteNotification" /></td> | ||||
|                         <td>@context.ToDisplayName</td> | ||||
|                         <td>@context.Subject</td> | ||||
|                         <td>@context.CreatedOn</td> | ||||
| @ -202,8 +203,8 @@ else | ||||
|             } | ||||
|             <br /><hr /> | ||||
|             <select class="form-control" @onchange="(e => FilterChanged(e))"> | ||||
|                 <option value="to">Inbox</option> | ||||
|                 <option value="from">Sent Items</option> | ||||
|                 <option value="to">@Localizer["Inbox"]</option> | ||||
|                 <option value="from">@Localizer["Sent Items"]</option> | ||||
|             </select> | ||||
|         } | ||||
|     </TabPanel> | ||||
|  | ||||
| @ -1,8 +1,9 @@ | ||||
| @namespace Oqtane.Modules.Admin.UserProfile | ||||
| @namespace Oqtane.Modules.Admin.UserProfile | ||||
| @inherits ModuleBase | ||||
| @inject NavigationManager NavigationManager | ||||
| @inject IUserService UserService | ||||
| @inject INotificationService NotificationService | ||||
| @inject INotificationService NotificationService | ||||
| @inject IStringLocalizer<View> Localizer | ||||
|  | ||||
| @if (PageState.User != null) | ||||
| { | ||||
| @ -26,7 +27,7 @@ | ||||
|         </tr> | ||||
|         <tr> | ||||
|             <td> | ||||
|                 <label class="control-label">Subject: </label> | ||||
|                 <label class="control-label">@Localizer["Subject:"] </label> | ||||
|             </td> | ||||
|             @if (title == "From") | ||||
|             { | ||||
| @ -45,7 +46,7 @@ | ||||
|         { | ||||
|             <tr> | ||||
|                 <td> | ||||
|                     <label class="control-label">Date: </label> | ||||
|                     <label class="control-label">@Localizer["Date:"] </label> | ||||
|                 </td> | ||||
|                 <td> | ||||
|                     <input class="form-control" @bind="@createdon" readonly /> | ||||
| @ -56,7 +57,7 @@ | ||||
|         { | ||||
|             <tr> | ||||
|                 <td> | ||||
|                     <label class="control-label">Message: </label> | ||||
|                     <label class="control-label">@Localizer["Message:"] </label> | ||||
|                 </td> | ||||
|                 <td> | ||||
|                     <textarea class="form-control" @bind="@body" rows="5" readonly /> | ||||
| @ -67,7 +68,7 @@ | ||||
|         { | ||||
|             <tr> | ||||
|                 <td> | ||||
|                     <label class="control-label">Message: </label> | ||||
|                     <label class="control-label">@Localizer["Message:"] </label> | ||||
|                 </td> | ||||
|                 <td> | ||||
|                     <textarea class="form-control" @bind="@body" rows="5" /> | ||||
| @ -79,24 +80,26 @@ | ||||
|  | ||||
|     @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 | ||||
|     { | ||||
|         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 /> | ||||
|     @if (title == "To") | ||||
|     { | ||||
|         <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 /> | ||||
|         </div> | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| @code { | ||||
|     private int notificationid; | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Shaun Walker
					Shaun Walker