Some work on the Blogs admin including a rework of the create blog post (page)

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4042268
This commit is contained in:
skewed
2009-11-26 00:38:40 +00:00
parent bc814e566f
commit 9bf113b224
12 changed files with 173 additions and 120 deletions

View File

@@ -96,9 +96,11 @@
<ItemGroup>
<Content Include="Package.txt" />
<Content Include="Views\BlogPost\Create.aspx" />
<Content Include="Views\BlogPost\EditorTemplates\CreateBlogPostViewModel.ascx" />
<Content Include="Views\BlogPost\Item.aspx" />
<Content Include="Views\Blog\Create.aspx" />
<Content Include="Views\BlogPost\ListByBlog.aspx" />
<Content Include="Views\Blog\DisplayTemplates\Blog.ascx" />
<Content Include="Views\Blog\Edit.aspx" />
<Content Include="Views\Blog\EditorTemplates\BlogEditViewModel.ascx" />
<Content Include="Views\Blog\EditorTemplates\BlogPermalink.ascx" />

View File

@@ -4,9 +4,10 @@
<%@ Import Namespace="Orchard.Mvc.Html" %>
<% Html.Include("Head"); %>
<h2>Create New Blog</h2>
<p><a href="<%=Url.Blogs() %>">Manage Blogs</a> > Create Blog</p>
<p><a href="<%=Url.Blogs() %>">Manage Blogs</a> &gt; Create Blog</p>
<% using (Html.BeginForm()) { %>
<%=Html.ValidationSummary() %>
<%=Html.EditorForModel() %>
<fieldset><input class="button" type="submit" value="Create" /></fieldset>
<% } %>
<% Html.Include("Foot"); %>

View File

@@ -0,0 +1,6 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Blog>" %>
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<h3><a href="<%=Url.BlogEdit(Model.Slug) %>"><%=Html.Encode(Model.Name) %></a> <span>(<a href="<%=Url.Blog(Model.Slug) %>">view</a>)</span> <span>(<a href="<%=Url.BlogPostCreate(Model.Slug) %>">post</a>)</span></h3>
<p>[list of authors] [modify blog access]</p>
<p><%=Model.Description %></p>

View File

@@ -1,17 +1,10 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BlogsViewModel>" %>
<%@ Import Namespace="Orchard.Mvc.Html"%>
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<%@ Import Namespace="Orchard.Blogs.ViewModels"
%><div class="actions"><a class="add button" href="<%=Url.BlogCreate() %>">Create a New Blog</a></div><%
if (Model.Blogs.Count() > 0) { %>
<ul><%
foreach (Blog blog in Model.Blogs) { %>
<li>
<h3><a href="<%=Url.BlogEdit(blog.Slug) %>"><%=Html.Encode(blog.Name) %></a> <span>(<a href="<%=Url.Blog(blog.Slug) %>">view</a>)</span> <span>(<a href="<%=Url.BlogPostCreate(blog.Slug) %>">post</a>)</span></h3>
<p>[list of authors] [modify blog access]</p>
<p><%=blog.Description %></p>
</li><%
} %>
</ul>
<%=Html.UnorderedList(Model.Blogs, (b, i) => Html.DisplayFor(blog => b).ToHtmlString(), "blogs") %>
<div class="actions"><a class="add button" href="<%=Url.BlogCreate() %>">Create a New Blog</a></div><%
} %>

View File

@@ -4,9 +4,10 @@
<%@ Import Namespace="Orchard.Blogs.ViewModels"%>
<% Html.Include("Head"); %>
<h2>Edit Blog</h2>
<p><a href="<%=Url.Blogs() %>">Manage Blogs</a> > Editing <strong><%=Html.Encode(Model.Name)%></strong></p>
<p><a href="<%=Url.Blogs() %>">Manage Blogs</a> &gt; Editing <strong><%=Html.Encode(Model.Name)%></strong></p>
<% using (Html.BeginForm()) { %>
<%=Html.ValidationSummary() %>
<%=Html.EditorForModel() %>
<fieldset><input class="button" type="submit" value="Save" /></fieldset>
<% } %>
<% Html.Include("Foot"); %>

View File

@@ -1,14 +1,11 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BlogEditViewModel>" %>
<%@ Import Namespace="Orchard.Blogs.ViewModels"%>
<fieldset>
<label for="">Blog Name</label>
<label for="">Blog Name:</label>
<%=Html.EditorFor(m => m.Name) %>
<fieldset>
</fieldset>
<%=Html.EditorFor(m => m.Slug, "BlogPermalink") %>
</fieldset>
<label for="">Description</label>
<%=Html.TextAreaFor(m => m.Description, 5, 60, null)%>
<fieldset>
</fieldset>
<input class="button" type="submit" value="Save" />
<label for="">Description:</label>
<%=Html.TextAreaFor(m => m.Description, 5, 60, null) %>
</fieldset>

View File

@@ -1,14 +1,11 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CreateBlogViewModel>" %>
<%@ Import Namespace="Orchard.Blogs.ViewModels"%>
<fieldset>
<label for="">Blog Name</label>
<label for="">Blog Name:</label>
<%=Html.EditorFor(m => m.Name) %>
<fieldset>
</fieldset>
<%=Html.EditorFor(m => m.Slug, "BlogPermalink") %>
</fieldset>
<label for="">Description</label>
<%=Html.TextAreaFor(m => m.Description, 5, 60, null) %>
<fieldset>
</fieldset>
<input class="button" type="submit" value="Create" />
<label for="">Description:</label>
<%=Html.TextAreaFor(m => m.Description, 5, 60, null) %>
</fieldset>

View File

@@ -4,23 +4,11 @@
<%@ Import Namespace="Orchard.Security" %>
<%@ Import Namespace="Orchard.Mvc.Html" %>
<% Html.Include("Head"); %>
<div class="yui-u">
<h2 class="separator">
Create a New Blog Post</h2>
<p class="bottomSpacer">
<a href="<%=Url.Blogs() %>">Manage Blogs</a> > <a href="<%=Url.BlogEdit(Model.Blog.Slug) %>"><%=Html.Encode(Model.Blog.Name) %></a> > Create Blog Post
</p>
</div>
<div class="yui-u">
<%using (Html.BeginForm()) { %>
<ol>
<%= Html.ValidationSummary() %>
<%= Html.EditorForModel() %>
<li class="clearLayout">
<input class="button" type="submit" value="Create" />
<a href="<%=Url.Blogs() %>" class="button">Cancel</a>
</li>
</ol>
<%}/*EndForm*/%>
</div>
<h2>Create a New Blog Post</h2>
<p><a href="<%=Url.Blogs() %>">Manage Blogs</a> &gt; <a href="<%=Url.BlogEdit(Model.Blog.Slug) %>"><%=Html.Encode(Model.Blog.Name) %></a> &gt; Create Blog Post</p>
<%using (Html.BeginForm()) { %>
<%= Html.ValidationSummary() %>
<%= Html.EditorForModel() %>
<fieldset><input class="button" type="submit" value="Create" /></fieldset>
<% } %>
<% Html.Include("Foot"); %>

View File

@@ -0,0 +1,36 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CreateBlogPostViewModel>" %>
<%@ Import Namespace="Orchard.Blogs.ViewModels"%>
<div class="sections">
<div class="primary">
<h3>Blog Post Content</h3>
<%-- todo: (heskew) thin out the fieldsets if they become overkill --%>
<fieldset>
<label for="title">Title:</label>
<span><%=Html.TextBoxFor(m => m.Title, new { id = "title", @class = "text" })%></span>
</fieldset>
<fieldset>
<label class="sub" for="permalink">Permalink: <span>http://localhost/<%=Model.Blog.Slug %>/</span></label>
<span><%=Html.TextBoxFor(m => m.Slug, new { id = "permalink", @class = "text" })%> <span> &laquo; How to write a permalink. &raquo; </span></span>
</fieldset>
<fieldset>
<label for="body">Body:</label>
<span><%=Html.TextAreaFor(m => m.Body, new { id = "body", @class = "html" })%></span>
</fieldset>
</div>
<div class="secondary">
<h3>Publish Settings</h3>
<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>
<fieldset>
<label for="Command_SaveDraft"><%=Html.RadioButton("Command", "SaveDraft", new { id = "Command_SaveDraft" }) %> Save Draft</label></li>
</fieldset>
<fieldset>
<input class="button" type="submit" name="submit.Save" value="Save"/>
</fieldset>
</div>
</div>

View File

@@ -6,7 +6,7 @@
<p class="bottomSpacer"><%=_Encoded("about setting up a page") %></p>
<%=Html.ValidationSummary() %>
<div class="sections">
<%using (Html.BeginForm()) { %>
<% using (Html.BeginForm()) { %>
<div class="primary">
<h3><%=_Encoded("Page Content") %></h3>
<%-- todo: (heskew) change the editors to be self-contained (fieldset > editor) --%>
@@ -45,6 +45,6 @@
<input class="delete button" type="submit" name="submit.DeleteDraft" value="Delete Draft" <%=Model.CanDeleteDraft ? "" : "disabled" %>/>
</fieldset>
</div>
<%}/*EndForm*/%>
<% } %>
</div>
<% Html.Include("Foot"); %>