diff --git a/Oqtane.Client/Modules/Admin/ModuleDefinitions/Add.razor b/Oqtane.Client/Modules/Admin/ModuleDefinitions/Add.razor index 700978fc..1c5ea20e 100644 --- a/Oqtane.Client/Modules/Admin/ModuleDefinitions/Add.razor +++ b/Oqtane.Client/Modules/Admin/ModuleDefinitions/Add.razor @@ -10,61 +10,106 @@
-
+
+
+ + +
+
+ + +
+
+
+
+
- + Product
- - @if (_packages != null) - { - if (_packages.Count > 0) - { - - - -

@context.Name

  by:  @context.Owner
- @(context.Description.Length > 400 ? (context.Description.Substring(0, 400) + "...") : context.Description)
- @(String.Format("{0:n0}", context.Downloads)) @SharedLocalizer["Search.Downloads"]  |   - @SharedLocalizer["Search.Released"]: @context.ReleaseDate.ToString("MMM dd, yyyy")  |   - @SharedLocalizer["Search.Version"]: @context.Version - @((MarkupString)(!string.IsNullOrEmpty(context.PackageUrl) ? "  |  " + SharedLocalizer["Search.Source"] + ": " + new Uri(context.PackageUrl).Host + "" : "")) - @((MarkupString)(context.TrialPeriod > 0 ? "  |  " + context.TrialPeriod + " " + @SharedLocalizer["Trial"] + "" : "")) - - - @if (context.Price != null && !string.IsNullOrEmpty(context.PackageUrl)) - { - - } - - - @if (context.Price != null && !string.IsNullOrEmpty(context.PaymentUrl)) - { - @context.Price.Value.ToString("$#,##0.00") - } - else - { - - } - -
-
- } - else - { -
-
- @Localizer["Search.NoResults"] -
- } - } +
+
+ @if (_initialized) + { +
+
+
+

@((_packages != null) ? _packages.Count : 0) @SharedLocalizer["Search.Results"]

+
+
+   +
+
+ +
+
+ + +
+
+
+
+ @if (context.LogoFileId != null) + { + @context.Name + } + else + { + @context.Name + } +
+
+ @SharedLocalizer["Search.Version"]: @context.Version +
@SharedLocalizer["Search.Downloads"]: @(String.Format("{0:n0}", context.Downloads)) +
@SharedLocalizer["Search.Released"]: @context.ReleaseDate.ToString("MM/dd/yyyy") + @if (!string.IsNullOrEmpty(context.PackageUrl)) + { +
@SharedLocalizer["Search.Source"]: @(new Uri(context.PackageUrl).Host) + } +
+
+
+
+

@context.Name


+ @SharedLocalizer["Search.By"]: @context.Owner
+ @(context.Description.Length > 400 ? (context.Description.Substring(0, 400) + "...") : context.Description)
+ @if (context.Price != null && !string.IsNullOrEmpty(context.PaymentUrl)) + { + @SharedLocalizer["Search.Price"]: @context.Price.Value.ToString("$#,##0.00") + @((MarkupString)(context.TrialPeriod > 0 ? " (" + context.TrialPeriod + " Day Trial)" : "")) + } +
+ @if (!string.IsNullOrEmpty(context.PackageUrl)) + { + + } + @if (context.Price != null && !string.IsNullOrEmpty(context.PaymentUrl)) + { + @SharedLocalizer["Buy"] + } +
+
+
+
+
+
+
+ } +
+

@@ -116,8 +161,10 @@ @SharedLocalizer["Cancel"] @code { + private bool _initialized = false; private List _packages; private string _price = "free"; + private string _sort = "popularity"; private string _search = ""; private string _productname = ""; private string _packageid = ""; @@ -131,6 +178,7 @@ try { await LoadModuleDefinitions(); + _initialized = true; } catch (Exception ex) { @@ -141,8 +189,10 @@ private async Task LoadModuleDefinitions() { + ShowProgressIndicator(); + var moduledefinitions = await ModuleDefinitionService.GetModuleDefinitionsAsync(PageState.Site.SiteId); - _packages = await PackageService.GetPackagesAsync("module", _search, _price, ""); + _packages = await PackageService.GetPackagesAsync("module", _search, _price, "", _sort); if (_packages != null) { @@ -154,21 +204,22 @@ } } } + + HideProgressIndicator(); } - private async void PriceChanged(ChangeEventArgs e) + private string GetLogo(int fileid) { - try - { - _price = (string)e.Value; - _search = ""; - await LoadModuleDefinitions(); - StateHasChanged(); - } - catch (Exception ex) - { - await logger.LogError(ex, "Error On PriceChanged"); - } + var url = ImageUrl(fileid, 100, 100, "", "", "ffffff", 0, false); + url = (!string.IsNullOrEmpty(PageState.Alias.Path)) ? url.Substring(PageState.Alias.Path.Length + 1) : url; + return Constants.PackageRegistryUrl + url; + } + + private async void PriceChanged(string price) + { + _price = price; + await LoadModuleDefinitions(); + StateHasChanged(); } private async Task Search() @@ -196,6 +247,12 @@ } } + private async void SortChanged(ChangeEventArgs e) + { + _sort = (string)e.Value; + await LoadModuleDefinitions(); + } + private void HideModal() { _productname = ""; diff --git a/Oqtane.Client/Modules/Admin/Themes/Add.razor b/Oqtane.Client/Modules/Admin/Themes/Add.razor index 7c4bd170..35178935 100644 --- a/Oqtane.Client/Modules/Admin/Themes/Add.razor +++ b/Oqtane.Client/Modules/Admin/Themes/Add.razor @@ -10,61 +10,108 @@
-
+
+
+ + +
+
+ + +
+
+
+
+
- + Product
+
+
+ @if (_initialized) + { +
+
+
+

@((_packages != null) ? _packages.Count : 0) @SharedLocalizer["Search.Results"]

+
+
+   +
+
+ +
+
+ + +
+
+
+
+ @if (context.LogoFileId != null) + { + @context.Name + } + else + { + @context.Name + } +
+
+ @SharedLocalizer["Search.Version"]: @context.Version +
@SharedLocalizer["Search.Downloads"]: @(String.Format("{0:n0}", context.Downloads)) +
@SharedLocalizer["Search.Released"]: @context.ReleaseDate.ToString("MM/dd/yyyy") + @if (!string.IsNullOrEmpty(context.PackageUrl)) + { +
- @if (_packages != null) - { - if (_packages.Count > 0) - { - - - -

@context.Name

  @SharedLocalizer["Search.By"]:  @context.Owner
- @(context.Description.Length > 400 ? (context.Description.Substring(0, 400) + "...") : context.Description)
- @(String.Format("{0:n0}", context.Downloads)) @SharedLocalizer["Search.Downloads"]  |   - @SharedLocalizer["Search.Released"]: @context.ReleaseDate.ToString("MMM dd, yyyy")  |   - @SharedLocalizer["Search.Version"]: @context.Version - @((MarkupString)(!string.IsNullOrEmpty(context.PackageUrl) ? "  |  " + SharedLocalizer["Search.Source"] + ": " + new Uri(context.PackageUrl).Host + "" : "")) - @((MarkupString)(context.TrialPeriod > 0 ? "  |  " + context.TrialPeriod + " " + @SharedLocalizer["Trial"] + "" : "")) - - - @if (context.Price != null && !string.IsNullOrEmpty(context.PackageUrl)) - { - - } - - - @if (context.Price != null && !string.IsNullOrEmpty(context.PaymentUrl)) - { - @context.Price.Value.ToString("$#,##0.00") - } - else - { - - } - -
-
- } - else - { -
-
- @Localizer["Search.NoResults"] -
- } - } + @SharedLocalizer["Search.Source"]: @(new Uri(context.PackageUrl).Host) + } +
+
+
+
+

@context.Name


+ @SharedLocalizer["Search.By"]: @context.Owner
+ @(context.Description.Length > 400 ? (context.Description.Substring(0, 400) + "...") : context.Description)
+ @if (context.Price != null && !string.IsNullOrEmpty(context.PaymentUrl)) + { + @SharedLocalizer["Search.Price"]: @context.Price.Value.ToString("$#,##0.00") + @((MarkupString)(context.TrialPeriod > 0 ? " (" + context.TrialPeriod + " Day Trial)" : "")) + } +
+ @if (!string.IsNullOrEmpty(context.PackageUrl)) + { + + } + @if (context.Price != null && !string.IsNullOrEmpty(context.PaymentUrl)) + { + @SharedLocalizer["Buy"] + } +
+
+
+
+
+
+
+ } +
+

@@ -116,8 +163,10 @@ @SharedLocalizer["Cancel"] @code { + private bool _initialized = false; private List _packages; private string _price = "free"; + private string _sort = "popularity"; private string _search = ""; private string _productname = ""; private string _license = ""; @@ -131,6 +180,7 @@ try { await LoadThemes(); + _initialized = true; } catch (Exception ex) { @@ -141,8 +191,10 @@ private async Task LoadThemes() { + ShowProgressIndicator(); + var themes = await ThemeService.GetThemesAsync(); - _packages = await PackageService.GetPackagesAsync("theme", _search, _price, ""); + _packages = await PackageService.GetPackagesAsync("theme", _search, _price, "", _sort); if (_packages != null) { @@ -154,21 +206,22 @@ } } } + + HideProgressIndicator(); } - private async void PriceChanged(ChangeEventArgs e) + private string GetLogo(int fileid) { - try - { - _price = (string)e.Value; - _search = ""; - await LoadThemes(); - StateHasChanged(); - } - catch (Exception ex) - { - await logger.LogError(ex, "Error On PriceChanged"); - } + var url = ImageUrl(fileid, 100, 100, "", "", "ffffff", 0, false); + url = (!string.IsNullOrEmpty(PageState.Alias.Path)) ? url.Substring(PageState.Alias.Path.Length + 1) : url; + return Constants.PackageRegistryUrl + url; + } + + private async void PriceChanged(string price) + { + _price = price; + await LoadThemes(); + StateHasChanged(); } private async Task Search() @@ -196,6 +249,12 @@ } } + private async void SortChanged(ChangeEventArgs e) + { + _sort = (string)e.Value; + await LoadThemes(); + } + private void HideModal() { _productname = ""; diff --git a/Oqtane.Client/Resources/Modules/Admin/ModuleDefinitions/Add.resx b/Oqtane.Client/Resources/Modules/Admin/ModuleDefinitions/Add.resx index 9db1c83a..4d6bd593 100644 --- a/Oqtane.Client/Resources/Modules/Admin/ModuleDefinitions/Add.resx +++ b/Oqtane.Client/Resources/Modules/Admin/ModuleDefinitions/Add.resx @@ -136,7 +136,7 @@ No Modules Match The Criteria Provided Or Package Service Is Disabled - Download + Marketplace Upload diff --git a/Oqtane.Client/Resources/Modules/Admin/Themes/Add.resx b/Oqtane.Client/Resources/Modules/Admin/Themes/Add.resx index b7a18332..9ceeae29 100644 --- a/Oqtane.Client/Resources/Modules/Admin/Themes/Add.resx +++ b/Oqtane.Client/Resources/Modules/Admin/Themes/Add.resx @@ -135,4 +135,10 @@ No Themes Match The Criteria Provided Or Package Service Is Disabled + + Marketplace + + + Upload + \ No newline at end of file diff --git a/Oqtane.Client/Resources/SharedResources.resx b/Oqtane.Client/Resources/SharedResources.resx index 89823584..d02dfa0a 100644 --- a/Oqtane.Client/Resources/SharedResources.resx +++ b/Oqtane.Client/Resources/SharedResources.resx @@ -223,13 +223,13 @@ by - downloads + Downloads - released + Released - version + Version Edit @@ -277,19 +277,19 @@ Installed Version - source + Source Please Provide All Required Information - Free + Open Source - Paid + Commercial - price + Price Accept @@ -390,4 +390,16 @@ Support + + Alphabetical + + + Buy Now + + + Popularity + + + Results + \ No newline at end of file diff --git a/Oqtane.Server/wwwroot/package.png b/Oqtane.Server/wwwroot/package.png new file mode 100644 index 00000000..ccc6f290 Binary files /dev/null and b/Oqtane.Server/wwwroot/package.png differ