Moving the widget and layer delete button into its own (placed) template to drop it in by the save button

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-12-09 14:54:27 -08:00
parent d9cbc99259
commit 0042b49dd7
7 changed files with 19 additions and 12 deletions

View File

@@ -27,8 +27,12 @@ namespace Orchard.Widgets.Drivers {
public Localizer T { get; set; }
protected override DriverResult Editor(LayerPart layerPart, dynamic shapeHelper) {
return ContentShape("Parts_Widgets_LayerPart",
() => shapeHelper.EditorTemplate(TemplateName: "Parts.Widgets.LayerPart", Model: layerPart, Prefix: Prefix));
return Combined(
ContentShape("Parts_Widgets_LayerPart",
() => shapeHelper.EditorTemplate(TemplateName: "Parts.Widgets.LayerPart", Model: layerPart, Prefix: Prefix)),
ContentShape("Widget_DeleteButton",
deleteButton => deleteButton)
);
}
protected override DriverResult Editor(LayerPart layerPart, IUpdateModel updater, dynamic shapeHelper) {

View File

@@ -18,8 +18,12 @@ namespace Orchard.Widgets.Drivers {
widgetPart.AvailableZones = _widgetsService.GetZones();
widgetPart.AvailableLayers = _widgetsService.GetLayers();
return ContentShape("Parts_Widgets_WidgetPart",
() => shapeHelper.EditorTemplate(TemplateName: "Parts.Widgets.WidgetPart", Model: widgetPart, Prefix: Prefix));
return Combined(
ContentShape("Parts_Widgets_WidgetPart",
() => shapeHelper.EditorTemplate(TemplateName: "Parts.Widgets.WidgetPart", Model: widgetPart, Prefix: Prefix)),
ContentShape("Widget_DeleteButton",
deleteButton => deleteButton)
);
}
protected override DriverResult Editor(WidgetPart widgetPart, IUpdateModel updater, dynamic shapeHelper) {

View File

@@ -130,6 +130,9 @@
<Content Include="Views\EditorTemplates\Parts.Widgets.LayerPart.cshtml" />
<Content Include="Views\EditorTemplates\Parts.Widgets.WidgetPart.cshtml" />
</ItemGroup>
<ItemGroup>
<None Include="Views\Widget.DeleteButton.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

@@ -1,4 +1,5 @@
<Placement>
<Place Widget_DeleteButton="Sidebar:25"/>
<Place Parts_Widgets_LayerPart="Content:1"/>
<Place Parts_Widgets_WidgetPart="Content:1"/>
<Place Parts_Widgets_WidegetBagPart="Content:5"/>

View File

@@ -2,8 +2,4 @@
@using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()
@Display(Model)
<fieldset>
<button type="submit" name="submit.Delete" value="@T("Delete")">@T("Delete")</button>
</fieldset>
}

View File

@@ -2,8 +2,4 @@
@using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()
@Display(Model)
<fieldset>
<button type="submit" name="submit.Delete" value="@T("Delete")">@T("Delete")</button>
</fieldset>
}

View File

@@ -0,0 +1,3 @@
<fieldset class="delete-button">
<button type="submit" name="submit.Delete" value="@T("Delete")">@T("Delete")</button>
</fieldset>