mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-03 12:03:51 +08:00
Fixed blog post count bug and some other random blogs cleanup around templating.
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4043663
This commit is contained in:
@@ -28,6 +28,9 @@ namespace Orchard.Blogs.Models {
|
|||||||
|
|
||||||
//public bool Enabled { get { return Record.Enabled; } }
|
//public bool Enabled { get { return Record.Enabled; } }
|
||||||
|
|
||||||
public int PostCount { get { return Record.PostCount; } }
|
public int PostCount {
|
||||||
|
get { return Record.PostCount; }
|
||||||
|
set { Record.PostCount = value; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -26,6 +26,8 @@ namespace Orchard.Blogs.Models {
|
|||||||
Filters.Add(new StorageFilter<BlogPostRecord>(repository));
|
Filters.Add(new StorageFilter<BlogPostRecord>(repository));
|
||||||
Filters.Add(new ContentItemTemplates<BlogPost>("BlogPost", "Detail", "Summary", "SummaryAdmin"));
|
Filters.Add(new ContentItemTemplates<BlogPost>("BlogPost", "Detail", "Summary", "SummaryAdmin"));
|
||||||
|
|
||||||
|
OnCreated<BlogPost>((context, bp) => bp.Blog.PostCount++);
|
||||||
|
|
||||||
OnGetItemMetadata<BlogPost>((context, bp) => {
|
OnGetItemMetadata<BlogPost>((context, bp) => {
|
||||||
context.Metadata.DisplayText = bp.Title;
|
context.Metadata.DisplayText = bp.Title;
|
||||||
context.Metadata.DisplayRouteValues =
|
context.Metadata.DisplayRouteValues =
|
||||||
|
|||||||
@@ -115,7 +115,6 @@
|
|||||||
<Content Include="Views\BlogPost\Item.aspx" />
|
<Content Include="Views\BlogPost\Item.aspx" />
|
||||||
<Content Include="Views\Blog\Create.aspx" />
|
<Content Include="Views\Blog\Create.aspx" />
|
||||||
<Content Include="Views\Blog\Edit.aspx" />
|
<Content Include="Views\Blog\Edit.aspx" />
|
||||||
<Content Include="Views\Blog\EditorTemplates\BlogPermalink.ascx" />
|
|
||||||
<Content Include="Views\Blog\Item.aspx" />
|
<Content Include="Views\Blog\Item.aspx" />
|
||||||
<Content Include="Views\Models\DisplayTemplates\BlogPostSummaryAdmin.ascx" />
|
<Content Include="Views\Models\DisplayTemplates\BlogPostSummaryAdmin.ascx" />
|
||||||
<Content Include="Views\Models\DisplayTemplates\BlogPostListAdmin.ascx" />
|
<Content Include="Views\Models\DisplayTemplates\BlogPostListAdmin.ascx" />
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Blog>" %>
|
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Blog>" %>
|
||||||
|
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
||||||
<%@ Import Namespace="Orchard.Blogs.Models" %>
|
<%@ Import Namespace="Orchard.Blogs.Models" %>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<label for="Name">Blog Name</label>
|
<label for="Name">Blog Name</label>
|
||||||
<%=Html.EditorFor(m => m.Name) %>
|
<%=Html.EditorFor(m => m.Name) %>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<%=Html.EditorFor(m => m.Slug, "BlogPermalink") %>
|
<fieldset>
|
||||||
|
<label class="sub" for="permalink">Permalink: <span><%=Request.Url.ToRootString() %>/</span></label>
|
||||||
|
<span><%=Html.TextBoxFor(m => m.Slug, new { id = "permalink", @class = "text" })%></span>
|
||||||
|
</fieldset>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<label for="Description">Description</label>
|
<label for="Description">Description</label>
|
||||||
<%=Html.TextAreaFor(m => m.Description, 5, 60, null) %>
|
<%=Html.TextAreaFor(m => m.Description, 5, 60, null) %>
|
||||||
|
|||||||
@@ -12,13 +12,7 @@
|
|||||||
<fieldset>
|
<fieldset>
|
||||||
<label class="sub" for="permalink">Permalink<br /><span><%=Request.Url.ToRootString() %>/<%=Model.Blog.Slug %>/</span></label>
|
<label class="sub" for="permalink">Permalink<br /><span><%=Request.Url.ToRootString() %>/<%=Model.Blog.Slug %>/</span></label>
|
||||||
<span><%=Html.TextBoxFor(m => m.Slug, new { id = "permalink", @class = "text" })%></span>
|
<span><%=Html.TextBoxFor(m => m.Slug, new { id = "permalink", @class = "text" })%></span>
|
||||||
</fieldset><%--
|
</fieldset>
|
||||||
<fieldset>
|
|
||||||
<%--<label for="body">Excerpt</label>
|
|
||||||
<span>[still needed]</span>-- %>
|
|
||||||
<label for="body">Body</label>
|
|
||||||
<span><%=Html.TextAreaFor(m => m.Body, new { id = "body", @class = "html" })%></span>
|
|
||||||
</fieldset>--%>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="secondary">
|
<div class="secondary">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
|||||||
Reference in New Issue
Block a user