#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:
John@LENOVO_S20.lan
2012-06-05 22:45:57 +12:00
parent 88c0ae5d43
commit c790165c6e
3 changed files with 24 additions and 0 deletions

View File

@@ -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.

View File

@@ -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);
}
}
}

View File

@@ -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>