mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 19:04:51 +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") %>
|
<%=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><%
|
<div class="actions"><a class="add button" href="<%=Url.BlogCreate() %>"><%=_Encoded("New Blog") %></a></div><%
|
||||||
} else { %>
|
} else { %>
|
||||||
<%-- todo: (heskew) come back to this --%>
|
<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><%
|
||||||
<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><%
|
|
||||||
} %>
|
} %>
|
@@ -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"%>
|
<%@ 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"%>
|
<%@ 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) { %>
|
foreach (var comment in Model.Comments) { %>
|
||||||
<div>
|
<div>
|
||||||
<div class="comment">
|
<div class="comment">
|
||||||
|
@@ -1,21 +1,19 @@
|
|||||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<HasComments>" %>
|
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<HasComments>" %>
|
||||||
<%@ Import Namespace="Orchard.Comments.Models" %>
|
<%@ Import Namespace="Orchard.Comments.Models" %>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Comments<% if (Model.ContentItem.Id != 0) { %>:
|
<%-- todo: (heskew) pull the legend and put the link to the comments elsewhere? --%>
|
||||||
<%
|
<legend><%=Model.ContentItem.Id != 0
|
||||||
var commentCount = Model.CommentCount; %>
|
? T("Comments {0} - <a href=\"#\">?? pending</a>", Html.ActionLink(
|
||||||
<%=Html.ActionLink(
|
T("{0} comment{1}", Model.CommentCount, Model.CommentCount == 1 ? "" : "s").ToString(),
|
||||||
string.Format("{0} comment{1}", commentCount, commentCount == 1 ? "" : "s"),
|
"Details",
|
||||||
"Details",
|
new { Area = "Orchard.Comments", Controller = "Admin", id = Model.ContentItem.Id, returnUrl = Context.Request.Url }))
|
||||||
new { Area = "Orchard.Comments", Controller = "Admin", id = Model.ContentItem.Id, returnUrl = Context.Request.Url }
|
: T("Comments")%></legend>
|
||||||
) %>
|
<%--
|
||||||
- <a href="#">0 pending</a><% } %></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
|
||||||
<label for="CommentsShown">
|
<%=Html.EditorFor(m => m.CommentsShown) %>
|
||||||
<%=Html.EditorFor(x=>x.CommentsShown) %>
|
<label class="forcheckbox" for="CommentsShown"><%=T("Comments are shown. Existing comments are displayed.") %></label>
|
||||||
<%= T("Comments are shown. Existing comments are displayed.")%>
|
--%>
|
||||||
</label>
|
<%=Html.EditorFor(m => m.CommentsActive) %>
|
||||||
<label for="CommentsActive">
|
<label class="forcheckbox" for="CommentsActive"><%=T("Allow new comments") %></label>
|
||||||
<%=Html.EditorFor(x=>x.CommentsActive) %>
|
<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>
|
||||||
<%= T("Comments active. Users may add comments.")%>
|
|
||||||
</label>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
@@ -1,34 +1,35 @@
|
|||||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Orchard.Comments.Models.CommentSettingsRecord>" %>
|
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<CommentSettingsRecord>" %>
|
||||||
<h3>Comments</h3>
|
<%@ Import Namespace="Orchard.Comments.Models"%>
|
||||||
<ol>
|
<fieldset>
|
||||||
<li>
|
<legend><%=_Encoded("Comments")%></legend>
|
||||||
<%= Html.LabelFor(x=>x.RequireLoginToAddComment) %>
|
<fieldset>
|
||||||
<%= Html.EditorFor(x=>x.RequireLoginToAddComment) %>
|
<%=Html.EditorFor(m => m.EnableCommentsOnPages) %>
|
||||||
<%= Html.ValidationMessage("RequireLoginToAddComment", "*")%>
|
<label class="forcheckbox" for="CommentSettings_EnableCommentsOnPages"><%=_Encoded("Enable comments on pages")%></label>
|
||||||
</li>
|
<%=Html.ValidationMessage("EnableCommentsOnPages", "*")%>
|
||||||
<li>
|
</fieldset>
|
||||||
<%= Html.LabelFor(x=>x.EnableCommentsOnPages) %>
|
<fieldset>
|
||||||
<%= Html.EditorFor(x=>x.EnableCommentsOnPages) %>
|
<%=Html.EditorFor(m => m.EnableCommentsOnPosts) %>
|
||||||
<%= Html.ValidationMessage("EnableCommentsOnPages", "*")%>
|
<label class="forcheckbox" for="CommentSettings_EnableCommentsOnPosts"><%=_Encoded("Enable comments on blog posts")%></label>
|
||||||
</li>
|
<%=Html.ValidationMessage("EnableCommentsOnPosts", "*")%>
|
||||||
<li>
|
</fieldset>
|
||||||
<%= Html.LabelFor(x=>x.EnableCommentsOnPosts) %>
|
<fieldset>
|
||||||
<%= Html.EditorFor(x=>x.EnableCommentsOnPosts) %>
|
<%=Html.EditorFor(m => m.RequireLoginToAddComment) %>
|
||||||
<%= Html.ValidationMessage("EnableCommentsOnPosts", "*")%>
|
<label class="forcheckbox" for="CommentSettings_RequireLoginToAddComment"><%=_Encoded("Require login to comment")%></label>
|
||||||
</li>
|
<%=Html.ValidationMessage("RequireLoginToAddComment", "*")%>
|
||||||
<li>
|
</fieldset>
|
||||||
<%= Html.LabelFor(x=>x.EnableSpamProtection) %>
|
<fieldset>
|
||||||
<%= Html.EditorFor(x=>x.EnableSpamProtection) %>
|
<%=Html.EditorFor(m => m.EnableSpamProtection) %>
|
||||||
<%= Html.ValidationMessage("EnableSpamProtection", "*")%>
|
<label class="forcheckbox" for="CommentSettings_EnableSpamProtection"><%=_Encoded("Enable spam protection") %></label>
|
||||||
</li>
|
<%=Html.ValidationMessage("EnableSpamProtection", "*")%>
|
||||||
<li>
|
</fieldset>
|
||||||
<%= Html.LabelFor(x=>x.AkismetKey) %>
|
<fieldset>
|
||||||
<%= Html.EditorFor(x=>x.AkismetKey) %>
|
<label for="CommentSettings_AkismetKey"><%=_Encoded("Akismet key") %></label>
|
||||||
<%= Html.ValidationMessage("AkismetKey", "*")%>
|
<%=Html.EditorFor(m => m.AkismetKey) %>
|
||||||
</li>
|
<%=Html.ValidationMessage("AkismetKey", "*")%>
|
||||||
<li>
|
</fieldset>
|
||||||
<%= Html.LabelFor(x=>x.AkismetUrl) %>
|
<fieldset>
|
||||||
<%= Html.EditorFor(x=>x.AkismetUrl) %>
|
<label for="CommentSettings_AkismetUrl"><%=_Encoded("Akismet endpoint URL") %></label>
|
||||||
<%= Html.ValidationMessage("AkismetUrl", "*")%>
|
<%=Html.EditorFor(m => m.AkismetUrl) %>
|
||||||
</li>
|
<%=Html.ValidationMessage("AkismetUrl", "*")%>
|
||||||
</ol>
|
</fieldset>
|
||||||
|
</fieldset>
|
@@ -154,7 +154,7 @@ h6, p, legend, label, input, select, .button,
|
|||||||
.message, .validation-summary-errors,
|
.message, .validation-summary-errors,
|
||||||
table.items th, table.items td, table.items caption { font-size:1.5em; line-height:1.5em; } /* 15px */
|
table.items th, table.items td, table.items caption { font-size:1.5em; line-height:1.5em; } /* 15px */
|
||||||
p .button { font-size:inherit; }
|
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;
|
display: block;
|
||||||
font-weight:700;
|
font-weight:700;
|
||||||
}
|
}
|
||||||
|
label.forcheckbox {
|
||||||
|
display:inline;
|
||||||
|
}
|
||||||
fieldset.bulk.actions label, label.sub {
|
fieldset.bulk.actions label, label.sub {
|
||||||
display:inline;
|
display:inline;
|
||||||
}
|
}
|
||||||
@@ -360,6 +363,12 @@ label span {
|
|||||||
label input {
|
label input {
|
||||||
vertical-align:text-top;
|
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 */
|
/* todo: (heskew) try to get .text on stuff like .text-box */
|
||||||
select, textarea, input.text, input.text-box {
|
select, textarea, input.text, input.text-box {
|
||||||
padding:2px;
|
padding:2px;
|
||||||
@@ -372,6 +381,10 @@ input.text, input.text-box {
|
|||||||
select:focus, textarea:focus, input.text:focus, input.text-box:focus {
|
select:focus, textarea:focus, input.text:focus, input.text-box:focus {
|
||||||
border-color:#666d51;
|
border-color:#666d51;
|
||||||
}
|
}
|
||||||
|
input.check-box {
|
||||||
|
margin-left:0;
|
||||||
|
vertical-align:-.1em;
|
||||||
|
}
|
||||||
.permalink input {
|
.permalink input {
|
||||||
background:transparent;
|
background:transparent;
|
||||||
border-color:#EAE9D9;
|
border-color:#EAE9D9;
|
||||||
|
@@ -1,31 +1,5 @@
|
|||||||
using System;
|
namespace Orchard.Localization {
|
||||||
using System.Collections.Generic;
|
public interface IText {
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using Orchard.Logging;
|
|
||||||
|
|
||||||
namespace Orchard.Localization {
|
|
||||||
public interface IText {
|
|
||||||
LocalizedString Get(string textHint, params object[] args);
|
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\ContentPartVersionRecord.cs" />
|
||||||
<Compile Include="ContentManagement\Records\ContentTypeRecord.cs" />
|
<Compile Include="ContentManagement\Records\ContentTypeRecord.cs" />
|
||||||
<Compile Include="ContentManagement\Records\Utility.cs" />
|
<Compile Include="ContentManagement\Records\Utility.cs" />
|
||||||
|
<Compile Include="Localization\Text.cs" />
|
||||||
<Compile Include="Mvc\ViewModels\ContentItemViewModel.cs" />
|
<Compile Include="Mvc\ViewModels\ContentItemViewModel.cs" />
|
||||||
<Compile Include="ContentManagement\ViewModels\TemplateViewModel.cs" />
|
<Compile Include="ContentManagement\ViewModels\TemplateViewModel.cs" />
|
||||||
<Compile Include="Controllers\HomeController.cs" />
|
<Compile Include="Controllers\HomeController.cs" />
|
||||||
|
Reference in New Issue
Block a user