UI cleanup pass (progress - Orchard.Tags)

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4045120
This commit is contained in:
skewed
2010-01-08 01:15:49 +00:00
parent d014ad93e2
commit aa3082a69e
12 changed files with 82 additions and 87 deletions

View File

@@ -2,4 +2,4 @@
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Core.Settings.Models"%>
<% Html.Zone("primary");
Html.ZonesAny(); %>
Html.ZonesAny(); %>

View File

@@ -2,34 +2,34 @@
<%@ Import Namespace="Orchard.Comments.Models"%>
<fieldset>
<legend><%=_Encoded("Comments")%></legend>
<fieldset>
<div>
<%=Html.EditorFor(m => m.EnableCommentsOnPages) %>
<label class="forcheckbox" for="CommentSettings_EnableCommentsOnPages"><%=_Encoded("Enable comments on pages")%></label>
<%=Html.ValidationMessage("EnableCommentsOnPages", "*")%>
</fieldset>
<fieldset>
</div>
<div>
<%=Html.EditorFor(m => m.EnableCommentsOnPosts) %>
<label class="forcheckbox" for="CommentSettings_EnableCommentsOnPosts"><%=_Encoded("Enable comments on blog posts")%></label>
<%=Html.ValidationMessage("EnableCommentsOnPosts", "*")%>
</fieldset>
<fieldset>
</div>
<div>
<%=Html.EditorFor(m => m.RequireLoginToAddComment) %>
<label class="forcheckbox" for="CommentSettings_RequireLoginToAddComment"><%=_Encoded("Require login to comment")%></label>
<%=Html.ValidationMessage("RequireLoginToAddComment", "*")%>
</fieldset>
<fieldset>
</div>
<div>
<%=Html.EditorFor(m => m.EnableSpamProtection) %>
<label class="forcheckbox" for="CommentSettings_EnableSpamProtection"><%=_Encoded("Enable spam protection") %></label>
<%=Html.ValidationMessage("EnableSpamProtection", "*")%>
</fieldset>
<fieldset>
</div>
<div>
<label for="CommentSettings_AkismetKey"><%=_Encoded("Akismet key") %></label>
<%=Html.EditorFor(m => m.AkismetKey) %>
<%=Html.ValidationMessage("AkismetKey", "*")%>
</fieldset>
<fieldset>
</div>
<div>
<label for="CommentSettings_AkismetUrl"><%=_Encoded("Akismet endpoint URL") %></label>
<%=Html.EditorFor(m => m.AkismetUrl) %>
<%=Html.ValidationMessage("AkismetUrl", "*")%>
</fieldset>
</div>
</fieldset>

View File

@@ -1,11 +1,11 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<TagsAdminCreateViewModel>" %>
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<TagsAdminCreateViewModel>" %>
<%@ Import Namespace="Orchard.Tags.ViewModels"%>
<h2><%=Html.TitleForPage("Add a Tag") %></h2>
<h1><%=Html.TitleForPage(T("Add a Tag").ToString()) %></h1>
<% using(Html.BeginFormAntiForgeryPost()) { %>
<%=Html.ValidationSummary() %>
<fieldset>
<label for="TagName">Name:</label>
<input id="TagName" class="text" name="TagName" type="text" value="<%=Model.TagName%>" />
<input type="submit" class="button" value="Save" />
<label for="TagName"><%=_Encoded("Name:")%></label>
<input id="TagName" class="text" name="TagName" type="text" value="<%=Html.Encode(Model.TagName) %>" />
<input type="submit" class="button" value="<%=_Encoded("Save") %>" />
</fieldset>
<% } %>

View File

@@ -1,12 +1,12 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<TagsAdminEditViewModel>" %>
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<TagsAdminEditViewModel>" %>
<%@ Import Namespace="Orchard.Tags.ViewModels"%>
<h2><%=Html.TitleForPage("Edit a Tag") %></h2>
<h1><%=Html.TitleForPage(T("Edit a Tag").ToString()) %></h1>
<% using(Html.BeginFormAntiForgeryPost()) { %>
<%=Html.ValidationSummary() %>
<fieldset>
<label for="Name">Name:</label>
<label for="Name"><%=_Encoded("Name:") %></label>
<input id="Id" name="Id" type="hidden" value="<%=Model.Id %>" />
<input id="TagName" class="text" name="TagName" type="text" value="<%= Model.TagName %>" />
<input type="submit" class="button" value="Save" />
<input id="TagName" class="text" name="TagName" type="text" value="<%=Html.Encode(Model.TagName) %>" />
<input type="submit" class="button" value="<%=_Encoded("Save") %>" />
</fieldset>
<% } %>

View File

@@ -1,19 +1,19 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<TagsAdminIndexViewModel>" %>
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<TagsAdminIndexViewModel>" %>
<%@ Import Namespace="Orchard.Tags.ViewModels"%>
<h2><%=Html.TitleForPage("Manage Tags")%></h2>
<h1><%=Html.TitleForPage(T("Manage Tags").ToString())%></h1>
<% using(Html.BeginFormAntiForgeryPost()) { %>
<%=Html.ValidationSummary() %>
<fieldset class="actions bulk">
<label for="publishActions">Actions: </label>
<label for="publishActions"><%=_Encoded("Actions:") %></label>
<select id="publishActions" name="<%=Html.NameOf(m => m.BulkAction)%>">
<%=Html.SelectOption(Model.BulkAction, TagAdminIndexBulkAction.None, "Choose action...")%>
<%=Html.SelectOption(Model.BulkAction, TagAdminIndexBulkAction.Delete, "Delete")%>
<%=Html.SelectOption(Model.BulkAction, TagAdminIndexBulkAction.None, _Encoded("Choose action...").ToString())%>
<%=Html.SelectOption(Model.BulkAction, TagAdminIndexBulkAction.Delete, _Encoded("Delete").ToString())%>
</select>
<input class="button" type="submit" name="submit" value="Apply" />
<input class="button" type="submit" name="submit.BulkEdit" value="<%=_Encoded("Apply") %>" />
</fieldset>
<div class="manage"><%=Html.ActionLink("Add a tag", "Create", new { }, new { @class = "button" })%></div>
<div class="manage"><%=Html.ActionLink(T("Add a tag").ToString(), "Create", new { }, new { @class = "button" })%></div>
<fieldset>
<table class="items" summary="This is a table of the tags in your application">
<table class="items" summary="<%=_Encoded("This is a table of the tags in your application") %>">
<colgroup>
<col id="Col1" />
<col id="Col2" />
@@ -22,7 +22,7 @@
<thead>
<tr>
<th scope="col">&nbsp;&darr;<%-- todo: (heskew) something more appropriate for "this applies to the bulk actions --%></th>
<th scope="col">Name</th>
<th scope="col"><%=_Encoded("Name")%></th>
<th scope="col"></th>
</tr>
</thead>
@@ -37,14 +37,14 @@
<input type="checkbox" value="true" name="<%=Html.NameOf(m => m.Tags[ti].IsChecked)%>"/>
</td>
<td>
<%=Html.ActionLink(tagEntry.Tag.TagName, "Search", new {id = tagEntry.Tag.Id}) %>
<%=Html.ActionLink(Html.Encode(tagEntry.Tag.TagName), "Search", new {id = tagEntry.Tag.Id}) %>
</td>
<td>
<%=Html.ActionLink("Edit", "Edit", new {id = tagEntry.Tag.Id}) %>
<%=Html.ActionLink(T("Edit").ToString(), "Edit", new {id = tagEntry.Tag.Id}) %>
</td>
</tr>
<% tagIndex++; } %>
</table>
</fieldset>
<div class="manage"><%=Html.ActionLink("Add a tag", "Create", new { }, new { @class = "button" })%></div>
<div class="manage"><%=Html.ActionLink(T("Add a tag").ToString(), "Create", new { }, new { @class = "button" })%></div>
<% } %>

View File

@@ -1,27 +1,22 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<TagsAdminSearchViewModel>" %>
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<TagsAdminSearchViewModel>" %>
<%@ Import Namespace="Orchard.ContentManagement"%>
<%@ Import Namespace="Orchard.Tags.ViewModels"%>
<h2><%=Html.TitleForPage(string.Format("List of contents tagged with {0}", Model.TagName)) %></h2>
<% using(Html.BeginFormAntiForgeryPost()) { %>
<%=Html.ValidationSummary() %>
<fieldset>
<table class="items">
<colgroup>
<col id="Col1" />
<col id="Col2" />
</colgroup>
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Link to the content item</th>
</tr>
</thead>
<% foreach (var contentItem in Model.Contents) { %>
<tr>
<td><%=Html.ItemDisplayText(contentItem)%></td>
<td><%=Html.ItemDisplayLink(contentItem)%></td>
</tr>
<% } %>
</table>
</fieldset>
<% } %>
<h1><%=Html.TitleForPage(T("List of contents tagged with {0}", Model.TagName).ToString()) %></h1>
<table class="items">
<colgroup>
<col id="Col1" />
<col id="Col2" />
</colgroup>
<thead>
<tr>
<th scope="col"><%=_Encoded("Name")%></th>
<th scope="col"><%=_Encoded("Link to the content item")%></th>
</tr>
</thead>
<% foreach (var contentItem in Model.Contents) { %>
<tr>
<td><%=Html.ItemDisplayText(contentItem) %></td>
<td><%=Html.ItemDisplayLink(contentItem) %></td>
</tr>
<% } %>
</table>

View File

@@ -1,7 +1,8 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<HasTags>" %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<HasTags>" %>
<%@ Import Namespace="Orchard.Tags.Models" %>
<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>
<% if (Model.CurrentTags.Count > 0) { %>
<p class="tags">
<span><%=_Encoded("Tags:") %></span>
<%=string.Join(", ", Model.CurrentTags.Select(t => Html.ActionLink(Html.Encode(t.TagName), "Search", "Home", new { area = "Orchard.Tags", tagName = t.TagName }, new { }).ToHtmlString()).ToArray())%>
</p><%
} %>

View File

@@ -1,8 +1,6 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<EditTagsViewModel>" %>
<%@ Import Namespace="Orchard.Tags.ViewModels" %>
<%@ Import Namespace="Orchard.Tags.Models" %>
<%@ Import Namespace="Orchard.Tags.ViewModels"%>
<fieldset>
<%=Html.LabelFor(m=>m.Tags) %>
<%=Html.EditorFor(m=>m.Tags) %>
</fieldset>
<%--<input class="large text" id="Tags" name="Tags" type="text" value="<%=Model.Tags %>" />--%>
<%=Html.LabelFor(m => m.Tags) %>
<%=Html.TextBoxFor(m => m.Tags, new { @class = "large text" })%>
</fieldset>

View File

@@ -1,10 +1,11 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<TagSettingsRecord>" %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<TagSettingsRecord>" %>
<%@ Import Namespace="Orchard.Tags.Models"%>
<h3>Tags</h3>
<ol>
<li>
<%= Html.LabelFor(x=>x.EnableTagsOnPages) %>
<fieldset>
<legend><%=_Encoded("Tags")%></legend>
<div>
<%= Html.EditorFor(x=>x.EnableTagsOnPages) %>
<label class="forcheckbox" for="TagSettings_EnableTagsOnPages">Pages can be tagged</label>
<%= Html.ValidationMessage("EnableTagsOnPages", "*")%>
</li>
</ol>
<span class="hint forcheckbox"><%=_Encoded("In the admin, if the user has permission to.") %></span>
</div>
</fieldset>

View File

@@ -1,10 +1,10 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<TagsIndexViewModel>" %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<TagsIndexViewModel>" %>
<%@ Import Namespace="Orchard.Tags.ViewModels"%>
<h2><%=Html.TitleForPage("Tags")%></h2>
<h1><%=Html.TitleForPage(T("Tags").ToString())%></h1>
<%=Html.UnorderedList(
Model.Tags,
(t, i) => Html.ActionLink(
t.TagName,
Html.Encode(t.TagName),
"Search",
new { tagName = t.TagName },
new { @class = "" /* todo: (heskew) classify according to tag use */ }

View File

@@ -1,5 +1,5 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<TagsSearchViewModel>" %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<TagsSearchViewModel>" %>
<%@ Import Namespace="Orchard.Tags.ViewModels"%>
<% Html.AddTitleParts("Tags", string.Format("Contents tagged with {0}", Model.TagName)); %>
<h2>Contents tagged with <span><%=Html.Encode(Model.TagName) %></span></h2>
<% Html.AddTitleParts(T("Tags").ToString(), T("Contents tagged with {0}", Model.TagName).ToString()); %>
<h1><%=T("Contents tagged with <span>{0}</span>", Html.Encode(Model.TagName)) %></h1>
<%=Html.UnorderedList(Model.Items, (c, i) => Html.DisplayForItem(c).ToHtmlString(), "contentItems") %>

View File

@@ -6,11 +6,11 @@ using Orchard.Mvc.ViewModels;
namespace Orchard.Mvc.Html {
public static class ContentItemExtensions {
public static string ItemDisplayText(this HtmlHelper html, IContent content) {
public static MvcHtmlString ItemDisplayText(this HtmlHelper html, IContent content) {
var metadata = content.ContentItem.ContentManager.GetItemMetadata(content);
if (metadata.DisplayText == null)
return null;
return html.Encode(metadata.DisplayText);
return MvcHtmlString.Create(html.Encode(metadata.DisplayText));
}