mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 04:43:35 +08:00
Bunch of public-facing blog UI cleanup
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4043236
This commit is contained in:
@@ -315,3 +315,86 @@ div#title
|
||||
font-weight: bold;
|
||||
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;
|
||||
|
||||
}
|
@@ -16,7 +16,7 @@ namespace Orchard.Core.Common.Providers {
|
||||
|
||||
OnGetDisplayViewModel<BodyAspect>((context, 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) => {
|
||||
|
@@ -168,7 +168,7 @@ namespace Orchard.Blogs.Controllers {
|
||||
IValueProvider values = input.ToValueProvider();
|
||||
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?!?!
|
||||
return Redirect(Url.BlogPostEdit(blog.Slug, values.GetValue(ControllerContext, "Slug").AttemptedValue));
|
||||
|
@@ -1,8 +1,6 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Blog>" %>
|
||||
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
||||
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
||||
<h2>
|
||||
<a href="<%=Url.Blog(Model.Slug) %>"><%=Html.Encode(Model.Name) %></a>
|
||||
<span>(<%=Model.PostCount %> post<%=Model.PostCount == 1 ? "" : "s" %>)</span>
|
||||
</h2>
|
||||
<h3><a href="<%=Url.Blog(Model.Slug) %>"><%=Html.Encode(Model.Name) %></a></h3>
|
||||
<div class="blog metadata"><a href="<%=Url.Blog(Model.Slug) %>"><%=Model.PostCount %> post<%=Model.PostCount == 1 ? "" : "s" %></a></div>
|
||||
<p><%=Model.Description %></p>
|
||||
|
@@ -8,12 +8,12 @@
|
||||
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
|
||||
<%-- todo: (heskew) make master-less when we get into theming --%>
|
||||
<asp:Content ContentPlaceHolderID="MainContent" runat="server">
|
||||
<h1><%=Html.Encode(Model.Blog.Name) %></h1>
|
||||
<div><%=Html.Encode(Model.Blog.Description) %></div>
|
||||
<div><a href="<%=Url.BlogEdit(Model.Blog.Slug) %>">(edit)</a></div><%
|
||||
<div class="manage"><a href="<%=Url.BlogEdit(Model.Blog.Slug) %>" class="ibutton edit">edit</a></div>
|
||||
<h2><%=Html.Encode(Model.Blog.Name) %></h2>
|
||||
<div><%=Html.Encode(Model.Blog.Description) %></div><%
|
||||
//TODO: (erikpo) Move this into a helper
|
||||
if (Model.Posts.Count() > 0) { %>
|
||||
<ul><%
|
||||
<ul class="posts"><%
|
||||
foreach (BlogPost post in Model.Posts) { %>
|
||||
<li><% Html.RenderPartial("BlogPostPreview", post); %></li><%
|
||||
} %>
|
||||
|
@@ -5,7 +5,7 @@
|
||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||
<%-- todo: (heskew) make master-less when we get into theming --%>
|
||||
<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>
|
||||
<%=Html.DisplayForModel() %>
|
||||
</asp:Content>
|
@@ -8,14 +8,14 @@
|
||||
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
|
||||
<%-- todo: (heskew) make master-less when we get into theming --%>
|
||||
<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">
|
||||
<%if (Model.Post.Creator != null) {%>
|
||||
<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>
|
||||
<% if (Model.Post.Creator != null) {
|
||||
%><div class="posted">Posted by <%=Html.Encode(Model.Post.Creator.UserName)%> <%=Html.PublishedWhen(Model.Post)%></div><%
|
||||
} %>
|
||||
</div>
|
||||
|
||||
<%foreach (var display in Model.ItemView.Displays) { %>
|
||||
<%=Html.DisplayFor(m=>display.Model, display.TemplateName, display.Prefix) %>
|
||||
<%} %>
|
||||
|
@@ -3,6 +3,6 @@
|
||||
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
||||
<%@ Import Namespace="Orchard.Core.Common.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>
|
||||
<div class="posted"><%=Html.PublishedWhen() %></div>
|
||||
<h3><a href="<%=Url.BlogPost(Model.Blog.Slug, Model.As<RoutableAspect>().Slug) %>"><%=Html.Encode(Model.As<RoutableAspect>().Title) %></a></h3>
|
||||
<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>
|
@@ -23,7 +23,7 @@ namespace Orchard.Comments.Models {
|
||||
if (context.ContentItem.Has<HasComments>() == false) {
|
||||
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) {
|
||||
|
@@ -1,51 +1,38 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<HasComments>" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||
<%@ 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) { %>
|
||||
<div class="name">
|
||||
<div><!-- GRAVATAR --></div>
|
||||
<p class="comment">
|
||||
<div>
|
||||
<div class="comment">
|
||||
<%--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>said<br /><%=Html.Link(Html.DateTimeRelative(comment.CommentDate), "#")%></span>
|
||||
</p>
|
||||
<span class="who"><%=Html.LinkOrDefault(comment.UserName, comment.SiteName, new { rel = "nofollow" })%></span>
|
||||
<span>said <%=Html.Link(Html.DateTimeRelative(comment.CommentDate), "#")%></span>
|
||||
</div>
|
||||
<div class="text">
|
||||
<p><%=comment.CommentText %></p>
|
||||
</div>
|
||||
</div><%
|
||||
}
|
||||
if (Model.Closed) { %>
|
||||
<p>Comments have been disabled for this content.</p><%
|
||||
}
|
||||
else { %>
|
||||
<% Html.BeginForm("Create", "Admin", new { area = "Orchard.Comments" }); %>
|
||||
<%=Html.ValidationSummary() %>
|
||||
<div class="yui-g">
|
||||
<h2 class="separator">Add a Comment</h2>
|
||||
<ol>
|
||||
<li>
|
||||
if (Model.Closed) { %>
|
||||
<p>Comments have been disabled for this content.</p><%
|
||||
} else { %>
|
||||
<% using(Html.BeginForm("Create", "Admin", new { area = "Orchard.Comments" }, FormMethod.Post, new { @class = "comments" })) { %>
|
||||
<%=Html.ValidationSummary() %>
|
||||
<fieldset class="who">
|
||||
<%= Html.Hidden("CommentedOn", Model.ContentItem.Id) %>
|
||||
<%= Html.Hidden("ReturnUrl", Context.Request.Url) %>
|
||||
<label for="Name">Name:</label>
|
||||
<input id="Text1" class="inputText inputTextLarge" name="Name" type="text" />
|
||||
</li>
|
||||
<li>
|
||||
<label for="Email">Email:</label>
|
||||
<input id="Email" class="inputText inputTextLarge" name="Email" type="text" />
|
||||
</li>
|
||||
<li>
|
||||
<label for="SiteName">Url:</label>
|
||||
<input id="SiteName" class="inputText inputTextLarge" name="SiteName" type="text" />
|
||||
</li>
|
||||
<li>
|
||||
<label for="Name">Name</label>
|
||||
<input id="Name" class="text" name="Name" type="text" /><br />
|
||||
<label for="Email">Email</label>
|
||||
<input id="Email" class="text" name="Email" type="text" /><br />
|
||||
<label for="SiteName">Url</label>
|
||||
<input id="SiteName" class="text" name="SiteName" type="text" /><br />
|
||||
</fieldset>
|
||||
<fieldset class="what">
|
||||
<label for="CommentText">Leave a comment</label>
|
||||
<textarea id="CommentText" rows="10" cols="30" name="CommentText"></textarea>
|
||||
</li>
|
||||
<li>
|
||||
<textarea id="CommentText" rows="10" cols="30" name="CommentText"></textarea><br />
|
||||
<input type="submit" class="button" value="Submit Comment" />
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<% Html.EndForm(); %><%
|
||||
} %>
|
||||
</fieldset><%
|
||||
}
|
||||
} %>
|
@@ -4,10 +4,10 @@ using Orchard.Models.ViewModels;
|
||||
namespace Orchard.DevTools.Models {
|
||||
public class DebugLinkProvider : ContentProvider {
|
||||
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) {
|
||||
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" });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -32,8 +32,8 @@ namespace Orchard.Tags.Models {
|
||||
Filters.Add(new ActivatingFilter<HasTags>("blogpost"));
|
||||
|
||||
OnGetDisplayViewModel<HasTags>((context, hasTags) => {
|
||||
context.AddDisplay(new TemplateViewModel(hasTags) { ZoneName="metatop", Position = "2", TemplateName = "HasTagsList" });
|
||||
context.AddDisplay(new TemplateViewModel(hasTags) { ZoneName = "metabottom", Position = "5" });
|
||||
context.AddDisplay(new TemplateViewModel(hasTags) { Position = "1", TemplateName = "HasTagsList" });
|
||||
context.AddDisplay(new TemplateViewModel(hasTags) { Position = "1" });
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<HasTags>" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||
<%@ Import Namespace="Orchard.Tags.Models"%>
|
||||
<h3>Tags</h3>
|
||||
<%--<h3>Tags</h3>
|
||||
<% Html.BeginForm("Edit", "Home", new { area = "Orchard.Tags" }); %>
|
||||
<%= Html.ValidationSummary() %>
|
||||
<div class="yui-g">
|
||||
@@ -16,4 +16,4 @@
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<% Html.EndForm(); %>
|
||||
<% Html.EndForm(); %>--%>
|
@@ -1,12 +1,8 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<HasTags>" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.Html" %>
|
||||
<%@ Import Namespace="Orchard.Tags.Models" %>
|
||||
Tag<%=Model.CurrentTags.Count == 1 ? "" : "s" %>: <%
|
||||
int tagCount = 0;
|
||||
foreach (Tag tag in Model.CurrentTags) {
|
||||
if (tagCount > 0) {
|
||||
%>, <%
|
||||
}
|
||||
%><%=Html.ActionLink(tag.TagName, "Search", "Home", new{ area="Orchard.Tags", tagName=tag.TagName}, new {}) %><%
|
||||
tagCount++;
|
||||
} %>
|
||||
<p class="tags">
|
||||
<% if (Model.CurrentTags.Count > 0) { %><span>Tags:</span> <% } %>
|
||||
<%=string.Join(", ", Model.CurrentTags.Select(t => Html.ActionLink(t.TagName, "Search", "Home", new { area = "Orchard.Tags", tagName = t.TagName }, new { }).ToHtmlString()).ToArray())%>
|
||||
<%--<%=Html.UnorderedList(Model.CurrentTags, (t, i) => Html.ActionLink(t.TagName, "Search", "Home", new { area = "Orchard.Tags", tagName = t.TagName }, new { }).ToHtmlString(), "tags")%>--%>
|
||||
</p>
|
Reference in New Issue
Block a user