mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 19:04:51 +08:00
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:
@@ -151,7 +151,7 @@ namespace Orchard.Blogs.Controllers {
|
||||
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
|
||||
var model = Services.ContentManager.BuildDisplay(blogPart, "Admin.Blog");
|
||||
var model = Services.ContentManager.BuildDisplay(blogPart, "Blog_Admin");
|
||||
return View(model);
|
||||
}
|
||||
|
||||
|
@@ -36,9 +36,6 @@ namespace Orchard.Blogs.Controllers {
|
||||
|
||||
var model = Services.ContentManager.BuildEditor(blogPost);
|
||||
|
||||
//todo: (heskew) unhack
|
||||
model.Metadata.Type += ".BlogPost";
|
||||
|
||||
return View(model);
|
||||
}
|
||||
|
||||
@@ -82,9 +79,6 @@ namespace Orchard.Blogs.Controllers {
|
||||
|
||||
var model = Services.ContentManager.BuildEditor(post);
|
||||
|
||||
//todo: (heskew) unhack
|
||||
model.Metadata.Type += ".BlogPost";
|
||||
|
||||
return View(model);
|
||||
}
|
||||
|
||||
|
@@ -38,28 +38,24 @@ namespace Orchard.Blogs.Drivers {
|
||||
var driverResults = new List<DriverResult>();
|
||||
|
||||
var metadata = shapeHelper.Parts_Blogs_Blog_Manage(ContentPart: part);
|
||||
metadata.Metadata.Type = "Parts_Blogs_Blog.Manage";
|
||||
driverResults.Add(ContentShape(metadata).Location("manage"));
|
||||
|
||||
var description = shapeHelper.Parts_Blogs_Blog_Description(ContentPart: part);
|
||||
description.Metadata.Type = "Parts_Blogs_Blog.Description";
|
||||
driverResults.Add(ContentShape(description).Location("manage", "after"));
|
||||
|
||||
if (displayType.StartsWith("Admin")) {
|
||||
var list = shapeHelper.List();
|
||||
list.AddRange(_blogPostService.Get(part, VersionOptions.Latest)
|
||||
.Select(bp => _contentManager.BuildDisplay(bp, "SummaryAdmin.BlogPost")));
|
||||
var blogPostList = shapeHelper.Parts_Blogs_BlogPost_List(ContentPart: part, BlogPosts: list);
|
||||
blogPostList.Metadata.Type = "Parts_Blogs_BlogPost.List.Admin";
|
||||
.Select(bp => _contentManager.BuildDisplay(bp, "BlogPost_SummaryAdmin")));
|
||||
var blogPostList = shapeHelper.Parts_Blogs_BlogPost_List_Admin(ContentPart: part, BlogPosts: list);
|
||||
var contentShape = ContentShape(blogPostList).Location("Primary");
|
||||
driverResults.Add(contentShape);
|
||||
}
|
||||
else if (!displayType.Contains("Summary")) {
|
||||
var list = shapeHelper.List();
|
||||
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);
|
||||
blogPostList.Metadata.Type = "Parts_Blogs_BlogPost.List";
|
||||
var contentShape = ContentShape(blogPostList).Location("Primary");
|
||||
driverResults.Add(contentShape);
|
||||
|
||||
|
@@ -136,13 +136,13 @@
|
||||
<Content Include="Views\Parts\Blogs.BlogPost.List.Admin.cshtml">
|
||||
<SubType>Code</SubType>
|
||||
</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.Detail.BlogPost.cshtml" />
|
||||
<Content Include="Views\Items\Content.Edit.Blog.cshtml">
|
||||
<SubType>Code</SubType>
|
||||
</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.BlogPost.cshtml" />
|
||||
<Content Include="Views\Items\Content.SummaryAdmin.Blog.cshtml" />
|
||||
|
@@ -8,7 +8,7 @@
|
||||
@Display(Model.Primary)
|
||||
</div>
|
||||
<div class="secondary">
|
||||
@Display(Model.secondary)
|
||||
@Display(Model.Secondary)
|
||||
<fieldset>
|
||||
<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 *@
|
@@ -13,6 +13,7 @@ namespace Orchard.Widgets {
|
||||
public void Discover(ShapeTableBuilder builder) {
|
||||
builder.Describe("Items_Widget")
|
||||
.Configure(descriptor => {
|
||||
// todo: have "alternates" for chrome
|
||||
if (_orchardServices.Authorizer.Authorize(Permissions.ManageWidgets))
|
||||
descriptor.Wrappers.Add("Widget_Manage");
|
||||
else
|
||||
|
@@ -1,14 +1,15 @@
|
||||
@model WidgetsIndexViewModel
|
||||
@using Orchard.Widgets.Models;
|
||||
@using Orchard.Widgets.ViewModels;
|
||||
@{ Style.Require("WidgetsAdmin"); }
|
||||
|
||||
@{
|
||||
Style.Require("WidgetsAdmin");
|
||||
}
|
||||
<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()) {
|
||||
Html.ValidationSummary();
|
||||
|
||||
<div class="manage">@Html.ActionLink(T("Add a layer").ToString(), "AddLayer", new { }, new { @class = "button primaryAction" })</div>
|
||||
|
||||
<div id="widgets">
|
||||
|
||||
|
Reference in New Issue
Block a user