From 289ade85bfaa95b47e262373bed0df9a9b3f11a7 Mon Sep 17 00:00:00 2001 From: Nathan Heskew Date: Wed, 23 Jun 2010 12:18:07 -0700 Subject: [PATCH] Displaying and editing content part fields (in edit type UI) --HG-- branch : dev --- .../Core/Contents/Styles/admin.css | 33 +++++++++++++++++-- .../Contents/Views/EditorTemplates/Field.ascx | 7 ++-- .../Views/EditorTemplates/Part.Field.ascx | 20 ++++------- .../Views/EditorTemplates/Part.Fields.ascx | 6 ++-- .../Views/EditorTemplates/Settings.ascx | 3 +- .../Themes/TheAdmin/Styles/site.css | 3 +- 6 files changed, 46 insertions(+), 26 deletions(-) diff --git a/src/Orchard.Web/Core/Contents/Styles/admin.css b/src/Orchard.Web/Core/Contents/Styles/admin.css index 5a898fa4e..ba113a16e 100644 --- a/src/Orchard.Web/Core/Contents/Styles/admin.css +++ b/src/Orchard.Web/Core/Contents/Styles/admin.css @@ -5,13 +5,42 @@ margin-top:-4em; } -.manage-part h3 { +.manage-part h3, +.manage-field h3 { border-bottom:1px solid #EAEAEA; } -.manage-part .manage { +.manage-part .manage, +.manage-field .manage { font-size:1.4em; margin-top:-2.4em; } .manage-part .manage.minor { margin-top:-1.7em; +} +.manage-part label, +.manage-field label { + font-weight:normal; +} + +/* should pull this back into the base admin theme css, w/out the .manage-part of course */ +.manage-part dl { + margin:0 0 1em; + overflow:auto; + padding:6px 0 0; +} +.manage-part dt { + font-weight:bold; +} +.manage-part dl dl { + font-size:1em; + margin:0; + padding:0; +} +.manage-part dd dt { + clear:left; + float:left; +} +.manage-part dd dd { + float:left; + padding-left:.5em; } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/EditorTemplates/Field.ascx b/src/Orchard.Web/Core/Contents/Views/EditorTemplates/Field.ascx index 522d9ee91..4ca058cba 100644 --- a/src/Orchard.Web/Core/Contents/Views/EditorTemplates/Field.ascx +++ b/src/Orchard.Web/Core/Contents/Views/EditorTemplates/Field.ascx @@ -1,9 +1,8 @@ <%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> <%@ Import Namespace="Orchard.Core.Contents.ViewModels" %> -
-

<%:Model.Name %>

-

<%:Model.FieldDefinition.Name %>

-
+
+

<%:Model.Name %> (<%:Model.FieldDefinition.Name %>)

+
<%--// these inline forms can't be here. should probably have some JavaScript in here to build up the forms and add the "remove" link. // get the antiforgery token from the edit type form and mark up the part in a semantic way so I can get some info from the DOM --%> <%:Html.Link("[remove]", "#forshowonlyandnotintendedtowork!") %> diff --git a/src/Orchard.Web/Core/Contents/Views/EditorTemplates/Part.Field.ascx b/src/Orchard.Web/Core/Contents/Views/EditorTemplates/Part.Field.ascx index 24ad5a714..08660099b 100644 --- a/src/Orchard.Web/Core/Contents/Views/EditorTemplates/Part.Field.ascx +++ b/src/Orchard.Web/Core/Contents/Views/EditorTemplates/Part.Field.ascx @@ -1,14 +1,6 @@ -<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> -<%@ Import Namespace="Orchard.ContentManagement.MetaData.Models" %> -
-

<%:Model.FieldDefinition.Name %>

-
- <%--// these inline forms can't be here. should probably have some JavaScript in here to build up the forms and add the "remove" link. - // get the antiforgery token from the edit type form and mark up the part in a semantic way so I can get some info from the DOM --%> - <%:Html.Link("[remove]", "#forshowonlyandnotintendedtowork!") %> -<%-- <% using (Html.BeginFormAntiForgeryPost(Url.Action("RemovePart", new { area = "Contents" }), FormMethod.Post, new {@class = "inline link"})) { %> - <%=Html.Hidden("name", Model.PartDefinition.Name, new { id = "" }) %> - - <% } %> --%> -
-
\ No newline at end of file +<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> +<%@ Import Namespace="Orchard.Core.Contents.ViewModels" %> +
<%:Model.Name %> (<%:Model.FieldDefinition.Name %>)
+
+ <%:Html.DisplayFor(m => m.Settings, "Settings", "") %> +
\ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/EditorTemplates/Part.Fields.ascx b/src/Orchard.Web/Core/Contents/Views/EditorTemplates/Part.Fields.ascx index 131951c4f..c93ce4f70 100644 --- a/src/Orchard.Web/Core/Contents/Views/EditorTemplates/Part.Fields.ascx +++ b/src/Orchard.Web/Core/Contents/Views/EditorTemplates/Part.Fields.ascx @@ -1,10 +1,10 @@ <%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl>" %> <%@ Import Namespace="Orchard.Core.Contents.ViewModels" %><% if (Model.Any()) { %> -
<% +
<% foreach (var field in Model) { var f = field; %> - <%:Html.EditorFor(m => f, "Part.Fields") %><% + <%:Html.EditorFor(m => f, "Part.Field") %><% } %> -
<% + <% } %> \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/EditorTemplates/Settings.ascx b/src/Orchard.Web/Core/Contents/Views/EditorTemplates/Settings.ascx index 240add0b6..5a0f59533 100644 --- a/src/Orchard.Web/Core/Contents/Views/EditorTemplates/Settings.ascx +++ b/src/Orchard.Web/Core/Contents/Views/EditorTemplates/Settings.ascx @@ -1,8 +1,7 @@ <%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> <%@ import Namespace="Orchard.ContentManagement.MetaData.Models" %><% if (Model.Any()) { %> -
- <%:T("[Settings]") %><% +
<% var si = 0; foreach (var setting in Model) { var s = setting; diff --git a/src/Orchard.Web/Themes/TheAdmin/Styles/site.css b/src/Orchard.Web/Themes/TheAdmin/Styles/site.css index 6cf84f249..a106bbd64 100644 --- a/src/Orchard.Web/Themes/TheAdmin/Styles/site.css +++ b/src/Orchard.Web/Themes/TheAdmin/Styles/site.css @@ -147,10 +147,11 @@ h1 { font-size:2.6em; } /* 26px */ h2 { font-size:2.1em; } /* 21px */ h2 span { font-size:.57em; } /* 12px */ h3 { font-size:1.8em; } /* 18px */ +h3 span { font-size:.667em; } /* 12px */ h4 { font-size:1.6em; } /* 16px */ h5 { font-size:1.4em; } /* 14px */ -h6, p, label, /*input, select,*/ .button, +h6, p, dl, label, /*input, select,*/ .button, .message, .validation-summary-errors, table.items th, table.items td, table.items caption { font-size:1.4em; line-height:1.4em; } /* 14px */ table.items p, table.items label, table.items input, table.items .button { font-size:1em; line-height:1em; }