mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#18732 Attachable Part setting
--HG-- branch : 1.x extra : transplant_source : z%CC%A9%29%2As%DE%D5%0B%3BVZq%80%F5Yn%DF%07%E8
This commit is contained in:
@@ -140,6 +140,9 @@
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Admin\EditPlacement.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\DefinitionTemplates\ContentPartSettings.cshtml" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
@@ -36,5 +36,19 @@ namespace Orchard.ContentTypes.Settings {
|
||||
|
||||
yield return DefinitionTemplate(model);
|
||||
}
|
||||
|
||||
public override IEnumerable<TemplateViewModel> PartEditor(ContentPartDefinition definition)
|
||||
{
|
||||
var model = definition.Settings.GetModel<ContentPartSettings>();
|
||||
yield return DefinitionTemplate(model);
|
||||
}
|
||||
|
||||
public override IEnumerable<TemplateViewModel> PartEditorUpdate(ContentPartDefinitionBuilder builder, IUpdateModel updateModel)
|
||||
{
|
||||
var model = new ContentPartSettings();
|
||||
updateModel.TryUpdateModel(model, "ContentPartSettings", null, null);
|
||||
builder.WithSetting("ContentPartSettings.Attachable", model.Attachable.ToString());
|
||||
yield return DefinitionTemplate(model);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
@model Orchard.Core.Contents.Settings.ContentPartSettings
|
||||
|
||||
<fieldset>
|
||||
@Html.EditorFor(m => m.Attachable)
|
||||
<label for="@Html.FieldIdFor(m => m.Attachable)" class="forcheckbox">@T("Attachable")</label>
|
||||
@Html.ValidationMessageFor(m => m.Attachable)
|
||||
</fieldset>
|
Reference in New Issue
Block a user