mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-03 03:58:13 +08:00
Cleaning up Page and Blog Post templates
- Broke manage and metadata template parts into their own respective display templates for both content types - Simplified the display template for each to contain only the page title and zones (primary w/ manage and metadata partitions and the remainder) - Removed themed templates that were made redundant with this cleanup --HG-- branch : dev
This commit is contained in:
@@ -64,7 +64,10 @@ namespace Orchard.Blogs.Controllers {
|
||||
}
|
||||
|
||||
protected override DriverResult Display(BlogPost post, string displayType) {
|
||||
return ContentItemTemplate("Items/Blogs.BlogPost").LongestMatch(displayType, "Summary", "SummaryAdmin");
|
||||
return Combined(
|
||||
ContentItemTemplate("Items/Blogs.BlogPost").LongestMatch(displayType, "Summary", "SummaryAdmin"),
|
||||
ContentPartTemplate(post, "Parts/Blogs.BlogPost.Manage").Location("primary:manage"),
|
||||
ContentPartTemplate(post, "Parts/Blogs.BlogPost.Metadata").Location("primary:metadata"));
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(BlogPost post) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{63FBD4D9-E1DA-4A7B-AA6A-D6074FE50867}</ProjectGuid>
|
||||
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
@@ -155,6 +155,8 @@
|
||||
<Content Include="Views\DisplayTemplates\Items\Blogs.Blog.ascx" />
|
||||
<Content Include="Views\DisplayTemplates\Parts\Blogs.BlogPost.List.ascx" />
|
||||
<Content Include="Views\DisplayTemplates\Items\Blogs.Blog.Summary.ascx" />
|
||||
<Content Include="Views\DisplayTemplates\Parts\Blogs.BlogPost.Manage.ascx" />
|
||||
<Content Include="Views\DisplayTemplates\Parts\Blogs.BlogPost.Metadata.ascx" />
|
||||
<Content Include="Views\EditorTemplates\Parts\Blogs.BlogPost.Publish.ascx" />
|
||||
<Content Include="Views\BlogPost\Item.ascx" />
|
||||
<Content Include="Views\BlogAdmin\Create.ascx" />
|
||||
@@ -201,6 +203,9 @@
|
||||
<IISUrl>
|
||||
</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
</CustomServerUrl>
|
||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<BlogPost>>" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
|
||||
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
||||
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
||||
<h1><%=Html.TitleForPage(Model.Item.Title)%></h1>
|
||||
<div class="manage"><a href="<%=Url.BlogPostEdit(Model.Item.Blog.Slug, Model.Item.Id) %>" class="ibutton edit"><%=_Encoded("Edit") %></a></div>
|
||||
<div class="metadata">
|
||||
<% if (Model.Item.Creator != null) {
|
||||
%><div class="posted"><%=_Encoded("Posted by {0} {1}", Model.Item.Creator.UserName, Html.PublishedWhen(Model.Item)) %></div><%
|
||||
} %>
|
||||
</div>
|
||||
<% Html.Zone("primary");
|
||||
<% Html.Zone("primary", ":manage :metadata");
|
||||
Html.ZonesAny(); %>
|
||||
@@ -0,0 +1,6 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<BlogPost>" %>
|
||||
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
||||
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
||||
<div class="manage">
|
||||
<a href="<%=Url.BlogPostEdit(Model.Blog.Slug, Model.Id) %>" class="edit"><%=_Encoded("Edit") %></a>
|
||||
</div>
|
||||
@@ -0,0 +1,8 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<BlogPost>" %>
|
||||
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
||||
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
||||
<div class="metadata"><%
|
||||
if (Model.Creator != null) {
|
||||
%><div class="posted"><%=_Encoded("Posted by {0} {1}", Model.Creator.UserName, Html.PublishedWhen(Model)) %></div><%
|
||||
} %>
|
||||
</div>
|
||||
@@ -60,7 +60,10 @@ namespace Orchard.Pages.Controllers {
|
||||
}
|
||||
|
||||
protected override DriverResult Display(Page page, string displayType) {
|
||||
return ContentItemTemplate("Items/Pages.Page").LongestMatch(displayType, "Summary", "SummaryAdmin");
|
||||
return Combined(
|
||||
ContentItemTemplate("Items/Pages.Page").LongestMatch(displayType, "Summary", "SummaryAdmin"),
|
||||
ContentPartTemplate(page, "Parts/Pages.Page.Manage").Location("primary:manage"),
|
||||
ContentPartTemplate(page, "Parts/Pages.Page.Metadata").Location("primary:metadata"));
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(Page page) {
|
||||
|
||||
@@ -119,6 +119,8 @@
|
||||
<Content Include="Styles\ui.timepickr.css" />
|
||||
<Content Include="Views\DisplayTemplates\Items\Pages.Page.ascx" />
|
||||
<Content Include="Views\DisplayTemplates\Items\Pages.Page.Summary.ascx" />
|
||||
<Content Include="Views\DisplayTemplates\Parts\Pages.Page.Metadata.ascx" />
|
||||
<Content Include="Views\DisplayTemplates\Parts\Pages.Page.Manage.ascx" />
|
||||
<Content Include="Views\EditorTemplates\Items\Pages.Page.ascx" />
|
||||
<Content Include="Views\EditorTemplates\Parts\Pages.Page.Publish.ascx" />
|
||||
<Content Include="Views\Admin\Create.ascx" />
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<Orchard.Pages.Models.Page>>" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
|
||||
<div class="manage"><a href="<%=Url.Action(T("Edit").ToString(), "Admin", new {id = Model.Item.Id, area = "Orchard.Pages"}) %>" class="ibutton edit"><%=_Encoded("edit")%></a></div>
|
||||
<h1><%=Html.TitleForPage(Model.Item.Title)%></h1>
|
||||
<div class="metadata">
|
||||
<div class="posted">Published by <%=Model.Item.Creator != null ? Html.Encode(Model.Item.Creator.UserName) : _Encoded("nobody(?)").ToString()%></div>
|
||||
</div>
|
||||
<% Html.Zone("primary");
|
||||
<% Html.Zone("primary", ":manage :metadata");
|
||||
Html.ZonesAny(); %>
|
||||
@@ -0,0 +1,6 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.Pages.Models.Page>" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
|
||||
<%@ Import Namespace="Orchard.Mvc.Html" %>
|
||||
<div class="manage">
|
||||
<a href="<%=Url.Action("Edit", "Admin", new {id = Model.Id, area = "Orchard.Pages"}) %>" class="edit"><%=_Encoded("Edit")%></a>
|
||||
</div>
|
||||
@@ -0,0 +1,5 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.Pages.Models.Page>" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
|
||||
<div class="metadata">
|
||||
<div class="posted"><%=_Encoded("Published by {0}", Model.Creator != null ? Model.Creator.UserName : T("nobody(?)"))%></div>
|
||||
</div>
|
||||
@@ -1,4 +1,4 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<PageViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||
<%@ Import Namespace="Orchard.Pages.ViewModels"%>
|
||||
<%=Html.DisplayForItem(m=>m.Page) %>
|
||||
<%=Html.DisplayForItem(m=>m.Page) %>
|
||||
@@ -173,7 +173,6 @@
|
||||
<Content Include="Themes\Classic\Views\DisplayTemplates\Items\Blogs.Blog.ascx" />
|
||||
<Content Include="Themes\Classic\Views\DisplayTemplates\Items\Blogs.Blog.Summary.ascx" />
|
||||
<Content Include="Themes\Classic\Views\DisplayTemplates\Items\Blogs.BlogPost.Summary.ascx" />
|
||||
<Content Include="Themes\Classic\Views\DisplayTemplates\Items\Pages.Page.ascx" />
|
||||
<Content Include="Themes\Classic\Views\DisplayTemplates\Parts\Blogs.BlogPost.List.ascx" />
|
||||
<Content Include="Themes\Classic\Views\Footer.ascx" />
|
||||
<Content Include="Themes\Classic\Views\Layout.ascx" />
|
||||
@@ -195,7 +194,6 @@
|
||||
<Content Include="Themes\Green\Views\DisplayTemplates\Items\Blogs.Blog.ascx" />
|
||||
<Content Include="Themes\Green\Views\DisplayTemplates\Items\Blogs.Blog.Summary.ascx" />
|
||||
<Content Include="Themes\Green\Views\DisplayTemplates\Items\Blogs.BlogPost.Summary.ascx" />
|
||||
<Content Include="Themes\Green\Views\DisplayTemplates\Items\Pages.Page.ascx" />
|
||||
<Content Include="Themes\Green\Views\Footer.ascx" />
|
||||
<Content Include="Themes\Green\Views\Layout.ascx" />
|
||||
<Content Include="Themes\Green\Views\ListOfComments.ascx" />
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<Orchard.Pages.Models.Page>>" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
|
||||
<h1><%=Html.TitleForPage(Model.Item.Title)%></h1>
|
||||
<div class="manage"><a href="<%=Url.Action(T("Edit").ToString(), "Admin", new {id = Model.Item.Id, area = "Orchard.Pages"}) %>" class="ibutton edit"><%=_Encoded("Edit")%></a></div>
|
||||
<div class="metadata">
|
||||
<div class="posted">Published by <%=Model.Item.Creator != null ? Html.Encode(Model.Item.Creator.UserName) : _Encoded("nobody(?)").ToString()%></div>
|
||||
</div>
|
||||
<% Html.Zone("primary");
|
||||
Html.ZonesAny(); %>
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<Orchard.Pages.Models.Page>>" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
|
||||
<h1><%=Html.TitleForPage(Model.Item.Title)%></h1>
|
||||
<div class="manage"><a href="<%=Url.Action(T("Edit").ToString(), "Admin", new {id = Model.Item.Id, area = "Orchard.Pages"}) %>" class="ibutton edit"><%=_Encoded("Edit")%></a></div>
|
||||
<div class="metadata">
|
||||
<div class="posted">Published by <%=Model.Item.Creator != null ? Html.Encode(Model.Item.Creator.UserName) : _Encoded("nobody(?)").ToString()%></div>
|
||||
</div>
|
||||
<% Html.Zone("primary");
|
||||
Html.ZonesAny(); %>
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<object>" %>
|
||||
<div id="logindisplay">
|
||||
<% if (Request.IsAuthenticated) { %>
|
||||
<%=_Encoded("Welcome")%> <strong><%=Html.Encode(Page.User.Identity.Name) %></strong>!
|
||||
<%=Html.ActionLink(T("Log Off").ToString(), "LogOff", new { Controller = "Account", Area = "Orchard.Users" })%>
|
||||
| <%= Html.ActionLink("Admin", "List", new {Area = "Orchard.Blogs", Controller = "BlogAdmin"})%>
|
||||
<% } else { %>
|
||||
<%=Html.ActionLink(T("Log On").ToString(), "LogOn", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = Context.Request.RawUrl })%>
|
||||
<% } %>
|
||||
</div>
|
||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
|
||||
Reference in New Issue
Block a user