Naming fixes
This commit is contained in:
@ -4,29 +4,29 @@
|
||||
@inject IFolderService FolderService
|
||||
@inject IFileService FileService
|
||||
|
||||
@if (Files != null)
|
||||
@if (_files != null)
|
||||
{
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<td>
|
||||
<label for="Name" class="control-label">Folder: </label>
|
||||
<label class="control-label">Folder: </label>
|
||||
</td>
|
||||
<td>
|
||||
<select class="form-control" @onchange="(e => FolderChanged(e))">
|
||||
@foreach (Folder folder in Folders)
|
||||
@foreach (Folder folder in _folders)
|
||||
{
|
||||
<option value="@(folder.FolderId)">@(new string('-', folder.Level * 2))@(folder.Name)</option>
|
||||
}
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<ActionLink Action="Edit" Text="Edit Folder" Class="btn btn-secondary" Parameters="@($"id=" + folderid.ToString())" />
|
||||
<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="Add" Text="Upload Files" Parameters="@($"id=" + _folderId.ToString())" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<Pager Items="@Files">
|
||||
<Pager Items="@_files">
|
||||
<Header>
|
||||
<th> </th>
|
||||
<th>Name</th>
|
||||
@ -42,7 +42,7 @@
|
||||
<td>@(context.Size / 1000) KB</td>
|
||||
</Row>
|
||||
</Pager>
|
||||
@if (Files.Count == 0)
|
||||
@if (_files.Count == 0)
|
||||
{
|
||||
<div class="text-center">No Files Exist In Selected Folder</div>
|
||||
}
|
||||
@ -51,22 +51,22 @@
|
||||
@code {
|
||||
public override SecurityAccessLevel SecurityAccessLevel { get { return SecurityAccessLevel.Admin; } }
|
||||
|
||||
List<Folder> Folders;
|
||||
int folderid = -1;
|
||||
List<File> Files;
|
||||
Uri uri;
|
||||
List<Folder> _folders;
|
||||
int _folderId = -1;
|
||||
List<File> _files;
|
||||
Uri _uri;
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
Folders = await FolderService.GetFoldersAsync(PageState.Site.SiteId);
|
||||
if (folderid == -1 && Folders.Count > 0)
|
||||
_folders = await FolderService.GetFoldersAsync(PageState.Site.SiteId);
|
||||
if (_folderId == -1 && _folders.Count > 0)
|
||||
{
|
||||
folderid = Folders[0].FolderId;
|
||||
_folderId = _folders[0].FolderId;
|
||||
await GetFiles();
|
||||
}
|
||||
uri = new Uri(NavigationManager.Uri);
|
||||
_uri = new Uri(NavigationManager.Uri);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -77,14 +77,14 @@
|
||||
|
||||
private async Task GetFiles()
|
||||
{
|
||||
Files = await FileService.GetFilesAsync(folderid);
|
||||
_files = await FileService.GetFilesAsync(_folderId);
|
||||
}
|
||||
|
||||
private async void FolderChanged(ChangeEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
folderid = int.Parse((string)e.Value);
|
||||
_folderId = int.Parse((string)e.Value);
|
||||
await GetFiles();
|
||||
StateHasChanged();
|
||||
}
|
||||
|
Reference in New Issue
Block a user