Some progress on getting blogs back in order.

Definately still in progress. Even what has been changed is not necessarily baked.

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-10-13 11:01:21 -07:00
parent d9444c793b
commit 38a20fb68f
9 changed files with 12 additions and 20 deletions

View File

@@ -151,7 +151,7 @@ namespace Orchard.Blogs.Controllers {
return new NotFoundResult(); return new NotFoundResult();
//TODO: (erikpo) Need to make templatePath be more convention based so if my controller name has "Admin" in it then "Admin/{type}" is assumed //TODO: (erikpo) Need to make templatePath be more convention based so if my controller name has "Admin" in it then "Admin/{type}" is assumed
var model = Services.ContentManager.BuildDisplay(blogPart, "Admin.Blog"); var model = Services.ContentManager.BuildDisplay(blogPart, "Blog_Admin");
return View(model); return View(model);
} }

View File

@@ -36,9 +36,6 @@ namespace Orchard.Blogs.Controllers {
var model = Services.ContentManager.BuildEditor(blogPost); var model = Services.ContentManager.BuildEditor(blogPost);
//todo: (heskew) unhack
model.Metadata.Type += ".BlogPost";
return View(model); return View(model);
} }
@@ -82,9 +79,6 @@ namespace Orchard.Blogs.Controllers {
var model = Services.ContentManager.BuildEditor(post); var model = Services.ContentManager.BuildEditor(post);
//todo: (heskew) unhack
model.Metadata.Type += ".BlogPost";
return View(model); return View(model);
} }

View File

@@ -38,28 +38,24 @@ namespace Orchard.Blogs.Drivers {
var driverResults = new List<DriverResult>(); var driverResults = new List<DriverResult>();
var metadata = shapeHelper.Parts_Blogs_Blog_Manage(ContentPart: part); var metadata = shapeHelper.Parts_Blogs_Blog_Manage(ContentPart: part);
metadata.Metadata.Type = "Parts_Blogs_Blog.Manage";
driverResults.Add(ContentShape(metadata).Location("manage")); driverResults.Add(ContentShape(metadata).Location("manage"));
var description = shapeHelper.Parts_Blogs_Blog_Description(ContentPart: part); var description = shapeHelper.Parts_Blogs_Blog_Description(ContentPart: part);
description.Metadata.Type = "Parts_Blogs_Blog.Description";
driverResults.Add(ContentShape(description).Location("manage", "after")); driverResults.Add(ContentShape(description).Location("manage", "after"));
if (displayType.StartsWith("Admin")) { if (displayType.StartsWith("Admin")) {
var list = shapeHelper.List(); var list = shapeHelper.List();
list.AddRange(_blogPostService.Get(part, VersionOptions.Latest) list.AddRange(_blogPostService.Get(part, VersionOptions.Latest)
.Select(bp => _contentManager.BuildDisplay(bp, "SummaryAdmin.BlogPost"))); .Select(bp => _contentManager.BuildDisplay(bp, "BlogPost_SummaryAdmin")));
var blogPostList = shapeHelper.Parts_Blogs_BlogPost_List(ContentPart: part, BlogPosts: list); var blogPostList = shapeHelper.Parts_Blogs_BlogPost_List_Admin(ContentPart: part, BlogPosts: list);
blogPostList.Metadata.Type = "Parts_Blogs_BlogPost.List.Admin";
var contentShape = ContentShape(blogPostList).Location("Primary"); var contentShape = ContentShape(blogPostList).Location("Primary");
driverResults.Add(contentShape); driverResults.Add(contentShape);
} }
else if (!displayType.Contains("Summary")) { else if (!displayType.Contains("Summary")) {
var list = shapeHelper.List(); var list = shapeHelper.List();
list.AddRange(_blogPostService.Get(part) list.AddRange(_blogPostService.Get(part)
.Select(bp => _contentManager.BuildDisplay(bp, "Summary.BlogPost"))); .Select(bp => _contentManager.BuildDisplay(bp, "BlogPost_Summary")));
var blogPostList = shapeHelper.Parts_Blogs_BlogPost_List(ContentPart: part, BlogPosts: list); var blogPostList = shapeHelper.Parts_Blogs_BlogPost_List(ContentPart: part, BlogPosts: list);
blogPostList.Metadata.Type = "Parts_Blogs_BlogPost.List";
var contentShape = ContentShape(blogPostList).Location("Primary"); var contentShape = ContentShape(blogPostList).Location("Primary");
driverResults.Add(contentShape); driverResults.Add(contentShape);

View File

@@ -136,13 +136,13 @@
<Content Include="Views\Parts\Blogs.BlogPost.List.Admin.cshtml"> <Content Include="Views\Parts\Blogs.BlogPost.List.Admin.cshtml">
<SubType>Code</SubType> <SubType>Code</SubType>
</Content> </Content>
<Content Include="Views\Items\Content.Admin.Blog.cshtml" /> <Content Include="Views\Items\Content.Blog.Admin.cshtml" />
<Content Include="Views\Items\Content.Blog.cshtml" /> <Content Include="Views\Items\Content.Blog.cshtml" />
<Content Include="Views\Items\Content.Detail.BlogPost.cshtml" /> <Content Include="Views\Items\Content.Detail.BlogPost.cshtml" />
<Content Include="Views\Items\Content.Edit.Blog.cshtml"> <Content Include="Views\Items\Content.Edit.Blog.cshtml">
<SubType>Code</SubType> <SubType>Code</SubType>
</Content> </Content>
<Content Include="Views\Items\Content.Edit.BlogPost.cshtml" /> <Content Include="Views\Items\Content.Editor-BlogPost.cshtml" />
<Content Include="Views\Items\Content.Summary.Blog.cshtml" /> <Content Include="Views\Items\Content.Summary.Blog.cshtml" />
<Content Include="Views\Items\Content.Summary.BlogPost.cshtml" /> <Content Include="Views\Items\Content.Summary.BlogPost.cshtml" />
<Content Include="Views\Items\Content.SummaryAdmin.Blog.cshtml" /> <Content Include="Views\Items\Content.SummaryAdmin.Blog.cshtml" />

View File

@@ -8,7 +8,7 @@
@Display(Model.Primary) @Display(Model.Primary)
</div> </div>
<div class="secondary"> <div class="secondary">
@Display(Model.secondary) @Display(Model.Secondary)
<fieldset> <fieldset>
<input class="button primaryAction" type="submit" name="submit.Save" value="@T("Save")"/> <input class="button primaryAction" type="submit" name="submit.Save" value="@T("Save")"/>
@* TODO: (erikpo) In the future, remove the HasPublished check so the user can delete the content item from here if the choose to *@ @* TODO: (erikpo) In the future, remove the HasPublished check so the user can delete the content item from here if the choose to *@

View File

@@ -13,6 +13,7 @@ namespace Orchard.Widgets {
public void Discover(ShapeTableBuilder builder) { public void Discover(ShapeTableBuilder builder) {
builder.Describe("Items_Widget") builder.Describe("Items_Widget")
.Configure(descriptor => { .Configure(descriptor => {
// todo: have "alternates" for chrome
if (_orchardServices.Authorizer.Authorize(Permissions.ManageWidgets)) if (_orchardServices.Authorizer.Authorize(Permissions.ManageWidgets))
descriptor.Wrappers.Add("Widget_Manage"); descriptor.Wrappers.Add("Widget_Manage");
else else

View File

@@ -1,14 +1,15 @@
@model WidgetsIndexViewModel @model WidgetsIndexViewModel
@using Orchard.Widgets.Models; @using Orchard.Widgets.Models;
@using Orchard.Widgets.ViewModels; @using Orchard.Widgets.ViewModels;
@{ Style.Require("WidgetsAdmin"); } @{
Style.Require("WidgetsAdmin");
}
<h1>@Html.TitleForPage(T("Manage Widgets").ToString())</h1> <h1>@Html.TitleForPage(T("Manage Widgets").ToString())</h1>
<div class="manage">@Html.ActionLink(T("Add a layer").ToString(), "AddLayer", new { }, new { @class = "button primaryAction" })</div>
@using(Html.BeginFormAntiForgeryPost()) { @using(Html.BeginFormAntiForgeryPost()) {
Html.ValidationSummary(); Html.ValidationSummary();
<div class="manage">@Html.ActionLink(T("Add a layer").ToString(), "AddLayer", new { }, new { @class = "button primaryAction" })</div>
<div id="widgets"> <div id="widgets">