mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
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:
@@ -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) {
|
||||
|
@@ -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) {
|
||||
|
@@ -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.
|
||||
|
@@ -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"/>
|
||||
|
@@ -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>
|
||||
}
|
@@ -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>
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
<fieldset class="delete-button">
|
||||
<button type="submit" name="submit.Delete" value="@T("Delete")">@T("Delete")</button>
|
||||
</fieldset>
|
Reference in New Issue
Block a user