UI cleanup pass (progress - Orchard.Blogs)

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4045081
This commit is contained in:
skewed
2010-01-07 00:12:56 +00:00
parent a3aede0a0c
commit 5fc37ea924
24 changed files with 104 additions and 127 deletions

View File

@@ -12,18 +12,18 @@ namespace Orchard.Core.Common.Controllers {
protected override DriverResult Display(BodyAspect part, string displayType) {
var model = new BodyDisplayViewModel { BodyAspect = part };
return ContentPartTemplate(model, TemplateName, Prefix).Location("body");
return ContentPartTemplate(model, TemplateName, Prefix).Location("primary", "5");
}
protected override DriverResult Editor(BodyAspect part) {
var model = new BodyEditorViewModel { BodyAspect = part, TextEditorTemplate = DefaultTextEditorTemplate };
return ContentPartTemplate(model, TemplateName, Prefix).Location("body");
return ContentPartTemplate(model, TemplateName, Prefix).Location("primary", "5");
}
protected override DriverResult Editor(BodyAspect part, Orchard.ContentManagement.IUpdateModel updater) {
var model = new BodyEditorViewModel { BodyAspect = part, TextEditorTemplate = DefaultTextEditorTemplate };
updater.TryUpdateModel(model, Prefix, null, null);
return ContentPartTemplate(model, TemplateName, Prefix).Location("body");
return ContentPartTemplate(model, TemplateName, Prefix).Location("primary", "5");
}
}
}

View File

@@ -102,7 +102,7 @@ namespace Orchard.Core.Common.Providers {
if (instance.Owner != null)
viewModel.Owner = instance.Owner.UserName;
context.AddEditor(new TemplateViewModel(viewModel, "CommonAspect") { TemplateName = "Parts/Common.Owner", ZoneName = "primary", Position = "9" });
context.AddEditor(new TemplateViewModel(viewModel, "CommonAspect") { TemplateName = "Parts/Common.Owner", ZoneName = "primary", Position = "999" });
}
@@ -132,7 +132,7 @@ namespace Orchard.Core.Common.Providers {
instance.Owner = newOwner;
}
}
context.AddEditor(new TemplateViewModel(viewModel, "CommonAspect") { TemplateName = "Parts/Common.Owner", ZoneName = "primary", Position = "9" });
context.AddEditor(new TemplateViewModel(viewModel, "CommonAspect") { TemplateName = "Parts/Common.Owner", ZoneName = "primary", Position = "999" });
}
}
}

View File

@@ -1,5 +1,5 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ContentItemViewModel<SiteSettings>>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Core.Settings.Models"%>
<% Html.Zone("primary"); %>
<% Html.ZonesAny(); %>
<% Html.Zone("primary");
Html.ZonesAny(); %>

View File

@@ -1,8 +1,8 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CreateBlogViewModel>" %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<CreateBlogViewModel>" %>
<%@ Import Namespace="Orchard.Blogs.ViewModels"%>
<h2><%=Html.TitleForPage("Add Blog") %></h2>
<h1><%=Html.TitleForPage(T("Add Blog").ToString()) %></h1>
<% using (Html.BeginFormAntiForgeryPost()) { %>
<%=Html.ValidationSummary() %>
<%=Html.EditorForItem(vm => vm.Blog) %>
<fieldset><input class="button" type="submit" value="Create" /></fieldset><%
<fieldset><input class="button" type="submit" value="<%=_Encoded("Create") %>" /></fieldset><%
} %>

View File

@@ -1,8 +1,8 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BlogEditViewModel>" %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<BlogEditViewModel>" %>
<%@ Import Namespace="Orchard.Blogs.ViewModels"%>
<h2><%=Html.TitleForPage("Edit Blog") %></h2>
<h1><%=Html.TitleForPage(T("Edit Blog").ToString()) %></h1>
<% using (Html.BeginFormAntiForgeryPost()) { %>
<%=Html.ValidationSummary() %>
<%=Html.EditorForItem(m => m.Blog) %>
<fieldset><input class="button" type="submit" value="Save" /></fieldset><%
<fieldset><input class="button" type="submit" value="<%=_Encoded("Save") %>" /></fieldset><%
} %>

View File

@@ -1,10 +1,10 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BlogsViewModel>" %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<BlogsViewModel>" %>
<%@ Import Namespace="Orchard.Blogs.ViewModels"%>
<h1><%=Html.TitleForPage("Blogs")%></h1>
<p>All of the blogs.</p><%
<h1><%=Html.TitleForPage(T("Blogs").ToString())%></h1>
<p><%=_Encoded("All of the blogs.")%></p><%
if (Model.Blogs.Count() > 0) { %>
<%=Html.UnorderedList(Model.Blogs, (b, i) => Html.DisplayForItem(b).ToHtmlString(), "blogs contentItems") %><%
}
else { %>
<p>No blogs found.</p><%
<p><%=_Encoded("No blogs found.") %></p><%
} %>

View File

@@ -1,4 +1,4 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BlogForAdminViewModel>" %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<BlogForAdminViewModel>" %>
<%@ Import Namespace="Orchard.Blogs.ViewModels"%>
<% Html.AddTitleParts("Manage Blog"); %>
<% Html.AddTitleParts(T("Manage Blog").ToString()); %>
<%=Html.DisplayForItem(m => m.Blog) %>

View File

@@ -1,12 +1,14 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<AdminBlogsViewModel>" %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<AdminBlogsViewModel>" %>
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.ViewModels"%>
<h2><%=Html.TitleForPage("Manage Blogs") %></h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p><%
<h1><%=Html.TitleForPage(T("Manage Blogs").ToString()) %></h1>
<p><%=_Encoded("Possible text about setting up and managing a blog goes here.") %></p><%
if (Model.Blogs.Count() > 0) { %>
<div class="actions"><a class="add button" href="<%=Url.BlogCreate() %>">New Blog</a></div>
<div class="actions"><a class="add button" href="<%=Url.BlogCreate() %>"><%=_Encoded("New Blog") %></a></div>
<%=Html.UnorderedList(Model.Blogs, (b, i) => Html.DisplayForItem(b).ToHtmlString(), "blogs contentItems") %>
<div class="actions"><a class="add button" href="<%=Url.BlogCreate() %>">New Blog</a></div><%
<div class="actions"><a class="add button" href="<%=Url.BlogCreate() %>"><%=_Encoded("New Blog") %></a></div><%
} else { %>
<div class="info message">There are no blogs for you to see. Want to <a href="<%=Url.BlogCreate() %>">add one</a>?</div><%
<%-- todo: (heskew) come back to this --%>
<div class="info message"><%--<%=string.Format(_Encoded("There are no blogs for you to see. Want to {0}?").ToString(), Html.Link(_Encoded("add one").ToString(), Url.BlogCreate())) %>--%>
<%=string.Format("There are no blogs for you to see. Want to {0}?", Html.Link(_Encoded("add one").ToString(), Url.BlogCreate())) %></div><%
} %>

View File

@@ -1,6 +1,6 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CreateBlogPostViewModel>" %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<CreateBlogPostViewModel>" %>
<%@ Import Namespace="Orchard.Blogs.ViewModels"%>
<h2><%=Html.TitleForPage("Add Post") %></h2>
<h1><%=Html.TitleForPage(T("Add Post").ToString()) %></h1>
<% using (Html.BeginFormAntiForgeryPost()) { %>
<%=Html.ValidationSummary() %>
<%=Html.EditorForItem(m => m.BlogPost) %><%

View File

@@ -1,6 +1,6 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BlogPostEditViewModel>" %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<BlogPostEditViewModel>" %>
<%@ Import Namespace="Orchard.Blogs.ViewModels"%>
<h2><%=Html.TitleForPage("Edit Post") %></h2>
<h1><%=Html.TitleForPage(T("Edit Post").ToString()) %></h1>
<% using (Html.BeginFormAntiForgeryPost()) { %>
<%=Html.ValidationSummary() %>
<%=Html.EditorForItem(m => m.BlogPost) %><%

View File

@@ -1,21 +1,13 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ContentItemViewModel<Blog>>" %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<Blog>>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<%-- todo: (heskew) get what actions we can out of the h2 :| --%>
<h2 class="withActions">
<h1 class="withActions">
<a href="<%=Url.BlogForAdmin(Model.Item.Slug) %>"><%=Html.TitleForPage(Model.Item.Name) %></a>
<a href="<%=Url.BlogEdit(Model.Item.Slug) %>" class="ibutton edit" title="Edit Blog">Edit Blog</a>
<span class="actions"><span class="destruct"><a href="<%=Url.BlogDelete(Model.Item.Slug) %>" class="ibutton remove" title="Remove Blog">Remove Blog</a></span></span></h2>
<p><%=Model.Item.Description%></p>
<div class="actions"><a href="<%=Url.BlogPostCreate(Model.Item.Slug) %>" class="add button">New Post</a></div>
<%--TODO: (erikpo) Need to figure out which zones should be displayed in this template--%>
<% Html.ZonesAny(); %>
<%--<%
if (Model.Posts.Count() > 0) { %>
<%=Html.UnorderedList(Model.Posts, (p, i) => Html.DisplayFor(blog => p, "BlogPostPreviewForAdmin").ToHtmlString(), "contentItems")%>
<div class="actions"><a href="<%=Url.BlogPostCreate(Model.Blog.Slug) %>" class="add button">New Post</a></div><%
} else { %>
<div class="info message">This blog is sad with no posts, but don't fret. You can add a new post right <a href="<%=Url.BlogPostCreate(Model.Blog.Slug) %>">here</a>!</div><%
} %>--%>
<a href="<%=Url.BlogEdit(Model.Item.Slug) %>" class="ibutton edit"><%=_Encoded("Edit Blog") %></a>
<span class="actions"><span class="destruct"><a href="<%=Url.BlogDelete(Model.Item.Slug) %>" class="ibutton remove"><%=_Encoded("Remove Blog") %></a></span></span></h1>
<p><%=Html.Encode(Model.Item.Description) %></p>
<div class="actions"><a href="<%=Url.BlogPostCreate(Model.Item.Slug) %>" class="add button"><%=_Encoded("New Post")%></a></div>
<% Html.Zone("primary");
Html.ZonesAny(); %>

View File

@@ -1,9 +1,7 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ContentItemViewModel<Blog>>" %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<Blog>>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<h3><%=Html.Link(Html.Encode(Model.Item.Name), Url.Blog(Model.Item.Slug)) %></h3>
<div class="blog metadata"><a href="<%=Url.Blog(Model.Item.Slug) %>"><%=Model.Item.PostCount %> post<%=Model.Item.PostCount == 1 ? "" : "s" %></a></div>
<p><%=Model.Item.Description %></p>
<%--TODO: (erikpo) Need to figure out which zones should be displayed in this template--%>
<%--<%=Html.DisplayZonesAny() %>--%>
<h2><%=Html.Link(Html.Encode(Model.Item.Name), Url.Blog(Model.Item.Slug)) %></h2>
<div class="blog metadata"><a href="<%=Url.Blog(Model.Item.Slug) %>"><%=_Encoded("{0} post{0}", Model.Item.PostCount, Model.Item.PostCount == 1 ? "" : "s")%></a></div>
<p><%=Html.Encode(Model.Item.Description) %></p>

View File

@@ -1,21 +1,21 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ContentItemViewModel<Blog>>" %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<Blog>>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<h3><a href="<%=Url.BlogForAdmin(Model.Item.Slug) %>"><%=Html.Encode(Model.Item.Name) %></a></h3>
<h2><%=Html.Link(Html.Encode(Model.Item.Name), Url.BlogForAdmin(Model.Item.Slug)) %></h2>
<div class="meta">
<% var postCount = Model.Item.PostCount; %><a href="<%=Url.BlogForAdmin(Model.Item.Slug) %>"><%=string.Format("{0} post{1}", postCount, postCount == 1 ? "" : "s") %></a>
| <a href="#">?? comments</a>
<%=Html.Link(_Encoded("{0} post{1}", Model.Item.PostCount, Model.Item.PostCount == 1 ? "" : "s").ToString(), Url.BlogForAdmin(Model.Item.Slug))%>
| <%=Html.Link(_Encoded("?? comments").ToString(), "") %></a>
</div>
<%--<p>[list of authors] [modify blog access]</p>--%>
<p><%=Model.Item.Description %></p>
<p><%=Html.Encode(Model.Item.Description) %></p>
<p class="actions">
<%-- todo: (heskew) make into a ul --%>
<span class="construct">
<a href="<%=Url.BlogForAdmin(Model.Item.Slug) %>" class="ibutton blog" title="Manage Blog">Manage Blog</a>
<a href="<%=Url.BlogEdit(Model.Item.Slug) %>" class="ibutton edit" title="Edit Blog">Edit Blog</a>
<a href="<%=Url.Blog(Model.Item.Slug) %>" class="ibutton view" title="View Blog">View Blog</a>
<a href="<%=Url.BlogPostCreate(Model.Item.Slug) %>" class="ibutton add page" title="New Post">New Post</a>
<a href="<%=Url.BlogForAdmin(Model.Item.Slug) %>" class="ibutton blog"><%=_Encoded("Manage Blog") %></a>
<a href="<%=Url.BlogEdit(Model.Item.Slug) %>" class="ibutton edit"><%=_Encoded("Edit Blog")%></a>
<a href="<%=Url.Blog(Model.Item.Slug) %>" class="ibutton view"><%=_Encoded("View Blog")%></a>
<a href="<%=Url.BlogPostCreate(Model.Item.Slug) %>" class="ibutton add page"><%=_Encoded("New Post")%></a>
</span>
<span class="destruct"><a href="<%=Url.BlogDelete(Model.Item.Slug) %>" class="ibutton remove" title="Delete Blog">Remove Blog</a></span>
<span class="destruct"><a href="<%=Url.BlogDelete(Model.Item.Slug) %>" class="ibutton remove"><%=_Encoded("Remove Blog")%></a></span>
</p>

View File

@@ -1,9 +1,10 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ContentItemViewModel<Blog>>" %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<Blog>>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<div class="manage"><a href="<%=Url.BlogEdit(Model.Item.Slug) %>" class="ibutton edit">edit</a></div>
<%-- todo: (heskew) selectively display to those who have access --%>
<div class="manage"><a href="<%=Url.BlogEdit(Model.Item.Slug) %>" class="ibutton edit"><%=_Encoded("edit") %></a></div>
<h1><%=Html.TitleForPage(Model.Item.Name) %></h1>
<div><%=Html.Encode(Model.Item.Description) %></div>
<%--TODO: (erikpo) Need to figure out which zones should be displayed in this template--%>
<% Html.ZonesAny(); %>
<p><%=Html.Encode(Model.Item.Description) %></p>
<% Html.Zone("primary");
Html.ZonesAny(); %>

View File

@@ -1,12 +1,9 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ContentItemViewModel<BlogPost>>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<BlogPost>>" %>
<%@ Import Namespace="Orchard.ContentManagement"%>
<%@ Import Namespace="Orchard.Core.Common.Models"%>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<h3><a href="<%=Url.BlogPost(Model.Item.Blog.Slug, Model.Item.Slug) %>"><%=Html.Encode(Model.Item.Title) %></a></h3>
<div class="meta">
<%=Html.PublishedState(Model.Item) %>
| <a href="#">?? comments</a>
</div>
<div class="content"><%=Model.Item.As<BodyAspect>().Text ?? "<p><em>there's no content for this blog post</em></p>" %></div>
<h2><%=Html.Link(Html.Encode(Model.Item.Title), Url.BlogPost(Model.Item.Blog.Slug, Model.Item.Slug)) %></h2>
<div class="meta"><%=Html.PublishedState(Model.Item) %> | <%=Html.Link(_Encoded("?? comments").ToString(), "") %></div>
<div class="content"><%=Model.Item.As<BodyAspect>().Text ?? string.Format("<p><em>{0}</em></p>", _Encoded("there's no content for this blog post"))%></div>

View File

@@ -1,23 +1,20 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ContentItemViewModel<BlogPost>>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<BlogPost>>" %>
<%@ Import Namespace="Orchard.ContentManagement"%>
<%@ Import Namespace="Orchard.Core.Common.Models"%>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<h3><a href="<%=Url.BlogPostEdit(Model.Item.Blog.Slug, Model.Item.Slug) %>"><%=Html.Encode(Model.Item.Title)%></a></h3>
<div class="meta">
<%=Html.PublishedState(Model.Item) %>
| <a href="#">?? comments</a>
</div>
<div class="content"><%=Model.Item.As<BodyAspect>().Text ?? "<p><em>there's no content for this blog post</em></p>"%></div>
<h2><%=Html.Link(Html.Encode(Model.Item.Title), Url.BlogPostEdit(Model.Item.Blog.Slug, Model.Item.Slug)) %></h2>
<div class="meta"><%=Html.PublishedState(Model.Item) %> | <%=Html.Link(_Encoded("?? comments").ToString(), "") %></div>
<div class="content"><%=Model.Item.As<BodyAspect>().Text ?? string.Format("<p><em>{0}</em></p>", _Encoded("there's no content for this blog post"))%></div>
<p class="actions">
<%-- todo: (heskew) make into a ul --%>
<span class="construct">
<a href="<%=Url.BlogPostEdit(Model.Item.Blog.Slug, Model.Item.Slug) %>" class="ibutton edit" title="Edit Post">Edit Post</a>
<a href="<%=Url.BlogPost(Model.Item.Blog.Slug, Model.Item.Slug) %>" class="ibutton view" title="View Post">View Post</a><%
<a href="<%=Url.BlogPostEdit(Model.Item.Blog.Slug, Model.Item.Slug) %>" class="ibutton edit"><%=_Encoded("Edit Post")%></a>
<a href="<%=Url.BlogPost(Model.Item.Blog.Slug, Model.Item.Slug) %>" class="ibutton view"><%=_Encoded("View Post")%></a><%
if (Model.Item.Published == null) { // todo: (heskew) be smart about this and maybe have other contextual actions - including view/preview for view up there ^^ %>
<a href="<%=Url.BlogPost(Model.Item.Blog.Slug, Model.Item.Slug) %>" class="ibutton publish" title="Publish Post Now">Publish Post Now</a>
<a href="<%=Url.BlogPost(Model.Item.Blog.Slug, Model.Item.Slug) %>" class="ibutton publish"><%=_Encoded("Publish Post Now")%></a>
<% } %>
</span>
<span class="destruct"><a href="#" class="ibutton remove" title="Remove Post">Remove Post</a></span>
<span class="destruct"><a href="#" class="ibutton remove"><%=_Encoded("Remove Post")%></a></span>
</p>

View File

@@ -1,14 +1,13 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ContentItemViewModel<BlogPost>>" %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<BlogPost>>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<div class="manage"><a href="<%=Url.BlogPostEdit(Model.Item.Blog.Slug, Model.Item.Slug) %>" class="ibutton edit">edit</a></div>
<div class="manage"><a href="<%=Url.BlogPostEdit(Model.Item.Blog.Slug, Model.Item.Slug) %>" class="ibutton edit"><%=_Encoded("edit") %></a></div>
<h1><%=Html.TitleForPage(Model.Item.Title)%></h1>
<div class="metadata">
<% if (Model.Item.Creator != null)
{
%><div class="posted">Posted by <%=Html.Encode(Model.Item.Creator.UserName)%> <%=Html.PublishedWhen(Model.Item)%></div><%
<% 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.ZonesAny(); %>
<% Html.Zone("primary");
Html.ZonesAny(); %>

View File

@@ -1,4 +1,5 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<ContentItemViewModel<BlogPost>>>" %>
<%@ 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).ToHtmlString(), "blogPosts contentItems") %>
<% if (Model.Count() < 1) { %><p><%=_Encoded("There are no posts for this blog.") %></p><% } %>

View File

@@ -1,16 +1,16 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ContentItemViewModel<BlogPost>>" %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<BlogPost>>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<% Html.AddTitleParts(Model.Item.Title); %>
<div class="sections">
<div class="primary">
<% Html.Zone("primary"); %>
<% Html.ZonesExcept("secondary"); %>
<div class="primary"><%
Html.Zone("primary");
Html.ZonesExcept("secondary"); %>
</div>
<div class="secondary">
<% Html.Zone("secondary");%>
<fieldset>
<input class="button" type="submit" name="submit.Save" value="Save"/>
<input class="button" type="submit" name="submit.Save" value="<%=_Encoded("Save") %>"/>
</fieldset>
</div>
</div>

View File

@@ -1,15 +1,15 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Blog>" %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Blog>" %>
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<fieldset>
<label for="Name">Blog Name</label>
<%=Html.LabelFor(m => m.Name) %>
<%=Html.EditorFor(m => m.Name) %>
</fieldset>
<fieldset class="permalink">
<label class="sub" for="Slug">Permalink: <span><%=Request.Url.ToRootString() %>/</span></label>
<label class="sub" for="Slug"><%=_Encoded("Permalink")%><br /><span><%=Html.Encode(Request.Url.ToRootString()) %>/</span></label>
<span><%=Html.TextBoxFor(m => m.Slug, new { @class = "text" })%></span>
</fieldset>
<fieldset>
<label for="Description">Description</label>
<%=Html.LabelFor(m => m.Description) %>
<%=Html.TextAreaFor(m => m.Description, 5, 60, null) %>
</fieldset>

View File

@@ -1,12 +1,11 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BlogPost>" %>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<BlogPost>" %>
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.ViewModels"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<fieldset>
<label for="Title">Title</label>
<span><%=Html.TextBoxFor(m => m.Title, new { @class = "large text" })%></span>
<%=Html.LabelFor(m => m.Title) %>
<%=Html.TextBoxFor(m => m.Title, new { @class = "large text" })%>
</fieldset>
<fieldset class="permalink">
<label class="sub" for="Slug">Permalink<br /><span><%=Request.Url.ToRootString() %>/<%=Model.Blog.Slug %>/</span></label>
<label class="sub" for="Slug"><%=_Encoded("Permalink")%><br /><span><%=Html.Encode(Request.Url.ToRootString()) %>/<%=Html.Encode(Model.Blog.Slug) %>/</span></label>
<span><%=Html.TextBoxFor(m => m.Slug, new { @class = "text" })%></span>
</fieldset>

View File

@@ -1,15 +1,6 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BlogPost>" %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<BlogPost>" %>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.ViewModels"%>
<fieldset>
<legend>Publish Settings</legend>
<label for="Command_SaveDraft"><%=Html.RadioButton("Command", "SaveDraft", true, new { id = "Command_SaveDraft" }) %> Save Draft</label><br />
<legend><%=_Encoded("Publish Settings")%></legend>
<label for="Command_SaveDraft"><%=Html.RadioButton("Command", "SaveDraft", true, new { id = "Command_SaveDraft" }) %> <%=_Encoded("Save Draft")%></label>
</fieldset>
<%--<fieldset>
<label for="Command_PublishNow"><%=Html.RadioButton("Command", "PublishNow", new { id = "Command_PublishNow" }) %> Publish Now</label>
</fieldset>
<fieldset>
<label for="Command_PublishLater"><%=Html.RadioButton("Command", "PublishLater", new { id = "Command_PublishLater" }) %> Publish Later</label>
<%=Html.EditorFor(m => m.Published) %>
</fieldset>--%>

View File

@@ -45,7 +45,7 @@ namespace Orchard.Mvc {
public MvcHtmlString _Encoded(string textHint) {
return MvcHtmlString.Create(Html.Encode(T(textHint)));
}
public MvcHtmlString _Encoded(string textHint, params string[] formatTokens) {
public MvcHtmlString _Encoded(string textHint, params object[] formatTokens) {
return MvcHtmlString.Create(Html.Encode(T(textHint, formatTokens)));
}
}