mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Merge
--HG-- branch : theming
This commit is contained in:
@@ -84,7 +84,7 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
|
||||
//-- but resorting to
|
||||
|
||||
IEnumerable<ContentItem> contentItems = query.List();
|
||||
var contentItems = query.List();
|
||||
switch (model.Options.OrderBy) {
|
||||
case ContentsOrder.Modified:
|
||||
contentItems = contentItems.OrderByDescending(ci => ci.VersionRecord.Id);
|
||||
@@ -108,16 +108,21 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
contentItems = contentItems.Skip(skip).Take(pageSize).ToList();
|
||||
|
||||
//model.Entries = contentItems.Select(BuildEntry).ToList();
|
||||
//model.Options.SelectedFilter = model.TypeName;
|
||||
//model.Options.FilterOptions = GetCreatableTypes()
|
||||
// .Select(ctd => new KeyValuePair<string, string>(ctd.Name, ctd.DisplayName))
|
||||
// .ToList().OrderBy(kvp => kvp.Key);
|
||||
model.Options.SelectedFilter = model.TypeName;
|
||||
model.Options.FilterOptions = GetCreatableTypes()
|
||||
.Select(ctd => new KeyValuePair<string, string>(ctd.Name, ctd.DisplayName))
|
||||
.ToList().OrderBy(kvp => kvp.Key);
|
||||
|
||||
|
||||
var list = Shape.List();
|
||||
foreach (var item in contentItems)
|
||||
list.Add(Shape.Content(item));
|
||||
list.AddRange(contentItems);
|
||||
|
||||
return View(list);
|
||||
var viewModel = Shape.ViewModel()
|
||||
.ContentItems(list)
|
||||
.Options(model.Options)
|
||||
.TypeDisplayName(model.TypeDisplayName ?? "");
|
||||
|
||||
return View(viewModel);
|
||||
}
|
||||
|
||||
private IEnumerable<ContentTypeDefinition> GetCreatableTypes() {
|
||||
|
@@ -1,35 +1,35 @@
|
||||
@using Orchard.Core.Contents.ViewModels
|
||||
<h1>@//Html.TitleForPage((string.IsNullOrEmpty(Model.TypeDisplayName) ? T("Manage Content") : T("Manage {0} Content", Model.TypeDisplayName)).ToString())</h1>
|
||||
<div class="manage">
|
||||
@//Html.ActionLink(!string.IsNullOrEmpty(Model.TypeDisplayName) ? T("Create New {0}", Model.TypeDisplayName).Text : T("Create New Content").Text, "Create", new { }, new { @class = "button primaryAction" })
|
||||
@Html.ActionLink((string)(!string.IsNullOrEmpty((string)Model.TypeDisplayName) ? T("Create New {0}", Model.TypeDisplayName).Text : T("Create New Content").Text), "Create", null, new { @class = "button primaryAction" })
|
||||
</div>
|
||||
@using (Html.BeginFormAntiForgeryPost()) {
|
||||
<fieldset class="bulk-actions">
|
||||
<label for="publishActions">@T("Actions:")</label>
|
||||
<select id="publishActions" name="@{/*Html.NameOf(m => m.Options.BulkAction)*/}">
|
||||
@//Html.SelectOption(Model.Options.BulkAction, ContentsBulkAction.None, T("Choose action...").ToString())
|
||||
@//Html.SelectOption(Model.Options.BulkAction, ContentsBulkAction.PublishNow, T("Publish Now").ToString())
|
||||
@//Html.SelectOption(Model.Options.BulkAction, ContentsBulkAction.Unpublish, T("Unpublish").ToString())
|
||||
@//Html.SelectOption(Model.Options.BulkAction, ContentsBulkAction.Remove, T("Remove").ToString())
|
||||
<select id="publishActions" name="Options.BulkAction">
|
||||
@Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.None, T("Choose action...").ToString())
|
||||
@Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.PublishNow, T("Publish Now").ToString())
|
||||
@Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.Unpublish, T("Unpublish").ToString())
|
||||
@Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.Remove, T("Remove").ToString())
|
||||
</select>
|
||||
<button type="submit" name="submit.BulkEdit" value="yes">@T("Apply")</button>
|
||||
</fieldset>
|
||||
<fieldset class="bulk-actions">
|
||||
<label for="filterResults" class="bulk-filter">@T("Show")</label>
|
||||
<select id="filterResults" name="@{/*Html.NameOf(m => m.Options.SelectedFilter)*/}">
|
||||
@//Html.SelectOption(Model.Options.SelectedFilter, "", T("any (show all)").ToString())
|
||||
@{/*foreach(var filterOption in Model.Options.FilterOptions) {
|
||||
@Html.SelectOption(Model.Options.SelectedFilter, filterOption.Key, filterOption.Value)
|
||||
}*/}
|
||||
<select id="filterResults" name="Options.SelectedFilter">
|
||||
@Html.SelectOption((string)Model.Options.SelectedFilter, "", T("any (show all)").ToString())
|
||||
@foreach(var filterOption in Model.Options.FilterOptions) {
|
||||
@Html.SelectOption((String)Model.Options.SelectedFilter, (string)filterOption.Key, (string)filterOption.Value)
|
||||
}
|
||||
</select>
|
||||
<label for="orderResults" class="bulk-order">@T("Ordered by")</label>
|
||||
<select id="orderResults" name="@{/*Html.NameOf(m => m.Options.OrderBy)*/}">
|
||||
@//Html.SelectOption(Model.Options.OrderBy, ContentsOrder.Created, T("recently created").ToString())
|
||||
@//Html.SelectOption(Model.Options.OrderBy, ContentsOrder.Modified, T("recently modified").ToString())
|
||||
<select id="orderResults" name="Options.OrderBy">
|
||||
@Html.SelectOption((ContentsOrder)Model.Options.OrderBy, ContentsOrder.Created, T("recently created").ToString())
|
||||
@Html.SelectOption((ContentsOrder)Model.Options.OrderBy, ContentsOrder.Modified, T("recently modified").ToString())
|
||||
</select>
|
||||
<button type="submit" name="submit.Filter" value="yes please">@T("Apply")</button>
|
||||
</fieldset>
|
||||
<fieldset class="contentItems bulk-items">
|
||||
@Display(Model)
|
||||
@Display(Model.ContentItems)
|
||||
</fieldset>
|
||||
}
|
@@ -1,18 +1,17 @@
|
||||
@// Html.RegisterStyle("site.css");
|
||||
<div id="page">
|
||||
<div id="header">
|
||||
@{
|
||||
Model.Header.Add(Display.Header(), "5");
|
||||
Model.Header.Add(Display.User(), "10");
|
||||
Model.Menu.Add(Display.Menu(), "5");
|
||||
Model.Header.Add(Model.Navigation, "15");
|
||||
}
|
||||
<div id="page">
|
||||
<!-- should be a header wrapper (and what about a wrapper for the default layout?) -->
|
||||
<header>
|
||||
@Display(Model.Header)
|
||||
@Display(Model.Menu)
|
||||
</div>
|
||||
</header>
|
||||
<div id="main">
|
||||
<div id="content-wrapper">
|
||||
<div id="content">
|
||||
|
||||
@Display(Model.Content)
|
||||
</div>
|
||||
</div>
|
||||
@@ -22,12 +21,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- should really be a footer wrapper -->
|
||||
<div id="footer-wrapper">
|
||||
<div id="footer">
|
||||
@{
|
||||
Model.Footer.Add(Display.Footer(), "5");
|
||||
}
|
||||
<footer>
|
||||
@Display(Model.Footer)
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
@@ -315,7 +315,6 @@
|
||||
<Content Include="Themes\TheAdmin\Views\User.ascx" />
|
||||
<Content Include="Themes\TheAdmin\Views\Header.ascx" />
|
||||
<Content Include="Themes\Web.config" />
|
||||
<None Include="Themes\TheAdmin\Views\Message.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
|
@@ -1,7 +1,5 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.WebPages;
|
||||
|
||||
namespace Orchard.DisplayManagement.Shapes {
|
||||
public class Shape : IShape, IEnumerable {
|
||||
@@ -26,6 +24,11 @@ namespace Orchard.DisplayManagement.Shapes {
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual Shape AddRange(IEnumerable<object> items) {
|
||||
((List<object>)_items).AddRange(items);
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual IEnumerator GetEnumerator() {
|
||||
return _items.GetEnumerator();
|
||||
}
|
||||
|
Reference in New Issue
Block a user