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 System.Web.Mvc;
|
||||||
using Orchard.Core.Common.Models;
|
using Orchard.Core.Common.Models;
|
||||||
using Orchard.ContentManagement;
|
using Orchard.ContentManagement;
|
||||||
|
using Orchard.Environment.Extensions;
|
||||||
|
|
||||||
namespace Orchard.Blogs.Models {
|
namespace Orchard.Blogs.Models {
|
||||||
|
[OrchardFeature("Blog")]
|
||||||
public class Blog : ContentPart<BlogRecord> {
|
public class Blog : ContentPart<BlogRecord> {
|
||||||
[HiddenInput(DisplayValue = false)]
|
[HiddenInput(DisplayValue = false)]
|
||||||
public int Id { get { return ContentItem.Id; } }
|
public int Id { get { return ContentItem.Id; } }
|
||||||
|
@@ -1,2 +1,7 @@
|
|||||||
name: Blogs
|
name: Blogs
|
||||||
antiforgery: enabled
|
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 string MenuName { get { return "admin"; } }
|
||||||
|
|
||||||
public void GetNavigation(NavigationBuilder builder) {
|
public void GetNavigation(NavigationBuilder builder) {
|
||||||
builder.Add("Modules", "10",
|
builder.Add("Features", "10",
|
||||||
menu => menu
|
menu => menu
|
||||||
.Add("Manage Modules", "1.0", item => item.Action("Index", "Admin", new { area = "Orchard.Modules" })
|
.Add("Manage Features", "1.0", item => item.Action("Features", "Admin", new { area = "Orchard.Modules" })
|
||||||
.Permission(Permissions.ManageModules))
|
.Permission(Permissions.ManageFeatures))
|
||||||
.Add("Manage Features", "2.0", item => item.Action("Features", "Admin", new { area = "Orchard.Modules" })
|
.Add("Manage Modules", "2.0", item => item.Action("Index", "Admin", new { area = "Orchard.Modules" })
|
||||||
.Permission(Permissions.ManageFeatures)));
|
.Permission(Permissions.ManageModules)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -2,7 +2,7 @@
|
|||||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||||
<%@ Import Namespace="Orchard.Modules.ViewModels"%>
|
<%@ Import Namespace="Orchard.Modules.ViewModels"%>
|
||||||
<h1><%=Html.TitleForPage(T("Manage Features").ToString()) %></h1>
|
<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) {
|
<% if (Model.Features.Count() > 0) {
|
||||||
|
|
||||||
using (Html.BeginFormAntiForgeryPost()) { %>
|
using (Html.BeginFormAntiForgeryPost()) { %>
|
||||||
@@ -19,11 +19,11 @@ using (Html.BeginFormAntiForgeryPost()) { %>
|
|||||||
<fieldset class="pageList">
|
<fieldset class="pageList">
|
||||||
<ul class="contentItems"><%
|
<ul class="contentItems"><%
|
||||||
foreach (var featureGroup in Model.Features.OrderBy(f => f.Descriptor.Name).GroupBy(f => f.Descriptor.Category)) { %>
|
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>
|
<h2><%=Html.Encode(featureGroup.First().Descriptor.Category ?? T("General")) %></h2>
|
||||||
<ul><%
|
<ul><%
|
||||||
foreach (var feature in featureGroup) {%>
|
foreach (var feature in featureGroup) {%>
|
||||||
<li>
|
<li<%=feature == featureGroup.Last() ? " class=\"last\"" : "" %>>
|
||||||
<div class="summary">
|
<div class="summary">
|
||||||
<div class="properties">
|
<div class="properties">
|
||||||
<input type="checkbox" name="selection" value="<%=Html.Encode(feature.Descriptor.Name) %>" />
|
<input type="checkbox" name="selection" value="<%=Html.Encode(feature.Descriptor.Name) %>" />
|
||||||
@@ -40,19 +40,12 @@ using (Html.BeginFormAntiForgeryPost()) { %>
|
|||||||
</li><%
|
</li><%
|
||||||
//dependencies
|
//dependencies
|
||||||
if (feature.Descriptor.Dependencies.Count() > 0) { %>
|
if (feature.Descriptor.Dependencies.Count() > 0) { %>
|
||||||
<li> |
|
<li> | <%=_Encoded("Depends on: ") %><%
|
||||||
<%=_Encoded("Depends on: ") %><%
|
|
||||||
foreach (var dependency in feature.Descriptor.Dependencies) {
|
foreach (var dependency in feature.Descriptor.Dependencies) {
|
||||||
%><% if (dependency != feature.Descriptor.Dependencies.First()) { %><%=_Encoded(", ") %><% }
|
%><% if (dependency != feature.Descriptor.Dependencies.First()) { %><%=_Encoded(", ") %><% }
|
||||||
%><%=Html.Encode(dependency) %><%
|
%><%=Html.Encode(dependency) %><%
|
||||||
} %>
|
} %>
|
||||||
</li><%
|
</li><%
|
||||||
}
|
|
||||||
//dependencies == nothing <- temporary just to get some stuff in the UI
|
|
||||||
else { %>
|
|
||||||
<li> |
|
|
||||||
<%=T("Depends on: <em>nothing</em>") %>
|
|
||||||
</li><%
|
|
||||||
} %>
|
} %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -2,8 +2,10 @@
|
|||||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||||
<%@ Import Namespace="Orchard.Modules.ViewModels"%>
|
<%@ Import Namespace="Orchard.Modules.ViewModels"%>
|
||||||
<h1><%=Html.TitleForPage(T("Manage Modules").ToString()) %></h1>
|
<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>
|
<h2><%=T("Installed Modules") %></h2>
|
||||||
<% if (Model.Modules.Count() > 0) { %>
|
<% if (Model.Modules.Count() > 0) { %>
|
||||||
|
<fieldset class="pageList">
|
||||||
<ul class="contentItems blogs"><%
|
<ul class="contentItems blogs"><%
|
||||||
foreach (var module in Model.Modules.OrderBy(m => m.DisplayName)) { %>
|
foreach (var module in Model.Modules.OrderBy(m => m.DisplayName)) { %>
|
||||||
<li>
|
<li>
|
||||||
@@ -21,5 +23,6 @@
|
|||||||
} %>
|
} %>
|
||||||
</li><%
|
</li><%
|
||||||
} %>
|
} %>
|
||||||
</ul><%
|
</ul>
|
||||||
|
</fieldset><%
|
||||||
} %>
|
} %>
|
@@ -607,6 +607,9 @@ button.ibutton {
|
|||||||
.contentItems li.first {
|
.contentItems li.first {
|
||||||
background:#fff url(images/backgroundGradient.gif) repeat-x top left;
|
background:#fff url(images/backgroundGradient.gif) repeat-x top left;
|
||||||
}
|
}
|
||||||
|
.contentItems li li.last {
|
||||||
|
border-bottom:0;
|
||||||
|
}
|
||||||
#main .contentItems li h3 {
|
#main .contentItems li h3 {
|
||||||
border-bottom:0;
|
border-bottom:0;
|
||||||
margin-top:0;
|
margin-top:0;
|
||||||
@@ -753,6 +756,7 @@ table.items, textarea, input.text, input.text-box,
|
|||||||
margin-top:1em;
|
margin-top:1em;
|
||||||
}
|
}
|
||||||
.summary {
|
.summary {
|
||||||
|
overflow:auto;
|
||||||
padding:1.2em .4em;
|
padding:1.2em .4em;
|
||||||
}
|
}
|
||||||
.actions {
|
.actions {
|
||||||
|
Reference in New Issue
Block a user