Bringing back the Feature management's view switcher

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-11-03 23:03:34 -07:00
parent e299284eb1
commit b73e125ab4
5 changed files with 8 additions and 15 deletions

View File

@@ -298,7 +298,6 @@
<Content Include="Shapes\Views\HeadPreload.cshtml" /> <Content Include="Shapes\Views\HeadPreload.cshtml" />
<Content Include="Shapes\Views\Message.cshtml" /> <Content Include="Shapes\Views\Message.cshtml" />
<Content Include="Shapes\Views\NotFound.cshtml" /> <Content Include="Shapes\Views\NotFound.cshtml" />
<Content Include="Shapes\Views\UI\Switchable.cshtml" />
<Content Include="Web.config" /> <Content Include="Web.config" />
<Content Include="XmlRpc\Module.txt" /> <Content Include="XmlRpc\Module.txt" />
<Content Include="Settings\Views\EditorTemplates\Parts\Settings.SiteSettingsPart.cshtml" /> <Content Include="Settings\Views\EditorTemplates\Parts\Settings.SiteSettingsPart.cshtml" />

View File

@@ -1,7 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Orchard.UI.Resources; using Orchard.UI.Resources;
namespace Orchard.Core.Shapes { namespace Orchard.Core.Shapes {
@@ -11,6 +7,11 @@ namespace Orchard.Core.Shapes {
manifest.DefineScript("ShapesBase").SetUrl("base.js").SetDependencies("jQuery"); manifest.DefineScript("ShapesBase").SetUrl("base.js").SetDependencies("jQuery");
manifest.DefineStyle("Shapes").SetUrl("site.css"); // todo: missing manifest.DefineStyle("Shapes").SetUrl("site.css"); // todo: missing
manifest.DefineStyle("ShapesSpecial").SetUrl("special.css"); manifest.DefineStyle("ShapesSpecial").SetUrl("special.css");
manifest.DefineScript("Switchable").SetUrl("jquery.switchable.js")
.SetDependencies("jQuery")
.SetDependencies("ShapesBase");
manifest.DefineStyle("Switchable").SetUrl("jquery.switchable.css");
} }
} }
} }

View File

@@ -1,5 +0,0 @@
@{
Style.Require("Switchable");
Script.Require("Switchable");
}
@string.Format("{0} switchable", Model)

View File

@@ -4,14 +4,15 @@
@using Orchard.Modules.ViewModels; @using Orchard.Modules.ViewModels;
@using Orchard.Utility.Extensions; @using Orchard.Utility.Extensions;
@using Orchard.Modules.Models; @using Orchard.Modules.Models;
@{ @{
Style.Require("ModulesAdmin"); Style.Require("ModulesAdmin");
Style.Require("Switchable");
Script.Require("Switchable");
} }
<h1>@Html.TitleForPage(T("Manage Features").ToString())</h1> <h1>@Html.TitleForPage(T("Manage Features").ToString())</h1>
@if (Model.Features.Count() > 0) { @if (Model.Features.Count() > 0) {
<ul class="features summary-view">@{ <ul class="features summary-view switchable">@{
var featureGroups = Model.Features.OrderBy(f => f.Descriptor.Category, new DoghouseComparer("Core")).GroupBy(f => f.Descriptor.Category); var featureGroups = Model.Features.OrderBy(f => f.Descriptor.Category, new DoghouseComparer("Core")).GroupBy(f => f.Descriptor.Category);
foreach (var featureGroup in featureGroups) { foreach (var featureGroup in featureGroups) {
var categoryName = LocalizedString.TextOrDefault(featureGroup.First().Descriptor.Category, T("Uncategorized")); var categoryName = LocalizedString.TextOrDefault(featureGroup.First().Descriptor.Category, T("Uncategorized"));

View File

@@ -6,9 +6,6 @@ namespace Orchard.Themes {
public void BuildManifests(ResourceManifestBuilder builder) { public void BuildManifests(ResourceManifestBuilder builder) {
var manifest = builder.Add(); var manifest = builder.Add();
manifest.DefineStyle("ThemesAdmin").SetUrl("admin.css"); manifest.DefineStyle("ThemesAdmin").SetUrl("admin.css");
// todo: used by core\shapes -- move it?
manifest.DefineScript("Switchable").SetUrl("jquery.switchable.js").SetDependencies("jQuery");
manifest.DefineStyle("Switchable").SetUrl("jquery.switchable.css");
// todo: include and define the min.js version too // todo: include and define the min.js version too
// todo: move EasySlider to common location, although it does not appear to be used anywhere right now // todo: move EasySlider to common location, although it does not appear to be used anywhere right now