From 3e789e06427aae2fdd48331358d806471735acf9 Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Wed, 29 Sep 2021 10:46:23 -0400 Subject: [PATCH] UX improvements to FileManager and Pager components --- .../Modules/Controls/FileManager.razor | 103 +++++++++--------- Oqtane.Client/Modules/Controls/Pager.razor | 6 +- .../Modules/Controls/FileManager.resx | 5 +- Oqtane.Server/wwwroot/js/interop.js | 13 +-- 4 files changed, 62 insertions(+), 65 deletions(-) diff --git a/Oqtane.Client/Modules/Controls/FileManager.razor b/Oqtane.Client/Modules/Controls/FileManager.razor index 9822859d..5eb01d6c 100644 --- a/Oqtane.Client/Modules/Controls/FileManager.razor +++ b/Oqtane.Client/Modules/Controls/FileManager.razor @@ -10,54 +10,63 @@
- @if (ShowFolders || FolderId <= 0) - { -
- + @if (string.IsNullOrEmpty(Folder)) + { + + } + @foreach (Folder folder in _folders) + { + + } + +
+ } + @if (ShowFiles) + { +
+ +
+ } + @if (ShowUpload && _haseditpermission) + { +
+ @if (UploadMultiple) { - + } - @foreach (Folder folder in _folders) + else { - + } - -
- } - @if (ShowFiles) - { -
- -
- } - @if (ShowUpload && _haseditpermission) - { -
- @if (UploadMultiple) - { - - } - else - { - - } - - - - @if (ShowFiles && GetFileId() != -1) - { - - } - -
- } + + + @if (ShowFiles && GetFileId() != -1) + { + + } + +
+
+
+
+
+
+
+
+
+ } +
@if (_image != string.Empty) { @@ -69,7 +78,7 @@ @if (!string.IsNullOrEmpty(_message)) {
-
+
@@ -234,7 +243,6 @@ catch (Exception ex) { await logger.LogError(ex, "Error Loading Files {Error}", ex.Message); - _message = Localizer["Error.File.Load"]; _messagetype = MessageType.Error; } @@ -299,9 +307,6 @@ { await logger.LogInformation("File Upload Succeeded {Files}", upload); - _message = Localizer["Success.File.Upload"]; - _messagetype = MessageType.Success; - // set FileId to first file in upload collection await GetFiles(); var file = _files.Where(item => item.Name == upload[0]).FirstOrDefault(); diff --git a/Oqtane.Client/Modules/Controls/Pager.razor b/Oqtane.Client/Modules/Controls/Pager.razor index 464431dd..9a8b6c61 100644 --- a/Oqtane.Client/Modules/Controls/Pager.razor +++ b/Oqtane.Client/Modules/Controls/Pager.razor @@ -10,7 +10,7 @@
  • UpdateList(1))>
  • - @if (_pages > _displayPages) + @if (_pages > _displayPages && _displayPages > 1) {
  • SkipPages("back"))> @@ -38,7 +38,7 @@
  • NavigateToPage("next"))>
  • - @if (_pages > _displayPages) + @if (_pages > _displayPages && _displayPages > 1) {
  • SkipPages("forward"))> @@ -48,7 +48,7 @@ UpdateList(_pages))>
  • - Page @_page of @_pages + Page @_page of @_pages
  • } diff --git a/Oqtane.Client/Resources/Modules/Controls/FileManager.resx b/Oqtane.Client/Resources/Modules/Controls/FileManager.resx index f7f93e08..9cbe0991 100644 --- a/Oqtane.Client/Resources/Modules/Controls/FileManager.resx +++ b/Oqtane.Client/Resources/Modules/Controls/FileManager.resx @@ -1,4 +1,4 @@ - +