mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Refactoring Modules Index templates to use better local variables.
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
if (Model.Modules.Any()) {
|
||||
<ul class="contentItems">
|
||||
@foreach (ModuleEntry module in Model.Modules.OrderBy(m => m.Descriptor.Name)) {
|
||||
<li>@Display.ModuleEntry(ContentPart: module)</li>
|
||||
<li>@Display.ModuleEntry(Module: module)</li>
|
||||
}
|
||||
</ul>
|
||||
} else {
|
||||
|
@@ -3,29 +3,32 @@
|
||||
@using Orchard.Modules.ViewModels;
|
||||
@using Orchard.Environment.Extensions.Models;
|
||||
|
||||
@{ string moduleClasses = Model.ContentPart.IsRecentlyInstalled ? "recentlyInstalledModule" : string.Empty; }
|
||||
@{
|
||||
Orchard.Modules.Models.ModuleEntry module = Model.Module;
|
||||
string moduleClasses = module.IsRecentlyInstalled ? "recentlyInstalledModule" : string.Empty;
|
||||
}
|
||||
|
||||
<div class="summary">
|
||||
@if (Model.ContentPart.Notifications != null && Model.ContentPart.Notifications.Count > 0) {
|
||||
@if (module.Notifications != null && module.Notifications.Count > 0) {
|
||||
<div class="notifications">
|
||||
@foreach (string notification in Model.ContentPart.Notifications) {
|
||||
@foreach (string notification in module.Notifications) {
|
||||
<h5>@Html.Raw(notification)</h5>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
<div class="properties">
|
||||
<h2@{ if(!string.IsNullOrEmpty(moduleClasses)) {<text> class="@moduleClasses"</text>}}>@Model.ContentPart.Descriptor.Name<span> - @T("Version: {0}", !string.IsNullOrEmpty(Model.ContentPart.Descriptor.Version) ? Model.ContentPart.Descriptor.Version : T("1.0").ToString())</span></h2>
|
||||
<h2@{ if(!string.IsNullOrEmpty(moduleClasses)) {<text> class="@moduleClasses"</text>}}>@module.Descriptor.Name<span> - @T("Version: {0}", !string.IsNullOrEmpty(module.Descriptor.Version) ? module.Descriptor.Version : T("1.0").ToString())</span></h2>
|
||||
|
||||
@if (!string.IsNullOrEmpty(Model.ContentPart.Descriptor.Description)) {
|
||||
<p>@Model.ContentPart.Descriptor.Description</p>
|
||||
@if (!string.IsNullOrEmpty(module.Descriptor.Description)) {
|
||||
<p>@module.Descriptor.Description</p>
|
||||
}
|
||||
|
||||
<ul class="pageStatus" style="color:#666; margin:.6em 0 0 0;">
|
||||
@{ IEnumerable<FeatureDescriptor> features = Model.ContentPart.Descriptor.Features; }
|
||||
@{ IEnumerable<FeatureDescriptor> features = module.Descriptor.Features; }
|
||||
<li>@T("Features: {0}", MvcHtmlString.Create(string.Join(", ", features.Select(f => Html.Link(string.IsNullOrEmpty(f.Name) ? f.Id : f.Name, string.Format("{0}#{1}", Url.Action("features", new { area = "Orchard.Modules" }), f.Id.AsFeatureId(n => T(n)))).ToString()).OrderBy(s => s).ToArray())))</li>
|
||||
<li> | @T("Author: {0}", !string.IsNullOrEmpty(Model.ContentPart.Descriptor.Author) ? Model.ContentPart.Descriptor.Author : T("Unknown").ToString())</li>
|
||||
<li> | @T("Author: {0}", !string.IsNullOrEmpty(module.Descriptor.Author) ? module.Descriptor.Author : T("Unknown").ToString())</li>
|
||||
<li> | @T("Website: ")
|
||||
@if (!string.IsNullOrEmpty(Model.ContentPart.Descriptor.WebSite)) { <a href="@Model.ContentPart.Descriptor.WebSite">@Model.ContentPart.Descriptor.WebSite</a> }
|
||||
@if (!string.IsNullOrEmpty(module.Descriptor.WebSite)) { <a href="@module.Descriptor.WebSite">@module.Descriptor.WebSite</a> }
|
||||
else { @T("Unknown").ToString() }
|
||||
</li>
|
||||
</ul>
|
||||
|
Reference in New Issue
Block a user