mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
A little more cleanup for the content type/part edit UI
--HG-- branch : dev
This commit is contained in:
@@ -3,13 +3,15 @@
|
||||
}
|
||||
fieldset.location-setting legend {
|
||||
font-weight:normal;
|
||||
margin:0;
|
||||
padding-bottom:0;
|
||||
}
|
||||
fieldset.location-setting label {
|
||||
display:inline;
|
||||
}
|
||||
fieldset.location-setting input {
|
||||
fieldset.location-setting input.text-box {
|
||||
display:block;
|
||||
width:20em;
|
||||
width:24em;
|
||||
}
|
||||
fieldset.location-setting fieldset {
|
||||
clear:none;
|
||||
|
@@ -10,7 +10,7 @@
|
||||
margin-top:-3.1em;
|
||||
}
|
||||
.manage-part {
|
||||
margin-bottom:2em;
|
||||
margin-bottom:1em;
|
||||
}
|
||||
.manage-part h3,
|
||||
.manage-field h3 {
|
||||
@@ -23,8 +23,8 @@
|
||||
.manage-part h3,
|
||||
.manage-field h3,
|
||||
.manage-part h4,
|
||||
.manage-type .manage-field .details,
|
||||
.manage-type .manage-part .manage-field,
|
||||
.manage-type .manage-field fieldset,
|
||||
.manage-type .manage-part .settings {
|
||||
padding-left:20px;
|
||||
}
|
||||
@@ -46,6 +46,7 @@
|
||||
font-size:1.4em;
|
||||
margin-top:-2.4em;
|
||||
}
|
||||
.manage-field .details,
|
||||
.manage-part .details {
|
||||
overflow:auto;
|
||||
}
|
||||
@@ -56,6 +57,7 @@
|
||||
.manage-field label {
|
||||
font-weight:normal;
|
||||
}
|
||||
.manage-field fieldset,
|
||||
.manage-part fieldset {
|
||||
margin:.5em 0 1em;
|
||||
padding:0;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Orchard.ContentManagement.MetaData.Models;
|
||||
using Orchard.ContentManagement.ViewModels;
|
||||
@@ -31,7 +32,7 @@ namespace Orchard.ContentTypes.ViewModels {
|
||||
public ContentTypeDefinition _Definition { get; private set; }
|
||||
|
||||
private IEnumerable<EditPartFieldViewModel> GetTypeFields(ContentTypeDefinition contentTypeDefinition) {
|
||||
var implicitTypePart = contentTypeDefinition.Parts.SingleOrDefault(p => p.PartDefinition.Name == Name);
|
||||
var implicitTypePart = contentTypeDefinition.Parts.SingleOrDefault(p => string.Equals(p.PartDefinition.Name, Name, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
return implicitTypePart == null
|
||||
? Enumerable.Empty<EditPartFieldViewModel>()
|
||||
@@ -40,7 +41,7 @@ namespace Orchard.ContentTypes.ViewModels {
|
||||
|
||||
private IEnumerable<EditTypePartViewModel> GetTypeParts(ContentTypeDefinition contentTypeDefinition) {
|
||||
return contentTypeDefinition.Parts
|
||||
.Where(p => p.PartDefinition.Name != Name)
|
||||
.Where(p => !string.Equals(p.PartDefinition.Name, Name, StringComparison.OrdinalIgnoreCase))
|
||||
.Select((p, i) => new EditTypePartViewModel(i, p) { Type = this });
|
||||
}
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@ using (Html.BeginFormAntiForgeryPost()) { %>
|
||||
using (this.Capture("end-of-page-scripts")) { %>
|
||||
<script type="text/javascript">
|
||||
(function ($) {
|
||||
$(".manage-part h3").expandoControl(function (controller) { return controller.nextAll(".details"); }, { collapse: true, remember: false });
|
||||
$(".manage-field h3,.manage-part h3").expandoControl(function (controller) { return controller.nextAll(".details"); }, { collapse: true, remember: false });
|
||||
$(".manage-field h4").expandoControl(function (controller) { return controller.nextAll(".settings"); }, { collapse: true, remember: false });
|
||||
})(jQuery);
|
||||
</script><%
|
||||
|
@@ -3,9 +3,11 @@
|
||||
<h3><%:Model.Name %> <span>(<%:Model.FieldDefinition.Name %>)</span></h3>
|
||||
<div class="manage">
|
||||
<%:Html.ActionLink(T("Remove").Text, "RemoveFieldFrom", new { area = "Orchard.ContentTypes", id = Model.Part.Name, Model.Name }, new { itemprop = "RemoveUrl UnsafeUrl" })%><%--// <- some experimentation--%>
|
||||
</div><%
|
||||
Html.RenderTemplates(Model.Templates);
|
||||
%><%:Html.HiddenFor(m => m.Name)
|
||||
%><%:Html.HiddenFor(m => m.FieldDefinition.Name)
|
||||
%><%:Html.HiddenFor(m => m.Index) %>
|
||||
</div>
|
||||
<div class="details"><%
|
||||
Html.RenderTemplates(Model.Templates);
|
||||
%><%:Html.HiddenFor(m => m.Name)
|
||||
%><%:Html.HiddenFor(m => m.FieldDefinition.Name)
|
||||
%><%:Html.HiddenFor(m => m.Index) %>
|
||||
</div>
|
||||
</fieldset>
|
Reference in New Issue
Block a user