Merge pull request #923 from hishamco/localize-files-pages
Localize Files Pages
This commit is contained in:
commit
b7e40373b4
|
@ -1,31 +1,32 @@
|
|||
@namespace Oqtane.Modules.Admin.Files
|
||||
@namespace Oqtane.Modules.Admin.Files
|
||||
@using System.IO
|
||||
@inherits ModuleBase
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IFileService FileService
|
||||
@inject IFolderService FolderService
|
||||
@inject IStringLocalizer<Add> Localizer
|
||||
|
||||
<TabStrip>
|
||||
<TabPanel Name="Upload" Heading="Upload Files">
|
||||
<TabPanel Name="Upload" Heading="Upload Files" ResourceKey="Upload Files">
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="upload" HelpText="Upload the file you want">Upload: </Label>
|
||||
<Label For="upload" HelpText="Upload the file you want" ResourceKey="Upload">Upload: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<FileManager UploadMultiple="true" ShowFiles="false" FolderId="@_folderId" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
|
||||
</TabPanel>
|
||||
<TabPanel Name="Download" Heading="Download Files">
|
||||
<TabPanel Name="Download" Heading="Download Files" ResourceKey="DownloadFiles">
|
||||
@if (_folders != null)
|
||||
{
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="url" HelpText="Enter the url of the file you wish to download">Url: </Label>
|
||||
<Label For="url" HelpText="Enter the url of the file you wish to download" ResourceKey="Url">Url: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="url" class="form-control" @bind="@url" />
|
||||
|
@ -33,7 +34,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="folder" HelpText="Select the folder to save the file in">Folder: </Label>
|
||||
<Label For="folder" HelpText="Select the folder to save the file in" ResourceKey="Folder">Folder: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="folder" class="form-control" @bind="@_folderId">
|
||||
|
@ -46,8 +47,8 @@
|
|||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<button type="button" class="btn btn-success" @onclick="Download">Download</button>
|
||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||
<button type="button" class="btn btn-success" @onclick="Download">@Localizer["Download"]</button>
|
||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
|
||||
}
|
||||
</TabPanel>
|
||||
</TabStrip>
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
@namespace Oqtane.Modules.Admin.Files
|
||||
@namespace Oqtane.Modules.Admin.Files
|
||||
@inherits ModuleBase
|
||||
@inject IFileService FileService
|
||||
@inject IFolderService FolderService
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IStringLocalizer<Details> Localizer
|
||||
|
||||
@if (_folders != null)
|
||||
{
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<Label for="name" HelpText="The name of the file">Name: </Label>
|
||||
<Label for="name" HelpText="The name of the file" ResourceKey="Name">Name: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="name" class="form-control" @bind="@_name" />
|
||||
|
@ -17,7 +18,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="parent" HelpText="The folder where the file is located">Folder: </Label>
|
||||
<Label For="parent" HelpText="The folder where the file is located" ResourceKey="Folder">Folder: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="parent" class="form-control" @bind="@_folderId">
|
||||
|
@ -30,15 +31,15 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label for="size" HelpText="The size of the file (in bytes)">Size: </Label>
|
||||
<Label for="size" HelpText="The size of the file (in bytes)" ResourceKey="Size">Size: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="size" class="form-control" @bind="@_size" readonly />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<button type="button" class="btn btn-success" @onclick="SaveFile">Save</button>
|
||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||
<button type="button" class="btn btn-success" @onclick="SaveFile">@Localizer["Save"]</button>
|
||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">@Localizer["Cancel"]</NavLink>
|
||||
<br />
|
||||
<br />
|
||||
<AuditInfo CreatedBy="@_createdBy" CreatedOn="@_createdOn" ModifiedBy="@_modifiedBy" ModifiedOn="@_modifiedOn"></AuditInfo>
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
@namespace Oqtane.Modules.Admin.Files
|
||||
@namespace Oqtane.Modules.Admin.Files
|
||||
@inherits ModuleBase
|
||||
@inject IFolderService FolderService
|
||||
@inject IFileService FileService
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IStringLocalizer<Edit> Localizer
|
||||
|
||||
@if (_folders != null)
|
||||
{
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<Label For="parent" HelpText="Select the parent folder">Parent: </Label>
|
||||
<Label For="parent" HelpText="Select the parent folder" ResourceKey="Parent">Parent: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="parent" class="form-control" @bind="@_parentId">
|
||||
|
@ -26,7 +27,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Label for="name" HelpText="Enter the folder name">Name: </Label>
|
||||
<Label for="name" HelpText="Enter the folder name" ResourceKey="Name">Name: </Label>
|
||||
</td>
|
||||
<td>
|
||||
<input id="name" class="form-control" @bind="@_name" />
|
||||
|
@ -34,19 +35,19 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<Label For="permissions" HelpText="Select the permissions you want for the folder">Permissions: </Label>
|
||||
<Label For="permissions" HelpText="Select the permissions you want for the folder" ResourceKey="Permissions">Permissions: </Label>
|
||||
<PermissionGrid EntityName="@EntityNames.Folder" PermissionNames="Browse,View,Edit" Permissions="@_permissions" @ref="_permissionGrid" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@if (!_isSystem)
|
||||
{
|
||||
<button type="button" class="btn btn-success" @onclick="SaveFolder">Save</button>
|
||||
<button type="button" class="btn btn-success" @onclick="SaveFolder">@Localizer["Save"]</button>
|
||||
}
|
||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||
@if (!_isSystem && PageState.QueryString.ContainsKey("id"))
|
||||
{
|
||||
<ActionDialog Header="Delete Folder" Message="@("Are You Sure You Wish To Delete This Folder?")" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteFolder())" />
|
||||
<ActionDialog Header="Delete Folder" Message="@("Are You Sure You Wish To Delete This Folder?")" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteFolder())" ResourceKey="DeleteFolder" />
|
||||
}
|
||||
<br />
|
||||
<br />
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
@namespace Oqtane.Modules.Admin.Files
|
||||
@namespace Oqtane.Modules.Admin.Files
|
||||
@inherits ModuleBase
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IFolderService FolderService
|
||||
@inject IFileService FileService
|
||||
@inject IStringLocalizer<Index> Localizer
|
||||
|
||||
@if (_files != null)
|
||||
{
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<label class="control-label">Folder: </label>
|
||||
<label class="control-label">@Localizer["Folder:"] </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @onchange="(e => FolderChanged(e))">
|
||||
|
@ -20,9 +21,9 @@
|
|||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<ActionLink Action="Edit" Text="Edit Folder" Class="btn btn-secondary" Parameters="@($"id=" + _folderId.ToString())" />
|
||||
<ActionLink Action="Edit" Text="Add Folder" Class="btn btn-secondary" />
|
||||
<ActionLink Action="Add" Text="Upload Files" Parameters="@($"id=" + _folderId.ToString())" />
|
||||
<ActionLink Action="Edit" Text="Edit Folder" Class="btn btn-secondary" Parameters="@($"id=" + _folderId.ToString())" ResourceKey="EditFolder" />
|
||||
<ActionLink Action="Edit" Text="Add Folder" Class="btn btn-secondary" ResourceKey="AddFolder" />
|
||||
<ActionLink Action="Add" Text="Upload Files" Parameters="@($"id=" + _folderId.ToString())" ResourceKey="UploadFiles" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -30,23 +31,23 @@
|
|||
<Header>
|
||||
<th style="width: 1px;"> </th>
|
||||
<th style="width: 1px;"> </th>
|
||||
<th>Name</th>
|
||||
<th>Modified</th>
|
||||
<th>Type</th>
|
||||
<th>Size</th>
|
||||
<th>@Localizer["Name"]</th>
|
||||
<th>@Localizer["Modified"]</th>
|
||||
<th>@Localizer["Type"]</th>
|
||||
<th>@Localizer["Size"]</th>
|
||||
</Header>
|
||||
<Row>
|
||||
<td><ActionLink Action="Details" Text="Edit" Parameters="@($"id=" + context.FileId.ToString())" /></td>
|
||||
<td><ActionDialog Header="Delete File" Message="@("Are You Sure You Wish To Delete " + context.Name + "?")" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteFile(context))" /></td>
|
||||
<td><ActionLink Action="Details" Text="Edit" Parameters="@($"id=" + context.FileId.ToString())" ResourceKey="Details" /></td>
|
||||
<td><ActionDialog Header="Delete File" Message="@("Are You Sure You Wish To Delete " + context.Name + "?")" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteFile(context))" ResourceKey="DeleteFile" /></td>
|
||||
<td><a href="@(ContentUrl(context.FileId))" target="_new">@context.Name</a></td>
|
||||
<td>@context.ModifiedOn</td>
|
||||
<td>@context.Extension.ToUpper() File</td>
|
||||
<td>@context.Extension.ToUpper() @Localizer["File"]</td>
|
||||
<td>@(context.Size / 1000) KB</td>
|
||||
</Row>
|
||||
</Pager>
|
||||
@if (_files.Count == 0)
|
||||
{
|
||||
<div class="text-center">No Files Exist In Selected Folder</div>
|
||||
<div class="text-center">@Localizer["No Files Exist In Selected Folder"]</div>
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user