mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Aligning package update page to gallery. Moving the update feature to the packaging module as a feature.
--HG-- branch : dev
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
@using Orchard.Modules.Extensions
|
||||
@using Orchard.Mvc.Html;
|
||||
@using Orchard.Packaging.ViewModels;
|
||||
@using Orchard.Packaging.Services;
|
||||
@using Orchard.Packaging.Models;
|
||||
@using Orchard.Environment.Extensions.Models;
|
||||
@using Orchard.Utility.Extensions;
|
||||
@model PackagingListViewModel
|
||||
|
||||
@{
|
||||
Style.Require("PackagingAdmin");
|
||||
|
||||
Layout.Title = T("Modules").ToString();
|
||||
}
|
||||
|
||||
@functions {
|
||||
public string InstallAction(PackagingEntry package) {
|
||||
return Url.Action("Install", "GalleryUpdates", new {
|
||||
area = "Orchard.Packaging",
|
||||
packageId = package.PackageId,
|
||||
version = package.Version,
|
||||
sourceId = package.Source.Id,
|
||||
returnUrl = "ModulesUpdates"
|
||||
});
|
||||
}
|
||||
public string UninstallAction(PackagingEntry package) {
|
||||
return Url.Action("Uninstall", "GalleryUpdates", new {
|
||||
area = "Orchard.Packaging",
|
||||
packageId = package.PackageId,
|
||||
returnUrl = "ModulesUpdates"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@if (Model.Entries.Count() <= 0) {
|
||||
<p>No package updates available.</p>
|
||||
} else {
|
||||
<ul class="contentItems">
|
||||
@foreach (var module in Model.Entries) {
|
||||
<li>
|
||||
@{
|
||||
string iconUrl = @module.NewVersionToInstall.IconUrl;
|
||||
if (string.IsNullOrWhiteSpace(iconUrl)) {
|
||||
iconUrl = Href("../../Content/Images/ModuleDefaultIcon.png");
|
||||
}
|
||||
}
|
||||
|
||||
<div class="iconThumbnail">
|
||||
<div class="extensionDetails column">
|
||||
<div class="extensionName">
|
||||
@if (!string.IsNullOrWhiteSpace(module.NewVersionToInstall.GalleryDetailsUrl)) {
|
||||
<a href="@module.NewVersionToInstall.GalleryDetailsUrl">
|
||||
<h2>@module.NewVersionToInstall.Title<span> - @T("Version: {0}", module.NewVersionToInstall.Version)</span></h2>
|
||||
</a>
|
||||
} else {
|
||||
<h2>@module.NewVersionToInstall.Title<span> - @T("Version: {0}", module.NewVersionToInstall.Version)</span></h2>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="related">
|
||||
@Html.Link(T("Install Latest").Text, InstallAction(module.NewVersionToInstall))@T(" | ")
|
||||
<a href="@module.NewVersionToInstall.PackageStreamUri">@T("Download")</a>
|
||||
</div>
|
||||
|
||||
<div class="properties">
|
||||
<p>@(module.NewVersionToInstall.Description == null ? T("(No description").Text : module.NewVersionToInstall.Description)</p>
|
||||
<ul class="pageStatus">
|
||||
<li>@T("Last Updated: {0}", module.NewVersionToInstall.LastUpdated)</li>
|
||||
<li> | @T("Author: {0}", !string.IsNullOrEmpty(module.NewVersionToInstall.Authors) ? module.NewVersionToInstall.Authors : T("Unknown").ToString())</li>
|
||||
<li> | @T("Downloads: {0}", module.NewVersionToInstall.DownloadCount)</li>
|
||||
<li> | @T("Website: ")
|
||||
@if (!string.IsNullOrEmpty(module.NewVersionToInstall.ProjectUrl)) { <a href="@module.NewVersionToInstall.ProjectUrl">@module.NewVersionToInstall.ProjectUrl</a> } else { @T("Unknown").ToString() }
|
||||
</li>
|
||||
<li><div> | @T("Rating: ")
|
||||
<div class="ratings" style="width:@(15 * 5)px" title="@T("Ratings: {0} ({1})", module.NewVersionToInstall.Rating, module.NewVersionToInstall.RatingsCount)">
|
||||
<div class="score" style="width:@(15 * (module.NewVersionToInstall.Rating))px"> </div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="extensionThumbnail column">
|
||||
<img src="@iconUrl" class="thumbnail" alt="module" />
|
||||
</div>
|
||||
</div>
|
||||
</li>}
|
||||
</ul>
|
||||
|
||||
@Display(Model.Pager)
|
||||
}
|
Reference in New Issue
Block a user