mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 19:04:51 +08:00
#17172: Adding extension screenshots / icons, rating and ratings count.
--HG-- branch : 1.x
This commit is contained in:
@@ -93,6 +93,9 @@
|
||||
<Compile Include="ViewModels\PackagingSourcesViewModel.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Content\Images\moduleDefaultIcon.png" />
|
||||
<Content Include="Content\Images\packageDefaultIcon.png" />
|
||||
<Content Include="Content\Images\themeDefaultIcon.png" />
|
||||
<Content Include="Module.txt" />
|
||||
<Content Include="Service References\GalleryServer\Reference.datasvcmap">
|
||||
<Generator>DataServiceClientGenerator</Generator>
|
||||
|
@@ -12,5 +12,9 @@ namespace Orchard.Packaging.Services {
|
||||
public DateTime LastUpdated { get; set; }
|
||||
public string Authors { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string FirstScreenshot { get; set; }
|
||||
public string IconUrl { get; set; }
|
||||
public double Rating { get; set; }
|
||||
public int RatingsCount { get; set; }
|
||||
}
|
||||
}
|
@@ -63,19 +63,25 @@ namespace Orchard.Packaging.Services {
|
||||
}
|
||||
|
||||
private static PackagingEntry CreatePackageEntry(PublishedPackage package, PackagingSource source, Uri downloadUri) {
|
||||
PublishedScreenshot firstScreenshot = package.Screenshots.FirstOrDefault();
|
||||
|
||||
return new PackagingEntry {
|
||||
Title = String.IsNullOrWhiteSpace(package.Title) ? package.Id : package.Title,
|
||||
Title = string.IsNullOrWhiteSpace(package.Title) ? package.Id : package.Title,
|
||||
PackageId = package.Id,
|
||||
PackageStreamUri = downloadUri.ToString(),
|
||||
ProjectUrl = package.ProjectUrl,
|
||||
Source = source,
|
||||
Version = package.Version ?? String.Empty,
|
||||
Version = package.Version ?? string.Empty,
|
||||
Description = package.Description,
|
||||
Authors = package.Authors,
|
||||
LastUpdated = package.LastUpdated
|
||||
LastUpdated = package.LastUpdated,
|
||||
IconUrl = package.IconUrl,
|
||||
FirstScreenshot = firstScreenshot != null ? firstScreenshot.ScreenshotUri : string.Empty,
|
||||
Rating = package.Rating,
|
||||
RatingsCount = package.RatingsCount
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
@@ -2,13 +2,21 @@
|
||||
float:left;
|
||||
}
|
||||
.contentItems .related {
|
||||
padding:1.2em 0.4em 0.5em
|
||||
padding: 1.2em 0.4em 0.5em
|
||||
}
|
||||
.contentItems .properties {
|
||||
float:none;
|
||||
clear:both;
|
||||
float:left;
|
||||
}
|
||||
.contentItems .pageStatus {
|
||||
margin:.8em 0;
|
||||
color:#666;
|
||||
}
|
||||
.thumbnail {
|
||||
float: left;
|
||||
padding: 1.2em 1.2em 0.5em 0em;
|
||||
width: 10%;
|
||||
}
|
||||
.extensionDetails {
|
||||
float: left;
|
||||
width: 85%;
|
||||
}
|
@@ -22,26 +22,38 @@
|
||||
<ul class="contentItems">
|
||||
@foreach (var item in Model.Extensions) {
|
||||
<li>
|
||||
<div class="extensionName">
|
||||
<h2>@item.Title<span> - @T("Version: {0}", item.Version)</span></h2>
|
||||
@{
|
||||
string iconUrl = @item.IconUrl;
|
||||
if (string.IsNullOrWhiteSpace(iconUrl)) {
|
||||
iconUrl = Href("../../Content/Images/ModuleDefaultIcon.png");
|
||||
}
|
||||
}
|
||||
<img src="@iconUrl" class="thumbnail"/>
|
||||
|
||||
<div class="extensionDetails">
|
||||
<div class="extensionName">
|
||||
<h2>@item.Title<span> - @T("Version: {0}", item.Version)</span></h2>
|
||||
</div>
|
||||
|
||||
<div class="related">
|
||||
@Html.ActionLink(T("Install").ToString(), "Install", new RouteValueDictionary {{"packageId", item.PackageId}, {"version", item.Version}, {"sourceId", item.Source.Id}, {"redirectTo", "Modules"}})@T(" | ")
|
||||
<a href="@item.PackageStreamUri">@T("Download")</a>
|
||||
</div>
|
||||
|
||||
<div class="properties">
|
||||
<p>@(item.Description == null ? T("(No description").Text : item.Description)</p>
|
||||
<ul class="pageStatus">
|
||||
<li>@T("Last Updated: {0}", DateTime.Now.ToLocalTime())</li>
|
||||
<li> | @T("Author: {0}", !string.IsNullOrEmpty(item.Authors) ? item.Authors : T("Unknown").ToString())</li>
|
||||
<li> | @T("Rating: {0}", item.Rating)</li>
|
||||
<li> | @T("Ratings Count: {0}", item.RatingsCount)</li>
|
||||
<li> | @T("Website: ")
|
||||
@if(!string.IsNullOrEmpty(item.ProjectUrl)) { <a href="@item.ProjectUrl">@item.ProjectUrl</a> }
|
||||
else { @T("Unknown").ToString() }
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="related">
|
||||
@Html.ActionLink(T("Install").ToString(), "Install", new RouteValueDictionary {{"packageId", item.PackageId}, {"version", item.Version}, {"sourceId", item.Source.Id}, {"redirectTo", "Modules"}})@T(" | ")
|
||||
<a href="@item.PackageStreamUri">@T("Download")</a>
|
||||
</div>
|
||||
|
||||
<div class="properties">
|
||||
<p>@(item.Description == null ? T("(No description").Text : item.Description)</p>
|
||||
<ul class="pageStatus">
|
||||
<li>@T("Last Updated: {0}", DateTime.Now.ToLocalTime())</li>
|
||||
<li> | @T("Author: {0}", !string.IsNullOrEmpty(item.Authors) ? item.Authors : T("Unknown").ToString())</li>
|
||||
<li> | @T("Website: ")
|
||||
@if(!string.IsNullOrEmpty(item.ProjectUrl)) { <a href="@item.ProjectUrl">@item.ProjectUrl</a> }
|
||||
else { @T("Unknown").ToString() }
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>}
|
||||
</ul>
|
||||
}
|
@@ -22,26 +22,41 @@
|
||||
<ul class="contentItems">
|
||||
@foreach (var item in Model.Extensions) {
|
||||
<li>
|
||||
<div class="extensionName">
|
||||
<h2>@item.Title<span> - @T("Version: {0}", item.Version)</span></h2>
|
||||
@{
|
||||
string iconUrl = @item.IconUrl;
|
||||
if (!string.IsNullOrWhiteSpace(@item.FirstScreenshot)) {
|
||||
iconUrl = Href(@item.FirstScreenshot);
|
||||
}
|
||||
else if (string.IsNullOrWhiteSpace(iconUrl)) {
|
||||
iconUrl = Href("../../Content/Images/imagePlaceholder.png");
|
||||
}
|
||||
}
|
||||
<img src="@iconUrl" class="thumbnail" />
|
||||
|
||||
<div class="extensionDetails">
|
||||
<div class="extensionName">
|
||||
<h2>@item.Title<span> - @T("Version: {0}", item.Version)</span></h2>
|
||||
</div>
|
||||
|
||||
<div class="related">
|
||||
@Html.ActionLink(T("Install").ToString(), "Install", new RouteValueDictionary {{"packageId", item.PackageId}, {"version", item.Version}, {"sourceId", item.Source.Id}, {"redirectTo", "Themes"}})@T(" | ")
|
||||
<a href="@item.PackageStreamUri">@T("Download")</a>
|
||||
</div>
|
||||
|
||||
<div class="properties">
|
||||
<p>@(item.Description == null ? T("(No description").Text : item.Description)</p>
|
||||
<ul class="pageStatus">
|
||||
<li>@T("Last Updated: {0}", DateTime.Now.ToLocalTime())</li>
|
||||
<li> | @T("Author: {0}", !string.IsNullOrEmpty(item.Authors) ? item.Authors : T("Unknown").ToString())</li>
|
||||
<li> | @T("Rating: {0}", item.Rating)</li>
|
||||
<li> | @T("Ratings Count: {0}", item.RatingsCount)</li>
|
||||
<li> | @T("Website: ")
|
||||
@if(!string.IsNullOrEmpty(item.ProjectUrl)) { <a href="@item.ProjectUrl">@item.ProjectUrl</a> }
|
||||
else { @T("Unknown").ToString() }
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="related">
|
||||
@Html.ActionLink(T("Install").ToString(), "Install", new RouteValueDictionary {{"packageId", item.PackageId}, {"version", item.Version}, {"sourceId", item.Source.Id}, {"redirectTo", "Themes"}})@T(" | ")
|
||||
<a href="@item.PackageStreamUri">@T("Download")</a>
|
||||
</div>
|
||||
|
||||
<div class="properties">
|
||||
<p>@(item.Description == null ? T("(No description").Text : item.Description)</p>
|
||||
<ul class="pageStatus">
|
||||
<li>@T("Last Updated: {0}", DateTime.Now.ToLocalTime())</li>
|
||||
<li> | @T("Author: {0}", !string.IsNullOrEmpty(item.Authors) ? item.Authors : T("Unknown").ToString())</li>
|
||||
<li> | @T("Website: ")
|
||||
@if(!string.IsNullOrEmpty(item.ProjectUrl)) { <a href="@item.ProjectUrl">@item.ProjectUrl</a> }
|
||||
else { @T("Unknown").ToString() }
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>}
|
||||
</ul>
|
||||
}
|
Reference in New Issue
Block a user