Fixed the display of blog posts on a blog in all of the themes

- added a default blog list template and remove all of the theme-specific part templates (which were all the same)

--HG--
branch : dev
This commit is contained in:
Nathan Heskew 2010-07-19 11:13:23 -07:00
parent eb14188ccc
commit 9301e9eb0a
9 changed files with 33 additions and 55 deletions

View File

@ -89,7 +89,7 @@ namespace Orchard.Blogs.Drivers {
}).ToList()
},
"Parts/Blogs.BlogPost.List",
"").Location("primary"));
"").LongestMatch(displayType, "DetailAdmin").Location("primary"));
}
protected override DriverResult Editor(Blog blog) {

View File

@ -134,6 +134,7 @@
<Content Include="Views\DisplayTemplates\Items\Blogs.Blog.ascx" />
<Content Include="Views\DisplayTemplates\Parts\Blogs.Blog.Manage.ascx" />
<Content Include="Views\DisplayTemplates\Parts\Blogs.BlogPost.List.ascx" />
<Content Include="Views\DisplayTemplates\Parts\Blogs.BlogPost.List.DetailAdmin.ascx" />
<Content Include="Views\DisplayTemplates\Items\Blogs.Blog.Summary.ascx" />
<Content Include="Views\DisplayTemplates\Parts\Blogs.Blog.Description.ascx" />
<Content Include="Views\DisplayTemplates\Parts\Blogs.Blog.Metadata.ascx" />

View File

@ -0,0 +1,28 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ListContentsViewModel>" %>
<%@ Import Namespace="Orchard.Core.Contents.ViewModels" %>
<%@ Import Namespace="Orchard.Utility.Extensions" %>
<%
if (Model.Entries.Count() < 1) { %>
<div class="info message"><%:T("There are no posts for this blog.") %></div><%
}
else {
using (Html.BeginFormAntiForgeryPost(Url.Action("List", "Admin", new { area = "Contents", id = "" }))) { %>
<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>
<%:Html.Hidden("returnUrl", ViewContext.RequestContext.HttpContext.Request.ToUrlString()) %>
<button type="submit" name="submit.BulkEdit" value="yes"><%:T("Apply") %></button>
</fieldset>
<fieldset class="contentItems bulk-items">
<%:Html.UnorderedList(
Model.Entries,
(entry, i) => Html.DisplayForItem(entry.ViewModel),
"") %>
</fieldset><%
}
} %>

View File

@ -1,28 +1,3 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ListContentsViewModel>" %>
<%@ Import Namespace="Orchard.Core.Contents.ViewModels" %>
<%@ Import Namespace="Orchard.Utility.Extensions" %>
<%
if (Model.Entries.Count() < 1) { %>
<div class="info message"><%:T("There are no posts for this blog.") %></div><%
}
else {
using (Html.BeginFormAntiForgeryPost(Url.Action("List", "Admin", new { area = "Contents", id = "" }))) { %>
<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>
<%:Html.Hidden("returnUrl", ViewContext.RequestContext.HttpContext.Request.ToUrlString()) %>
<button type="submit" name="submit.BulkEdit" value="yes"><%:T("Apply") %></button>
</fieldset>
<fieldset class="contentItems bulk-items">
<%:Html.UnorderedList(
Model.Entries,
(entry, i) => Html.DisplayForItem(entry.ViewModel),
"") %>
</fieldset><%
}
} %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.Core.Contents.ViewModels.ListContentsViewModel>" %>
<%: Html.UnorderedList(Model.Entries, (bp, i) => Html.DisplayForItem(bp.ViewModel), "blogPosts contentItems") %>
<% if (Model.Entries.Count() < 1) { %><p><%: T("There are no posts for this blog.") %></p><% } %>

View File

@ -139,7 +139,6 @@
<Content Include="Themes\ClassicDark\Views\DisplayTemplates\Items\Blogs.Blog.Summary.ascx" />
<Content Include="Themes\ClassicDark\Views\DisplayTemplates\Items\Blogs.BlogPost.ascx" />
<Content Include="Themes\ClassicDark\Views\DisplayTemplates\Items\Blogs.BlogPost.Summary.ascx" />
<Content Include="Themes\ClassicDark\Views\DisplayTemplates\Parts\Blogs.BlogPost.List.ascx" />
<Content Include="Themes\ClassicDark\Views\DisplayTemplates\Parts\Blogs.BlogPost.Metadata.ascx" />
<Content Include="Themes\ClassicDark\Views\DisplayTemplates\Parts\Pages.Page.Metadata.ascx" />
<Content Include="Themes\ClassicDark\Views\Footer.ascx" />
@ -157,7 +156,6 @@
<Content Include="Themes\Classic\Views\DisplayTemplates\Items\Blogs.Blog.Summary.ascx" />
<Content Include="Themes\Classic\Views\DisplayTemplates\Items\Blogs.BlogPost.ascx" />
<Content Include="Themes\Classic\Views\DisplayTemplates\Items\Blogs.BlogPost.Summary.ascx" />
<Content Include="Themes\Classic\Views\DisplayTemplates\Parts\Blogs.BlogPost.List.ascx" />
<Content Include="Themes\Classic\Views\DisplayTemplates\Parts\Pages.Page.Metadata.ascx" />
<Content Include="Themes\Classic\Views\Footer.ascx" />
<Content Include="Themes\Classic\Views\Layout.ascx" />
@ -192,7 +190,6 @@
<Content Include="Themes\Contoso\Views\DisplayTemplates\Items\Blogs.BlogPost.ascx" />
<Content Include="Themes\Contoso\Views\DisplayTemplates\Items\Pages.Page.ascx" />
<Content Include="Themes\Contoso\Views\DisplayTemplates\Items\Blogs.BlogPost.ListByArchive.ascx" />
<Content Include="Themes\Contoso\Views\DisplayTemplates\Parts\Blogs.BlogPost.List.ascx" />
<Content Include="Themes\Contoso\Views\DisplayTemplates\Parts\Comments.HasComments.ascx" />
<Content Include="Themes\Contoso\Views\DisplayTemplates\Parts\Pages.Page.Metadata.ascx" />
<Content Include="Themes\Contoso\Views\DisplayTemplates\Parts\Tags.ShowTags.ascx" />
@ -237,7 +234,6 @@
<Content Include="Themes\Corporate\Views\DisplayTemplates\Items\Blogs.BlogPost.ascx" />
<Content Include="Themes\Corporate\Views\DisplayTemplates\Items\Blogs.BlogPost.ListByArchive.ascx" />
<Content Include="Themes\Corporate\Views\DisplayTemplates\Items\Pages.Page.ascx" />
<Content Include="Themes\Corporate\Views\DisplayTemplates\Parts\Blogs.BlogPost.List.ascx" />
<Content Include="Themes\Corporate\Views\DisplayTemplates\Parts\Comments.HasComments.ascx" />
<Content Include="Themes\Corporate\Views\DisplayTemplates\Parts\Pages.Page.Metadata.ascx" />
<Content Include="Themes\Corporate\Views\DisplayTemplates\Parts\Tags.ShowTags.ascx" />

View File

@ -1,5 +0,0 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<IEnumerable<ContentItemViewModel<BlogPost>>>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<%: Html.UnorderedList(Model, (bp, i) => Html.DisplayForItem(bp), "blogPosts contentItems") %>
<% if (Model.Count() < 1) { %><p><%: T("There are no posts for this blog.") %></p><% } %>

View File

@ -1,5 +0,0 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<IEnumerable<ContentItemViewModel<BlogPost>>>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<%: Html.UnorderedList(Model, (bp, i) => Html.DisplayForItem(bp), "blogPosts contentItems") %>
<% if (Model.Count() < 1) { %><p><%: T("There are no posts for this blog.") %></p><% } %>

View File

@ -1,6 +0,0 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<IEnumerable<ContentItemViewModel<BlogPost>>>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<%: Html.UnorderedList(Model, (bp, i) => Html.DisplayForItem(bp), "blogPosts contentItems") %>
<% if (Model.Count() < 1) { %><p><%: T("There are no posts for this blog.") %></p><% } %>

View File

@ -1,6 +0,0 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<IEnumerable<ContentItemViewModel<BlogPost>>>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<%: Html.UnorderedList(Model, (bp, i) => Html.DisplayForItem(bp), "blogPosts contentItems") %>
<% if (Model.Count() < 1) { %><p><%: T("There are no posts for this blog.") %></p><% } %>