Merge branch 'dev' into dev
This commit is contained in:
		| @ -7,57 +7,54 @@ | ||||
| @inject IStringLocalizer<Add> Localizer | ||||
| @inject IStringLocalizer<SharedResources> SharedLocalizer | ||||
|  | ||||
| @if (_packages != null) | ||||
| { | ||||
|     <TabStrip> | ||||
|         @if (_packages.Count > 0) | ||||
| <TabStrip> | ||||
|     <TabPanel Name="Download" ResourceKey="Download"> | ||||
|         @if (_packages != null && _packages.Count > 0) | ||||
|         { | ||||
|             <TabPanel Name="Download" ResourceKey="Download"> | ||||
|                 <ModuleMessage Type="MessageType.Info" Message="Download one or more themes from the list below. Once you are ready click Install to complete the installation."></ModuleMessage> | ||||
|             <ModuleMessage Type="MessageType.Info" Message="Download one or more themes from the list below. Once you are ready click Install to complete the installation."></ModuleMessage> | ||||
|  | ||||
|                 <table class="table table-borderless" style=" margin: auto; width: 50% !important;"> | ||||
|                     <tr> | ||||
|                         <td> | ||||
|                             <input id="search" class="form-control" placeholder="@SharedLocalizer["Search.Hint"]" @bind="@_search" /> | ||||
|                         </td> | ||||
|                         <td> | ||||
|                             <button type="button" class="btn btn-primary" @onclick="Search">@SharedLocalizer["Search"]</button>  | ||||
|                             <button type="button" class="btn btn-secondary" @onclick="Reset">@SharedLocalizer["Reset"]</button> | ||||
|                         </td> | ||||
|                     </tr> | ||||
|                 </table> | ||||
|  | ||||
|                 <Pager Items="@_packages"> | ||||
|                     <Row> | ||||
|                         <td> | ||||
|                             <h3 style="display: inline;"><a href="@context.ProductUrl" target="_new">@context.Name</a></h3>  @SharedLocalizer["Search.By"]:  <strong><a href="@context.OwnerUrl" target="new">@context.Owner</a></strong><br /> | ||||
|                             @(context.Description.Length > 400 ? (context.Description.Substring(0, 400) + "...") : context.Description)<br /> | ||||
|                             <strong>@(String.Format("{0:n0}", context.Downloads))</strong> @SharedLocalizer["Search.Downloads"]  |   @SharedLocalizer["Search.Released"]: <strong>@context.ReleaseDate.ToString("MMM dd, yyyy")</strong>  |  @SharedLocalizer["Search.Version"]: <strong>@context.Version</strong> | ||||
|                         </td> | ||||
|                         <td style="vertical-align: middle;"> | ||||
|                             <button type="button" class="btn btn-primary" @onclick=@(async () => await DownloadTheme(context.PackageId, context.Version))>@SharedLocalizer["Download"]</button> | ||||
|                         </td> | ||||
|                     </Row> | ||||
|                 </Pager> | ||||
|             </TabPanel> | ||||
|         } | ||||
|         <TabPanel Name="Upload" ResourceKey="Upload"> | ||||
|             <table class="table table-borderless"> | ||||
|             <table class="table table-borderless" style=" margin: auto; width: 50% !important;"> | ||||
|                 <tr> | ||||
|                     <td> | ||||
|                         <Label HelpText="Upload one or more theme packages. Once they are uploaded click Install to complete the installation." ResourceKey="Theme">Theme: </Label> | ||||
|                         <input id="search" class="form-control" placeholder="@SharedLocalizer["Search.Hint"]" @bind="@_search" /> | ||||
|                     </td> | ||||
|                     <td> | ||||
|                         <FileManager Filter="nupkg" ShowFiles="false" Folder="Packages" UploadMultiple="@true" /> | ||||
|                         <button type="button" class="btn btn-primary" @onclick="Search">@SharedLocalizer["Search"]</button>  | ||||
|                         <button type="button" class="btn btn-secondary" @onclick="Reset">@SharedLocalizer["Reset"]</button> | ||||
|                     </td> | ||||
|                 </tr> | ||||
|             </table> | ||||
|         </TabPanel> | ||||
|     </TabStrip> | ||||
|  | ||||
|     <button type="button" class="btn btn-success" @onclick="InstallThemes">@SharedLocalizer["Install"]</button> | ||||
|     <NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink> | ||||
| } | ||||
|             <Pager Items="@_packages"> | ||||
|                 <Row> | ||||
|                     <td> | ||||
|                         <h3 style="display: inline;"><a href="@context.ProductUrl" target="_new">@context.Name</a></h3>  @SharedLocalizer["Search.By"]:  <strong><a href="@context.OwnerUrl" target="new">@context.Owner</a></strong><br /> | ||||
|                         @(context.Description.Length > 400 ? (context.Description.Substring(0, 400) + "...") : context.Description)<br /> | ||||
|                         <strong>@(String.Format("{0:n0}", context.Downloads))</strong> @SharedLocalizer["Search.Downloads"]  |   @SharedLocalizer["Search.Released"]: <strong>@context.ReleaseDate.ToString("MMM dd, yyyy")</strong>  |  @SharedLocalizer["Search.Version"]: <strong>@context.Version</strong>  |  @SharedLocalizer["Search.Source"]: <strong>@context.PackageUrl</strong> | ||||
|                     </td> | ||||
|                     <td style="vertical-align: middle;"> | ||||
|                         <button type="button" class="btn btn-primary" @onclick=@(async () => await DownloadTheme(context.PackageId, context.Version))>@SharedLocalizer["Download"]</button> | ||||
|                     </td> | ||||
|                 </Row> | ||||
|             </Pager> | ||||
|         } | ||||
|     </TabPanel> | ||||
|     <TabPanel Name="Upload" ResourceKey="Upload"> | ||||
|         <table class="table table-borderless"> | ||||
|             <tr> | ||||
|                 <td> | ||||
|                     <Label HelpText="Upload one or more theme packages. Once they are uploaded click Install to complete the installation." ResourceKey="Theme">Theme: </Label> | ||||
|                 </td> | ||||
|                 <td> | ||||
|                     <FileManager Filter="nupkg" ShowFiles="false" Folder="Packages" UploadMultiple="@true" /> | ||||
|                 </td> | ||||
|             </tr> | ||||
|         </table> | ||||
|     </TabPanel> | ||||
| </TabStrip> | ||||
|  | ||||
| <button type="button" class="btn btn-success" @onclick="InstallThemes">@SharedLocalizer["Install"]</button> | ||||
| <NavLink class="btn btn-secondary" href="@NavigateUrl()">@SharedLocalizer["Cancel"]</NavLink> | ||||
|  | ||||
| @code { | ||||
|     private List<Package> _packages; | ||||
| @ -83,11 +80,14 @@ | ||||
|         var themes = await ThemeService.GetThemesAsync(); | ||||
|         _packages = await PackageService.GetPackagesAsync("theme", _search); | ||||
|  | ||||
|         foreach (Package package in _packages.ToArray()) | ||||
|         if (_packages != null) | ||||
|         { | ||||
|             if (themes.Exists(item => item.PackageName == package.PackageId)) | ||||
|             foreach (Package package in _packages.ToArray()) | ||||
|             { | ||||
|                 _packages.Remove(package); | ||||
|                 if (themes.Exists(item => item.PackageName == package.PackageId)) | ||||
|                 { | ||||
|                     _packages.Remove(package); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 gjwalk
					gjwalk