mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
More work on the module/feature UI*
- reshuffled the related admin menu - cleaned up a little of each module and feature list page * still all based on the page list semantics --HG-- branch : dev
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Environment.Extensions;
|
||||
|
||||
namespace Orchard.Blogs.Models {
|
||||
[OrchardFeature("Blog")]
|
||||
public class Blog : ContentPart<BlogRecord> {
|
||||
[HiddenInput(DisplayValue = false)]
|
||||
public int Id { get { return ContentItem.Id; } }
|
||||
|
@@ -1,2 +1,7 @@
|
||||
name: Blogs
|
||||
antiforgery: enabled
|
||||
features:
|
||||
Blog:
|
||||
Description: A simple web log
|
||||
Dependencies: Common, XmlRpc
|
||||
Category: Blog
|
@@ -5,12 +5,12 @@ namespace Orchard.Modules {
|
||||
public string MenuName { get { return "admin"; } }
|
||||
|
||||
public void GetNavigation(NavigationBuilder builder) {
|
||||
builder.Add("Modules", "10",
|
||||
builder.Add("Features", "10",
|
||||
menu => menu
|
||||
.Add("Manage Modules", "1.0", item => item.Action("Index", "Admin", new { area = "Orchard.Modules" })
|
||||
.Permission(Permissions.ManageModules))
|
||||
.Add("Manage Features", "2.0", item => item.Action("Features", "Admin", new { area = "Orchard.Modules" })
|
||||
.Permission(Permissions.ManageFeatures)));
|
||||
.Add("Manage Features", "1.0", item => item.Action("Features", "Admin", new { area = "Orchard.Modules" })
|
||||
.Permission(Permissions.ManageFeatures))
|
||||
.Add("Manage Modules", "2.0", item => item.Action("Index", "Admin", new { area = "Orchard.Modules" })
|
||||
.Permission(Permissions.ManageModules)));
|
||||
}
|
||||
}
|
||||
}
|
@@ -2,7 +2,7 @@
|
||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||
<%@ Import Namespace="Orchard.Modules.ViewModels"%>
|
||||
<h1><%=Html.TitleForPage(T("Manage Features").ToString()) %></h1>
|
||||
<div class="manage"><%=Html.ActionLink(T("∞").ToString(), "Features", new { }, new { @class = "button primaryAction" })%></div>
|
||||
<div class="manage" style="visibility:hidden"><%=Html.ActionLink(T("∞").ToString(), "Features", new { }, new { @class = "button primaryAction" })%></div>
|
||||
<% if (Model.Features.Count() > 0) {
|
||||
|
||||
using (Html.BeginFormAntiForgeryPost()) { %>
|
||||
@@ -19,11 +19,11 @@ using (Html.BeginFormAntiForgeryPost()) { %>
|
||||
<fieldset class="pageList">
|
||||
<ul class="contentItems"><%
|
||||
foreach (var featureGroup in Model.Features.OrderBy(f => f.Descriptor.Name).GroupBy(f => f.Descriptor.Category)) { %>
|
||||
<li>
|
||||
<li<%=featureGroup == Model.Features.Last() ? " class=\"last\"" : "" %>>
|
||||
<h2><%=Html.Encode(featureGroup.First().Descriptor.Category ?? T("General")) %></h2>
|
||||
<ul><%
|
||||
foreach (var feature in featureGroup) {%>
|
||||
<li>
|
||||
<li<%=feature == featureGroup.Last() ? " class=\"last\"" : "" %>>
|
||||
<div class="summary">
|
||||
<div class="properties">
|
||||
<input type="checkbox" name="selection" value="<%=Html.Encode(feature.Descriptor.Name) %>" />
|
||||
@@ -40,19 +40,12 @@ using (Html.BeginFormAntiForgeryPost()) { %>
|
||||
</li><%
|
||||
//dependencies
|
||||
if (feature.Descriptor.Dependencies.Count() > 0) { %>
|
||||
<li> |
|
||||
<%=_Encoded("Depends on: ") %><%
|
||||
<li> | <%=_Encoded("Depends on: ") %><%
|
||||
foreach (var dependency in feature.Descriptor.Dependencies) {
|
||||
%><% if (dependency != feature.Descriptor.Dependencies.First()) { %><%=_Encoded(", ") %><% }
|
||||
%><%=Html.Encode(dependency) %><%
|
||||
} %>
|
||||
</li><%
|
||||
}
|
||||
//dependencies == nothing <- temporary just to get some stuff in the UI
|
||||
else { %>
|
||||
<li> |
|
||||
<%=T("Depends on: <em>nothing</em>") %>
|
||||
</li><%
|
||||
} %>
|
||||
</ul>
|
||||
</div>
|
||||
|
@@ -2,8 +2,10 @@
|
||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||
<%@ Import Namespace="Orchard.Modules.ViewModels"%>
|
||||
<h1><%=Html.TitleForPage(T("Manage Modules").ToString()) %></h1>
|
||||
<div class="manage"><%=Html.ActionLink(T("Install a module").ToString(), "Features", new { }, new { @class = "button primaryAction" })%></div>
|
||||
<h2><%=T("Installed Modules") %></h2>
|
||||
<% if (Model.Modules.Count() > 0) { %>
|
||||
<fieldset class="pageList">
|
||||
<ul class="contentItems blogs"><%
|
||||
foreach (var module in Model.Modules.OrderBy(m => m.DisplayName)) { %>
|
||||
<li>
|
||||
@@ -21,5 +23,6 @@
|
||||
} %>
|
||||
</li><%
|
||||
} %>
|
||||
</ul><%
|
||||
</ul>
|
||||
</fieldset><%
|
||||
} %>
|
@@ -607,6 +607,9 @@ button.ibutton {
|
||||
.contentItems li.first {
|
||||
background:#fff url(images/backgroundGradient.gif) repeat-x top left;
|
||||
}
|
||||
.contentItems li li.last {
|
||||
border-bottom:0;
|
||||
}
|
||||
#main .contentItems li h3 {
|
||||
border-bottom:0;
|
||||
margin-top:0;
|
||||
@@ -753,6 +756,7 @@ table.items, textarea, input.text, input.text-box,
|
||||
margin-top:1em;
|
||||
}
|
||||
.summary {
|
||||
overflow:auto;
|
||||
padding:1.2em .4em;
|
||||
}
|
||||
.actions {
|
||||
|
Reference in New Issue
Block a user