mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace Orchard.Layouts.Helpers {
|
||||
public static class MetaDataExtensions {
|
||||
public static ContentPartDefinitionBuilder Placable(this ContentPartDefinitionBuilder builder, bool placable = true) {
|
||||
return builder.WithSetting("ContentPartLayoutSettings.Placable", placable.ToString());
|
||||
public static ContentPartDefinitionBuilder Placeable(this ContentPartDefinitionBuilder builder, bool placeable = true) {
|
||||
return builder.WithSetting("ContentPartLayoutSettings.Placeable", placeable.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -45,10 +45,10 @@ namespace Orchard.Layouts {
|
||||
.WithSetting("Stereotype", "Widget")
|
||||
.DisplayedAs("Layout Widget"));
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("BodyPart", part => part.Placable());
|
||||
ContentDefinitionManager.AlterPartDefinition("TitlePart", part => part.Placable());
|
||||
ContentDefinitionManager.AlterPartDefinition("CommonPart", part => part.Placable());
|
||||
ContentDefinitionManager.AlterPartDefinition("TagsPart", part => part.Placable());
|
||||
ContentDefinitionManager.AlterPartDefinition("BodyPart", part => part.Placeable());
|
||||
ContentDefinitionManager.AlterPartDefinition("TitlePart", part => part.Placeable());
|
||||
ContentDefinitionManager.AlterPartDefinition("CommonPart", part => part.Placeable());
|
||||
ContentDefinitionManager.AlterPartDefinition("TagsPart", part => part.Placeable());
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("ElementWrapperPart", part => part
|
||||
.Attachable()
|
||||
|
@@ -57,7 +57,7 @@ namespace Orchard.Layouts.Providers {
|
||||
? contentTypeDefinition.Parts.Select(x => x.PartDefinition)
|
||||
: _contentDefinitionManager.Value.ListPartDefinitions();
|
||||
|
||||
return parts.Where(p => p.Settings.GetModel<ContentPartLayoutSettings>().Placable);
|
||||
return parts.Where(p => p.Settings.GetModel<ContentPartLayoutSettings>().Placeable);
|
||||
}
|
||||
|
||||
private void Displaying(ElementDisplayContext context) {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
(function ($) {
|
||||
var placable = $("input[name=\"ContentPartLayoutSettings.Placable\"]");
|
||||
var placeable = $("input[name=\"ContentPartLayoutSettings.Placeable\"]");
|
||||
|
||||
$(placable).on("change", function (e) {
|
||||
$(placeable).on("change", function (e) {
|
||||
syncEnableEditorInput();
|
||||
});
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
|
||||
var syncEnableEditorInput = function () {
|
||||
var enableEditorDialog = $("input[name=\"ContentPartLayoutSettings.EnableEditorDialog\"]");
|
||||
var isPlacable = placable.is(":checked");
|
||||
var isPlaceable = placeable.is(":checked");
|
||||
|
||||
enableEditorDialog.prop("disabled", !isPlacable);
|
||||
enableEditorDialog.prop("disabled", !isPlaceable);
|
||||
};
|
||||
|
||||
})(jQuery);
|
@@ -1,8 +1,8 @@
|
||||
namespace Orchard.Layouts.Settings {
|
||||
public class ContentPartLayoutSettings {
|
||||
/// <summary>
|
||||
/// This setting is used to configure a part to be placable on a layout.
|
||||
/// This setting is used to configure a part to be placeable on a layout.
|
||||
/// </summary>
|
||||
public bool Placable { get; set; }
|
||||
public bool Placeable { get; set; }
|
||||
}
|
||||
}
|
@@ -17,7 +17,7 @@ namespace Orchard.Layouts.Settings {
|
||||
public override IEnumerable<TemplateViewModel> PartEditorUpdate(ContentPartDefinitionBuilder builder, IUpdateModel updateModel) {
|
||||
var model = new ContentPartLayoutSettings();
|
||||
updateModel.TryUpdateModel(model, "ContentPartLayoutSettings", null, null);
|
||||
builder.Placable(model.Placable);
|
||||
builder.Placeable(model.Placeable);
|
||||
yield return DefinitionTemplate(model);
|
||||
}
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@
|
||||
Script.Include("contentpart-layouts-settings.js");
|
||||
}
|
||||
<fieldset>
|
||||
@Html.CheckBoxFor(m => m.Placable)
|
||||
<label for="@Html.FieldIdFor(m => m.Placable)" class="forcheckbox">@T("Placable")</label>
|
||||
<span class="hint">@T("Check to allow this part to be placable on a layout.")</span>
|
||||
@Html.CheckBoxFor(m => m.Placeable)
|
||||
<label for="@Html.FieldIdFor(m => m.Placeable)" class="forcheckbox">@T("Placeable")</label>
|
||||
<span class="hint">@T("Check to allow this part to be placeable on a layout.")</span>
|
||||
</fieldset>
|
Reference in New Issue
Block a user