Simple content item, with support for zones, editor, and display partial templates working

--HG--
branch : theming
This commit is contained in:
Louis DeJardin
2010-09-09 13:52:45 -07:00
parent 91684d050b
commit b809247464
14 changed files with 123 additions and 90 deletions

View File

@@ -1,32 +1,47 @@
using System.Web.Mvc;
using Orchard.ContentManagement;
using Orchard.Core.Common.Models;
using Orchard.DisplayManagement;
using Orchard.Security;
namespace Orchard.Core.Dashboard.Controllers {
public class AdminController : Controller {
private readonly IShapeHelperFactory _shapeHelperFactory;
private readonly IContentManager _contentManager;
public AdminController(IShapeHelperFactory shapeHelperFactory) {
public AdminController(IShapeHelperFactory shapeHelperFactory, IContentManager contentManager) {
_shapeHelperFactory = shapeHelperFactory;
_contentManager = contentManager;
}
public virtual IUser CurrentUser { get; set; }
public ActionResult Index() {
var shape = _shapeHelperFactory.CreateHelper();
var list = shape.List();
var list2 = shape.List();
list.Id = "the-list";
list.Classes.Add("foo");
list.Attributes["onclick"] = "etc";
list.ItemClasses.Add("yarg");
list.Add(_contentManager.BuildDisplayModel(CurrentUser, "Detail"));
foreach (var contentItem in _contentManager.Query().Join<BodyPartRecord>().List()) {
list.Add(_contentManager.BuildDisplayModel(contentItem, "Summary"));
}
list.Add("one");
list.Add("two");
list.Add(list2);
list.Add(shape.DumpShapeTable());
list.Add("four");
//
//var list2 = shape.List();
list2.Add("three a");
list2.Add("three b");
//list.Id = "the-list";
//list.Classes.Add("foo");
//list.Attributes["onclick"] = "etc";
//list.ItemClasses.Add("yarg");
//list.Add("one");
//list.Add("two");
//list.Add(list2);
//list.Add(shape.DumpShapeTable());
//list.Add("four");
//list2.Add("three a");
//list2.Add("three b");)))
return View(list);
}

View File

@@ -4,4 +4,4 @@
<p><%: T("This is the place where you can manage your web site, its appearance and its contents. Please take a moment to explore the different menu items on the left of the screen to familiarize yourself with the features of the application. For example, try to change the theme through the “Manage Themes” menu entry. You can also create new pages and manage existing ones through the “Manage Pages” menu entry or create blogs through “Manage Blogs”.") %></p>
<p><%: T("Have fun!") %><br /><%: T("The Orchard Team") %></p>
<%:Display(Model) %>
<div style="border:1px solid black;" role="experimentation"><%:Display(Model) %></div>