mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Updating the features admin UI to drop the "Core" category to the bottom of the page
--HG-- branch : dev
This commit is contained in:
@@ -0,0 +1,27 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Orchard.Modules.Models {
|
||||||
|
public class DoghouseComparer : IComparer<string> {
|
||||||
|
private readonly string _theDog;
|
||||||
|
|
||||||
|
public DoghouseComparer(string theDog) {
|
||||||
|
_theDog = theDog;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int Compare(string x, string y) {
|
||||||
|
if (x == null || y == null)
|
||||||
|
return x == null && y == null ? 0 : (x == null ? -1 : 1);
|
||||||
|
|
||||||
|
if (string.Equals(x, y, StringComparison.OrdinalIgnoreCase))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (string.Equals(x, _theDog, StringComparison.OrdinalIgnoreCase))
|
||||||
|
return 1;
|
||||||
|
if (string.Equals(y, _theDog, StringComparison.OrdinalIgnoreCase))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return string.Compare(x, y, StringComparison.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -69,6 +69,7 @@
|
|||||||
<Compile Include="Commands\FeatureCommands.cs" />
|
<Compile Include="Commands\FeatureCommands.cs" />
|
||||||
<Compile Include="Controllers\AdminController.cs" />
|
<Compile Include="Controllers\AdminController.cs" />
|
||||||
<Compile Include="Extensions\StringExtensions.cs" />
|
<Compile Include="Extensions\StringExtensions.cs" />
|
||||||
|
<Compile Include="Models\DoghouseComparer.cs" />
|
||||||
<Compile Include="Models\ModuleFeature.cs" />
|
<Compile Include="Models\ModuleFeature.cs" />
|
||||||
<Compile Include="ViewModels\FeaturesViewModel.cs" />
|
<Compile Include="ViewModels\FeaturesViewModel.cs" />
|
||||||
<Compile Include="Models\Module.cs" />
|
<Compile Include="Models\Module.cs" />
|
||||||
|
|||||||
@@ -2,12 +2,13 @@
|
|||||||
<%@ Import Namespace="Orchard.Localization" %>
|
<%@ Import Namespace="Orchard.Localization" %>
|
||||||
<%@ Import Namespace="Orchard.Modules.Extensions" %>
|
<%@ Import Namespace="Orchard.Modules.Extensions" %>
|
||||||
<%@ Import Namespace="Orchard.Modules.ViewModels"%>
|
<%@ Import Namespace="Orchard.Modules.ViewModels"%>
|
||||||
<%@ Import Namespace="Orchard.Utility.Extensions" %><%
|
<%@ Import Namespace="Orchard.Utility.Extensions" %>
|
||||||
|
<%@ Import Namespace="Orchard.Modules.Models" %><%
|
||||||
Html.RegisterStyle("admin.css"); %>
|
Html.RegisterStyle("admin.css"); %>
|
||||||
<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="<% Html.RenderPartial("UI/Switchable", "features summary-view"); %>"><%
|
<ul class="<% Html.RenderPartial("UI/Switchable", "features summary-view"); %>"><%
|
||||||
var featureGroups = Model.Features.OrderBy(f => f.Descriptor.Category).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"));
|
||||||
var categoryClassName = string.Format("category {0}", Html.Encode(categoryName.ToString().HtmlClassify()));
|
var categoryClassName = string.Format("category {0}", Html.Encode(categoryName.ToString().HtmlClassify()));
|
||||||
|
|||||||
Reference in New Issue
Block a user