Bunch of public-facing blog UI cleanup

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4043236
This commit is contained in:
skewed
2009-12-05 00:26:36 +00:00
parent d07a59ed51
commit bcb489fadd
14 changed files with 136 additions and 72 deletions

View File

@@ -315,3 +315,86 @@ div#title
font-weight: bold; font-weight: bold;
color: #ff0000; color: #ff0000;
} }
/* ALL THAT IS BELOW IS TEMPORARY TO MAKE THINGS LOOK DECENT IN THIS SKIN */
.manage {
float:right;
}
.metadata {
color:#999;
margin-top:-2em;
}
.blog.metadata {
margin-top:-1.5em;
}
.metadata, p.tags {
font-size:95%;
}
ul.blogs, ul.posts {
padding-left:0;
}
ul.blogs li, ul.posts li {
list-style-type:none;
}
/* Icon buttons
----------------------------------------------------------*/
a.ibutton, a.ibutton:link, a.ibutton:visited {
background:url(Admin/css/images/icons.png) 0 -20px;
border:none;
display:inline;
float:left;
height:17px;
overflow:hidden;
padding:0 0 0 17px;
width:0;
}
a.ibutton:hover, a.ibutton:active, a.ibutton:focus { background-position:0 0; }
a.ibutton.remove,
a.ibutton.remove:link,
a.ibutton.remove:visited { background-position:-20px -20px; }
a.ibutton.remove:hover, a.ibutton.remove:active, a.ibutton.remove:focus { background-position:-20px 0; }
a.ibutton.view,
a.ibutton.view:link,
a.ibutton.view:visited { background-position:-40px -20px; }
a.ibutton.view:hover, a.ibutton.view:active, a.ibutton.view:focus { background-position:-40px 0; }
a.ibutton.add.page,
a.ibutton.add.page:link,
a.ibutton.add.page:visited { background-position:-60px -20px; }
a.ibutton.add.page:hover, a.ibutton.add.page:active, a.ibutton.add.page:focus { background-position:-60px 0; }
a.ibutton.edit,
a.ibutton.edit:link,
a.ibutton.edit:visited { background-position:-80px -20px; }
a.ibutton.edit:hover, a.ibutton.edit:active, a.ibutton.edit:focus { background-position:-80px 0; }
a.ibutton.publish,
a.ibutton.publish:link,
a.ibutton.publish:visited { background-position:-100px -20px; }
a.ibutton.publish:hover, a.ibutton.publish:active, a.ibutton.publish:focus { background-position:-100px 0; }
a.ibutton.blog,
a.ibutton.blog:link,
a.ibutton.blog:visited { background-position:-120px -20px; }
a.ibutton.blog:hover, a.ibutton.blog:active, a.ibutton.blog:focus { background-position:-120px 0; }
/* Forms
----------------------------------------------------------*/
fieldset {
border:0;
margin:0 0 1em;
padding:0;
}
form.comments {
overflow:hidden;
}
form.comments fieldset.who, form.comments fieldset.what {
float:left;
margin-right:15px;
}
form.comments label {
font-weight:bold;
margin-top:15px;
}
form.comments .button {
margin-top:15px;
}

View File

@@ -16,7 +16,7 @@ namespace Orchard.Core.Common.Providers {
OnGetDisplayViewModel<BodyAspect>((context, body) => { OnGetDisplayViewModel<BodyAspect>((context, body) => {
var model = new BodyDisplayViewModel { BodyAspect = body }; var model = new BodyDisplayViewModel { BodyAspect = body };
context.AddDisplay(new TemplateViewModel(model, TemplatePrefix) { TemplateName = TemplateName, ZoneName = "body" }); context.AddDisplay(new TemplateViewModel(model, TemplatePrefix) { TemplateName = TemplateName });
}); });
OnGetEditorViewModel<BodyAspect>((context, body) => { OnGetEditorViewModel<BodyAspect>((context, body) => {

View File

@@ -168,7 +168,7 @@ namespace Orchard.Blogs.Controllers {
IValueProvider values = input.ToValueProvider(); IValueProvider values = input.ToValueProvider();
TryUpdateModel(model, values); TryUpdateModel(model, values);
_notifier.Information(T("Blog post information updated")); _notifier.Information(T("Blog post information updated."));
//TODO: (erikpo) Since the model isn't actually updated yet and it's possible the slug changed I'm getting the slug from input. Lame?!?! //TODO: (erikpo) Since the model isn't actually updated yet and it's possible the slug changed I'm getting the slug from input. Lame?!?!
return Redirect(Url.BlogPostEdit(blog.Slug, values.GetValue(ControllerContext, "Slug").AttemptedValue)); return Redirect(Url.BlogPostEdit(blog.Slug, values.GetValue(ControllerContext, "Slug").AttemptedValue));

View File

@@ -1,8 +1,6 @@
<%@ 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.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.Models"%> <%@ Import Namespace="Orchard.Blogs.Models"%>
<h2> <h3><a href="<%=Url.Blog(Model.Slug) %>"><%=Html.Encode(Model.Name) %></a></h3>
<a href="<%=Url.Blog(Model.Slug) %>"><%=Html.Encode(Model.Name) %></a> <div class="blog metadata"><a href="<%=Url.Blog(Model.Slug) %>"><%=Model.PostCount %> post<%=Model.PostCount == 1 ? "" : "s" %></a></div>
<span>(<%=Model.PostCount %> post<%=Model.PostCount == 1 ? "" : "s" %>)</span>
</h2>
<p><%=Model.Description %></p> <p><%=Model.Description %></p>

View File

@@ -8,12 +8,12 @@
<%@ Import Namespace="Orchard.Mvc.ViewModels"%> <%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%-- todo: (heskew) make master-less when we get into theming --%> <%-- todo: (heskew) make master-less when we get into theming --%>
<asp:Content ContentPlaceHolderID="MainContent" runat="server"> <asp:Content ContentPlaceHolderID="MainContent" runat="server">
<h1><%=Html.Encode(Model.Blog.Name) %></h1> <div class="manage"><a href="<%=Url.BlogEdit(Model.Blog.Slug) %>" class="ibutton edit">edit</a></div>
<div><%=Html.Encode(Model.Blog.Description) %></div> <h2><%=Html.Encode(Model.Blog.Name) %></h2>
<div><a href="<%=Url.BlogEdit(Model.Blog.Slug) %>">(edit)</a></div><% <div><%=Html.Encode(Model.Blog.Description) %></div><%
//TODO: (erikpo) Move this into a helper //TODO: (erikpo) Move this into a helper
if (Model.Posts.Count() > 0) { %> if (Model.Posts.Count() > 0) { %>
<ul><% <ul class="posts"><%
foreach (BlogPost post in Model.Posts) { %> foreach (BlogPost post in Model.Posts) { %>
<li><% Html.RenderPartial("BlogPostPreview", post); %></li><% <li><% Html.RenderPartial("BlogPostPreview", post); %></li><%
} %> } %>

View File

@@ -5,7 +5,7 @@
<%@ Import Namespace="Orchard.Mvc.Html"%> <%@ Import Namespace="Orchard.Mvc.Html"%>
<%-- todo: (heskew) make master-less when we get into theming --%> <%-- todo: (heskew) make master-less when we get into theming --%>
<asp:Content ContentPlaceHolderID="MainContent" runat="server"> <asp:Content ContentPlaceHolderID="MainContent" runat="server">
<h1>Blogs</h1> <h2>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> <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>
<%=Html.DisplayForModel() %> <%=Html.DisplayForModel() %>
</asp:Content> </asp:Content>

View File

@@ -8,14 +8,14 @@
<%@ Import Namespace="Orchard.Mvc.ViewModels"%> <%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%-- todo: (heskew) make master-less when we get into theming --%> <%-- todo: (heskew) make master-less when we get into theming --%>
<asp:Content ContentPlaceHolderID="MainContent" runat="server"> <asp:Content ContentPlaceHolderID="MainContent" runat="server">
<h1><%=Html.Encode(Model.Post.Title) %></h1> <%-- todo: (heskew) needs to be an h1 --%>
<div class="manage"><a href="<%=Url.BlogPostEdit(Model.Blog.Slug, Model.Post.Slug) %>" class="ibutton edit">edit</a></div>
<h2><%=Html.Encode(Model.Post.Title) %></h2>
<div class="metadata"> <div class="metadata">
<%if (Model.Post.Creator != null) {%> <% if (Model.Post.Creator != null) {
<div class="posted">Posted by <%=Html.Encode(Model.Post.Creator.UserName)%> <%=Html.PublishedWhen(Model.Post)%></div> %><div class="posted">Posted by <%=Html.Encode(Model.Post.Creator.UserName)%> <%=Html.PublishedWhen(Model.Post)%></div><%
<%}%> } %>
<div><a href="<%=Url.BlogPostEdit(Model.Blog.Slug, Model.Post.Slug) %>">(edit)</a></div>
</div> </div>
<%foreach (var display in Model.ItemView.Displays) { %> <%foreach (var display in Model.ItemView.Displays) { %>
<%=Html.DisplayFor(m=>display.Model, display.TemplateName, display.Prefix) %> <%=Html.DisplayFor(m=>display.Model, display.TemplateName, display.Prefix) %>
<%} %> <%} %>

View File

@@ -3,6 +3,6 @@
<%@ Import Namespace="Orchard.Blogs.Extensions"%> <%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Core.Common.Models"%> <%@ Import Namespace="Orchard.Core.Common.Models"%>
<%@ Import Namespace="Orchard.Blogs.Models"%> <%@ Import Namespace="Orchard.Blogs.Models"%>
<h3 class="title"><a href="<%=Url.BlogPost(Model.Blog.Slug, Model.As<RoutableAspect>().Slug) %>"><%=Html.Encode(Model.As<RoutableAspect>().Title) %></a></h3> <h3><a href="<%=Url.BlogPost(Model.Blog.Slug, Model.As<RoutableAspect>().Slug) %>"><%=Html.Encode(Model.As<RoutableAspect>().Title) %></a></h3>
<div class="posted"><%=Html.PublishedWhen() %></div> <div class="blog metadata"><%=Html.PublishedState() %> | <a href="<%=Url.BlogPost(Model.Blog.Slug, Model.As<RoutableAspect>().Slug) %>#comments">?? comments</a></div>
<div class="content"><%=Model.Body %></div> <div class="content"><%=Model.Body %></div>

View File

@@ -23,7 +23,7 @@ namespace Orchard.Comments.Models {
if (context.ContentItem.Has<HasComments>() == false) { if (context.ContentItem.Has<HasComments>() == false) {
return; return;
} }
context.AddDisplay(new TemplateViewModel(context.ContentItem.Get<HasComments>())); context.AddDisplay(new TemplateViewModel(context.ContentItem.Get<HasComments>()) { Position = "999" });
} }
protected override void GetEditorViewModel(GetEditorViewModelContext context) { protected override void GetEditorViewModel(GetEditorViewModelContext context) {

View File

@@ -1,51 +1,38 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<HasComments>" %> <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<HasComments>" %>
<%@ Import Namespace="Orchard.Mvc.Html"%> <%@ Import Namespace="Orchard.Mvc.Html"%>
<%@ Import Namespace="Orchard.Comments.Models"%> <%@ Import Namespace="Orchard.Comments.Models"%>
<h3><%=Model.Comments.Count() %> Comment<%=Model.Comments.Count() == 1 ? "" : "s" %></h3><% <h3 id="comments"><%=Model.Comments.Count() %> Comment<%=Model.Comments.Count() == 1 ? "" : "s" %></h3><%
foreach (var comment in Model.Comments) { %> foreach (var comment in Model.Comments) { %>
<div class="name"> <div>
<div><!-- GRAVATAR --></div> <div class="comment">
<p class="comment">
<%--TODO: (erikpo) Need to clean the name and url so nothing dangerous goes out--%> <%--TODO: (erikpo) Need to clean the name and url so nothing dangerous goes out--%>
<strong><%=Html.LinkOrDefault(comment.UserName, comment.SiteName, new { rel = "nofollow" })%></strong> <span class="who"><%=Html.LinkOrDefault(comment.UserName, comment.SiteName, new { rel = "nofollow" })%></span>
<span>said<br /><%=Html.Link(Html.DateTimeRelative(comment.CommentDate), "#")%></span> <span>said <%=Html.Link(Html.DateTimeRelative(comment.CommentDate), "#")%></span>
</p> </div>
<div class="text"> <div class="text">
<p><%=comment.CommentText %></p> <p><%=comment.CommentText %></p>
</div> </div>
</div><% </div><%
} }
if (Model.Closed) { %> if (Model.Closed) { %>
<p>Comments have been disabled for this content.</p><% <p>Comments have been disabled for this content.</p><%
} } else { %>
else { %> <% using(Html.BeginForm("Create", "Admin", new { area = "Orchard.Comments" }, FormMethod.Post, new { @class = "comments" })) { %>
<% Html.BeginForm("Create", "Admin", new { area = "Orchard.Comments" }); %> <%=Html.ValidationSummary() %>
<%=Html.ValidationSummary() %> <fieldset class="who">
<div class="yui-g">
<h2 class="separator">Add a Comment</h2>
<ol>
<li>
<%= Html.Hidden("CommentedOn", Model.ContentItem.Id) %> <%= Html.Hidden("CommentedOn", Model.ContentItem.Id) %>
<%= Html.Hidden("ReturnUrl", Context.Request.Url) %> <%= Html.Hidden("ReturnUrl", Context.Request.Url) %>
<label for="Name">Name:</label> <label for="Name">Name</label>
<input id="Text1" class="inputText inputTextLarge" name="Name" type="text" /> <input id="Name" class="text" name="Name" type="text" /><br />
</li> <label for="Email">Email</label>
<li> <input id="Email" class="text" name="Email" type="text" /><br />
<label for="Email">Email:</label> <label for="SiteName">Url</label>
<input id="Email" class="inputText inputTextLarge" name="Email" type="text" /> <input id="SiteName" class="text" name="SiteName" type="text" /><br />
</li> </fieldset>
<li> <fieldset class="what">
<label for="SiteName">Url:</label>
<input id="SiteName" class="inputText inputTextLarge" name="SiteName" type="text" />
</li>
<li>
<label for="CommentText">Leave a comment</label> <label for="CommentText">Leave a comment</label>
<textarea id="CommentText" rows="10" cols="30" name="CommentText"></textarea> <textarea id="CommentText" rows="10" cols="30" name="CommentText"></textarea><br />
</li>
<li>
<input type="submit" class="button" value="Submit Comment" /> <input type="submit" class="button" value="Submit Comment" />
</li> </fieldset><%
</ol> }
</div> } %>
<% Html.EndForm(); %><%
} %>

View File

@@ -4,10 +4,10 @@ using Orchard.Models.ViewModels;
namespace Orchard.DevTools.Models { namespace Orchard.DevTools.Models {
public class DebugLinkProvider : ContentProvider { public class DebugLinkProvider : ContentProvider {
protected override void GetDisplayViewModel(GetDisplayViewModelContext context) { protected override void GetDisplayViewModel(GetDisplayViewModelContext context) {
context.AddDisplay(new TemplateViewModel(new ShowDebugLink { ContentItem = context.ContentItem }) { ZoneName = "recap", Position = "10" }); context.AddDisplay(new TemplateViewModel(new ShowDebugLink { ContentItem = context.ContentItem }) { ZoneName = "recap", Position = "9999" });
} }
protected override void GetEditorViewModel(GetEditorViewModelContext context) { protected override void GetEditorViewModel(GetEditorViewModelContext context) {
context.AddEditor(new TemplateViewModel(new ShowDebugLink { ContentItem = context.ContentItem }) { ZoneName = "recap", Position = "10" }); context.AddEditor(new TemplateViewModel(new ShowDebugLink { ContentItem = context.ContentItem }) { ZoneName = "recap", Position = "9999" });
} }
} }
} }

View File

@@ -32,8 +32,8 @@ namespace Orchard.Tags.Models {
Filters.Add(new ActivatingFilter<HasTags>("blogpost")); Filters.Add(new ActivatingFilter<HasTags>("blogpost"));
OnGetDisplayViewModel<HasTags>((context, hasTags) => { OnGetDisplayViewModel<HasTags>((context, hasTags) => {
context.AddDisplay(new TemplateViewModel(hasTags) { ZoneName="metatop", Position = "2", TemplateName = "HasTagsList" }); context.AddDisplay(new TemplateViewModel(hasTags) { Position = "1", TemplateName = "HasTagsList" });
context.AddDisplay(new TemplateViewModel(hasTags) { ZoneName = "metabottom", Position = "5" }); context.AddDisplay(new TemplateViewModel(hasTags) { Position = "1" });
}); });
} }

View File

@@ -1,7 +1,7 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<HasTags>" %> <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<HasTags>" %>
<%@ Import Namespace="Orchard.Mvc.Html"%> <%@ Import Namespace="Orchard.Mvc.Html"%>
<%@ Import Namespace="Orchard.Tags.Models"%> <%@ Import Namespace="Orchard.Tags.Models"%>
<h3>Tags</h3> <%--<h3>Tags</h3>
<% Html.BeginForm("Edit", "Home", new { area = "Orchard.Tags" }); %> <% Html.BeginForm("Edit", "Home", new { area = "Orchard.Tags" }); %>
<%= Html.ValidationSummary() %> <%= Html.ValidationSummary() %>
<div class="yui-g"> <div class="yui-g">
@@ -16,4 +16,4 @@
</li> </li>
</ol> </ol>
</div> </div>
<% Html.EndForm(); %> <% Html.EndForm(); %>--%>

View File

@@ -1,12 +1,8 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<HasTags>" %> <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<HasTags>" %>
<%@ Import Namespace="Orchard.Mvc.Html" %> <%@ Import Namespace="Orchard.Mvc.Html" %>
<%@ Import Namespace="Orchard.Tags.Models" %> <%@ Import Namespace="Orchard.Tags.Models" %>
Tag<%=Model.CurrentTags.Count == 1 ? "" : "s" %>: <% <p class="tags">
int tagCount = 0; <% if (Model.CurrentTags.Count > 0) { %><span>Tags:</span> <% } %>
foreach (Tag tag in Model.CurrentTags) { <%=string.Join(", ", Model.CurrentTags.Select(t => Html.ActionLink(t.TagName, "Search", "Home", new { area = "Orchard.Tags", tagName = t.TagName }, new { }).ToHtmlString()).ToArray())%>
if (tagCount > 0) { <%--<%=Html.UnorderedList(Model.CurrentTags, (t, i) => Html.ActionLink(t.TagName, "Search", "Home", new { area = "Orchard.Tags", tagName = t.TagName }, new { }).ToHtmlString(), "tags")%>--%>
%>, <% </p>
}
%><%=Html.ActionLink(tag.TagName, "Search", "Home", new{ area="Orchard.Tags", tagName=tag.TagName}, new {}) %><%
tagCount++;
} %>