mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 10:54:50 +08:00
UI cleanup pass (progress - some of Orchard.Comments)
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4045097
This commit is contained in:
@@ -8,7 +8,5 @@ if (Model.Blogs.Count() > 0) { %>
|
||||
<%=Html.UnorderedList(Model.Blogs, (b, i) => Html.DisplayForItem(b).ToHtmlString(), "blogs contentItems") %>
|
||||
<div class="actions"><a class="add button" href="<%=Url.BlogCreate() %>"><%=_Encoded("New Blog") %></a></div><%
|
||||
} else { %>
|
||||
<%-- 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><%
|
||||
<div class="info message"><%=T("There are no blogs for you to see. Want to <a href=\"{0}\">add one</a>?", Url.BlogCreate()).ToString()%></div><%
|
||||
} %>
|
@@ -1,3 +1,3 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<HasComments>" %>
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<HasComments>" %>
|
||||
<%@ Import Namespace="Orchard.Comments.Models"%>
|
||||
<span class="commentcount"><a href="#comments"><%=Model.CommentCount %> Comment<%=Model.CommentCount == 1 ? "" : "s" %></a></span>
|
||||
<span class="commentcount"><%=Html.Link(_Encoded("{0} Comment{1}", Model.CommentCount, Model.CommentCount == 1 ? "" : "s").ToString(), "#comments") %></span>
|
@@ -1,6 +1,6 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<HasComments>" %>
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<HasComments>" %>
|
||||
<%@ Import Namespace="Orchard.Comments.Models"%>
|
||||
<h3 id="comments"><a name="comments"><%=Model.CommentCount %> Comment<%=Model.CommentCount == 1 ? "" : "s" %></a></h3><%
|
||||
<h2 id="comments"><%=_Encoded("{0} Comment{1}", Model.CommentCount, Model.CommentCount == 1 ? "" : "s") %></h2><%
|
||||
foreach (var comment in Model.Comments) { %>
|
||||
<div>
|
||||
<div class="comment">
|
||||
|
@@ -1,21 +1,19 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<HasComments>" %>
|
||||
<%@ Import Namespace="Orchard.Comments.Models" %>
|
||||
<fieldset>
|
||||
<legend>Comments<% if (Model.ContentItem.Id != 0) { %>:
|
||||
<%
|
||||
var commentCount = Model.CommentCount; %>
|
||||
<%=Html.ActionLink(
|
||||
string.Format("{0} comment{1}", commentCount, commentCount == 1 ? "" : "s"),
|
||||
"Details",
|
||||
new { Area = "Orchard.Comments", Controller = "Admin", id = Model.ContentItem.Id, returnUrl = Context.Request.Url }
|
||||
) %>
|
||||
- <a href="#">0 pending</a><% } %></legend>
|
||||
<label for="CommentsShown">
|
||||
<%=Html.EditorFor(x=>x.CommentsShown) %>
|
||||
<%= T("Comments are shown. Existing comments are displayed.")%>
|
||||
</label>
|
||||
<label for="CommentsActive">
|
||||
<%=Html.EditorFor(x=>x.CommentsActive) %>
|
||||
<%= T("Comments active. Users may add comments.")%>
|
||||
</label>
|
||||
<%-- todo: (heskew) pull the legend and put the link to the comments elsewhere? --%>
|
||||
<legend><%=Model.ContentItem.Id != 0
|
||||
? T("Comments {0} - <a href=\"#\">?? pending</a>", Html.ActionLink(
|
||||
T("{0} comment{1}", Model.CommentCount, Model.CommentCount == 1 ? "" : "s").ToString(),
|
||||
"Details",
|
||||
new { Area = "Orchard.Comments", Controller = "Admin", id = Model.ContentItem.Id, returnUrl = Context.Request.Url }))
|
||||
: T("Comments")%></legend>
|
||||
<%--
|
||||
todo: (heskew) can get into a weird state if this is disabled but comments are active so, yeah, comment settings on a content item need to be hashed out
|
||||
<%=Html.EditorFor(m => m.CommentsShown) %>
|
||||
<label class="forcheckbox" for="CommentsShown"><%=T("Comments are shown. Existing comments are displayed.") %></label>
|
||||
--%>
|
||||
<%=Html.EditorFor(m => m.CommentsActive) %>
|
||||
<label class="forcheckbox" for="CommentsActive"><%=T("Allow new comments") %></label>
|
||||
<span class="hint forcheckbox"><%=T("Enable to show the comment form. Disabling still allows the existing comments to be shown but does not allow the conversation to continue.")%></span>
|
||||
</fieldset>
|
||||
|
@@ -1,34 +1,35 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Orchard.Comments.Models.CommentSettingsRecord>" %>
|
||||
<h3>Comments</h3>
|
||||
<ol>
|
||||
<li>
|
||||
<%= Html.LabelFor(x=>x.RequireLoginToAddComment) %>
|
||||
<%= Html.EditorFor(x=>x.RequireLoginToAddComment) %>
|
||||
<%= Html.ValidationMessage("RequireLoginToAddComment", "*")%>
|
||||
</li>
|
||||
<li>
|
||||
<%= Html.LabelFor(x=>x.EnableCommentsOnPages) %>
|
||||
<%= Html.EditorFor(x=>x.EnableCommentsOnPages) %>
|
||||
<%= Html.ValidationMessage("EnableCommentsOnPages", "*")%>
|
||||
</li>
|
||||
<li>
|
||||
<%= Html.LabelFor(x=>x.EnableCommentsOnPosts) %>
|
||||
<%= Html.EditorFor(x=>x.EnableCommentsOnPosts) %>
|
||||
<%= Html.ValidationMessage("EnableCommentsOnPosts", "*")%>
|
||||
</li>
|
||||
<li>
|
||||
<%= Html.LabelFor(x=>x.EnableSpamProtection) %>
|
||||
<%= Html.EditorFor(x=>x.EnableSpamProtection) %>
|
||||
<%= Html.ValidationMessage("EnableSpamProtection", "*")%>
|
||||
</li>
|
||||
<li>
|
||||
<%= Html.LabelFor(x=>x.AkismetKey) %>
|
||||
<%= Html.EditorFor(x=>x.AkismetKey) %>
|
||||
<%= Html.ValidationMessage("AkismetKey", "*")%>
|
||||
</li>
|
||||
<li>
|
||||
<%= Html.LabelFor(x=>x.AkismetUrl) %>
|
||||
<%= Html.EditorFor(x=>x.AkismetUrl) %>
|
||||
<%= Html.ValidationMessage("AkismetUrl", "*")%>
|
||||
</li>
|
||||
</ol>
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<CommentSettingsRecord>" %>
|
||||
<%@ Import Namespace="Orchard.Comments.Models"%>
|
||||
<fieldset>
|
||||
<legend><%=_Encoded("Comments")%></legend>
|
||||
<fieldset>
|
||||
<%=Html.EditorFor(m => m.EnableCommentsOnPages) %>
|
||||
<label class="forcheckbox" for="CommentSettings_EnableCommentsOnPages"><%=_Encoded("Enable comments on pages")%></label>
|
||||
<%=Html.ValidationMessage("EnableCommentsOnPages", "*")%>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<%=Html.EditorFor(m => m.EnableCommentsOnPosts) %>
|
||||
<label class="forcheckbox" for="CommentSettings_EnableCommentsOnPosts"><%=_Encoded("Enable comments on blog posts")%></label>
|
||||
<%=Html.ValidationMessage("EnableCommentsOnPosts", "*")%>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<%=Html.EditorFor(m => m.RequireLoginToAddComment) %>
|
||||
<label class="forcheckbox" for="CommentSettings_RequireLoginToAddComment"><%=_Encoded("Require login to comment")%></label>
|
||||
<%=Html.ValidationMessage("RequireLoginToAddComment", "*")%>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<%=Html.EditorFor(m => m.EnableSpamProtection) %>
|
||||
<label class="forcheckbox" for="CommentSettings_EnableSpamProtection"><%=_Encoded("Enable spam protection") %></label>
|
||||
<%=Html.ValidationMessage("EnableSpamProtection", "*")%>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label for="CommentSettings_AkismetKey"><%=_Encoded("Akismet key") %></label>
|
||||
<%=Html.EditorFor(m => m.AkismetKey) %>
|
||||
<%=Html.ValidationMessage("AkismetKey", "*")%>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label for="CommentSettings_AkismetUrl"><%=_Encoded("Akismet endpoint URL") %></label>
|
||||
<%=Html.EditorFor(m => m.AkismetUrl) %>
|
||||
<%=Html.ValidationMessage("AkismetUrl", "*")%>
|
||||
</fieldset>
|
||||
</fieldset>
|
@@ -154,7 +154,7 @@ h6, p, legend, label, input, select, .button,
|
||||
.message, .validation-summary-errors,
|
||||
table.items th, table.items td, table.items caption { font-size:1.5em; line-height:1.5em; } /* 15px */
|
||||
p .button { font-size:inherit; }
|
||||
.meta { font-size:1.2em; } /* 12px */
|
||||
.meta, .hint { font-size:1.2em; } /* 12px */
|
||||
|
||||
|
||||
|
||||
@@ -351,6 +351,9 @@ label {
|
||||
display: block;
|
||||
font-weight:700;
|
||||
}
|
||||
label.forcheckbox {
|
||||
display:inline;
|
||||
}
|
||||
fieldset.bulk.actions label, label.sub {
|
||||
display:inline;
|
||||
}
|
||||
@@ -360,6 +363,12 @@ label span {
|
||||
label input {
|
||||
vertical-align:text-top;
|
||||
}
|
||||
.hint {
|
||||
display:block;
|
||||
}
|
||||
.hint.forcheckbox {
|
||||
text-indent:3ex; /* todo: (heskew) this might look out of place */
|
||||
}
|
||||
/* todo: (heskew) try to get .text on stuff like .text-box */
|
||||
select, textarea, input.text, input.text-box {
|
||||
padding:2px;
|
||||
@@ -372,6 +381,10 @@ input.text, input.text-box {
|
||||
select:focus, textarea:focus, input.text:focus, input.text-box:focus {
|
||||
border-color:#666d51;
|
||||
}
|
||||
input.check-box {
|
||||
margin-left:0;
|
||||
vertical-align:-.1em;
|
||||
}
|
||||
.permalink input {
|
||||
background:transparent;
|
||||
border-color:#EAE9D9;
|
||||
|
@@ -1,31 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Orchard.Logging;
|
||||
|
||||
namespace Orchard.Localization {
|
||||
public interface IText {
|
||||
namespace Orchard.Localization {
|
||||
public interface IText {
|
||||
LocalizedString Get(string textHint, params object[] args);
|
||||
}
|
||||
|
||||
|
||||
public class Text : IText {
|
||||
private readonly string _scope;
|
||||
|
||||
public Text(string scope) {
|
||||
_scope = scope;
|
||||
Logger = NullLogger.Instance;
|
||||
}
|
||||
|
||||
public ILogger Logger { get; set; }
|
||||
|
||||
public LocalizedString Get(string textHint, params object[] args) {
|
||||
Logger.Debug("{0} localizing '{1}'", _scope, textHint);
|
||||
|
||||
var localizedFormat = textHint;
|
||||
var localizedText = string.Format(localizedFormat, args);
|
||||
return new LocalizedString(localizedText);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
25
src/Orchard/Localization/Text.cs
Normal file
25
src/Orchard/Localization/Text.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Orchard.Logging;
|
||||
|
||||
namespace Orchard.Localization {
|
||||
public class Text : IText {
|
||||
private readonly string _scope;
|
||||
|
||||
public Text(string scope) {
|
||||
_scope = scope;
|
||||
Logger = NullLogger.Instance;
|
||||
}
|
||||
|
||||
public ILogger Logger { get; set; }
|
||||
|
||||
public LocalizedString Get(string textHint, params object[] args) {
|
||||
Logger.Debug("{0} localizing '{1}'", _scope, textHint);
|
||||
|
||||
//todo: actually localize the textHint
|
||||
var localizedFormat = textHint;
|
||||
|
||||
return args.Length < 1
|
||||
? new LocalizedString(localizedFormat)
|
||||
: new LocalizedString(string.Format(localizedFormat, args));
|
||||
}
|
||||
}
|
||||
}
|
@@ -177,6 +177,7 @@
|
||||
<Compile Include="ContentManagement\Records\ContentPartVersionRecord.cs" />
|
||||
<Compile Include="ContentManagement\Records\ContentTypeRecord.cs" />
|
||||
<Compile Include="ContentManagement\Records\Utility.cs" />
|
||||
<Compile Include="Localization\Text.cs" />
|
||||
<Compile Include="Mvc\ViewModels\ContentItemViewModel.cs" />
|
||||
<Compile Include="ContentManagement\ViewModels\TemplateViewModel.cs" />
|
||||
<Compile Include="Controllers\HomeController.cs" />
|
||||
|
Reference in New Issue
Block a user