improving admin components

This commit is contained in:
Shaun Walker
2020-04-17 12:59:53 -04:00
parent b9d70dd11a
commit f56d1fe543
9 changed files with 797 additions and 675 deletions

View File

@ -4,70 +4,52 @@
@inject IFileService FileService
@inject IFolderService FolderService
@if (_folders != null)
{
<div class="container-fluid">
<div class="form-group">
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#Upload" role="tab">
Upload Files
</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#Download" role="tab">
Download Files
</a>
</li>
</ul>
<div class="tab-content">
<div id="Upload" class="tab-pane fade show active" role="tabpanel">
<table class="table table-borderless">
<tr>
<td>
<Label For="upload" HelpText="Upload the file you want">Upload: </Label>
</td>
<td>
<FileManager UploadMultiple="true" ShowFiles="false" FolderId="@_folderId.ToString()" />
</td>
</tr>
</table>
</div>
<div id="Download" class="tab-pane fade" role="tabpanel">
<table class="table table-borderless">
<tr>
<td>
<Label For="url" HelpText="Enter the file url">Url: </Label>
</td>
<td>
<input id="url" class="form-control" @bind="@url" />
</td>
</tr>
<tr>
<td>
<Label For="folder" HelpText="Select the folder the file is in">Folder: </Label>
</td>
<td>
<select id="folder" class="form-control" @bind="@_folderId">
<option value="-1">&lt;Select Folder&gt;</option>
@foreach (Folder folder in _folders)
{
<option value="@(folder.FolderId)">@(new string('-', folder.Level * 2))@(folder.Name)</option>
}
</select>
</td>
</tr>
</table>
<button type="button" class="btn btn-primary" @onclick="Download">Download</button>
</div>
</div>
</div>
</div>
<br />
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
}
<TabStrip>
<TabPanel Name="Upload" Heading="Upload Files">
<table class="table table-borderless">
<tr>
<td>
<Label For="upload" HelpText="Upload the file you want">Upload: </Label>
</td>
<td>
<FileManager UploadMultiple="true" ShowFiles="false" FolderId="@_folderId.ToString()" />
</td>
</tr>
</table>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
</TabPanel>
<TabPanel Name="Download" Heading="Download Files">
@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>
</td>
<td>
<input id="url" class="form-control" @bind="@url" />
</td>
</tr>
<tr>
<td>
<Label For="folder" HelpText="Select the folder to save the file in">Folder: </Label>
</td>
<td>
<select id="folder" class="form-control" @bind="@_folderId">
<option value="-1">&lt;Select Folder&gt;</option>
@foreach (Folder folder in _folders)
{
<option value="@(folder.FolderId)">@(new string('-', folder.Level * 2))@(folder.Name)</option>
}
</select>
</td>
</tr>
</table>
<button type="button" class="btn btn-success" @onclick="Download">Download</button>
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
}
</TabPanel>
</TabStrip>
@code {
private string url = string.Empty;

View File

@ -33,7 +33,7 @@
</tr>
<tr>
<td colspan="2" align="center">
<Label For="permissions" HelpText="Select the permissions you want for the file">Permissions: </Label>
<Label For="permissions" HelpText="Select the permissions you want for the folder">Permissions: </Label>
<PermissionGrid EntityName="@EntityNames.Folder" PermissionNames="Browse,View,Edit" Permissions="@_permissions" @ref="_permissionGrid" />
</td>
</tr>