#8565: Delete and Unpublish buttons in backoffice content edit#8566
#8565: Delete and Unpublish buttons in backoffice content edit#8566BenedekFarkas merged 19 commits intoOrchardCMS:1.10.xfrom
Conversation
| return EditPOST(id, returnUrl, contentItem => _contentManager.Publish(contentItem)); | ||
| } | ||
|
|
||
| [HttpPost, ActionName("Edit")] |
There was a problem hiding this comment.
Why is this different that the other unpublish/delete actions?
There was a problem hiding this comment.
I added delete and unpublish actions referencing specific submits to the controller. There already were unpublish and delete actions (the ones called from the lists), so I called those inside the new actions, specific to the edit form.
|
@sebastienros fixed as requested. |
|
Modified the code following Sebastien's remarks. |
There was a problem hiding this comment.
I really like the consolidation for the delete button! Please merge from 1.10.x.
However I'm unsure about adding the Unpublish button in the editor - is that really necessary UX-wise? I feel like it get can get a bit too crowded in the action button row.
Some of the editors I checked have minor styling issues under different circumstances, but some of those might be independent of this PR:
- BlogPost, Page, etc., when Draftable is enabled (default configuration) - too much space

- BlogPost, when Draftable is disabled - spacing missing:

EDIT: These spacing problems are addressed by my suggestions below.
Managed unpublish and delete button for blogs and widgets.
Condition for delete button visibility now checks for contentItem.Id > 0 instead of IsNew() function
…hape and avoid its duplication or confusing management via Placement.info.
Added comments to clarify how new Unpublish and Delete actions work.
…d checked the content is published before showing the unpublish button.
e2d564e to
18a7f37
Compare
|
rebased on 1.10.x and applied some of @BenedekFarkas suggestions |
|
Sorry for replying just now, I'll be able to review later towards the end of September (after Harvest). |
|
@AndreaPiovanelli please let me know if you want to keep working on this PR until next week, otherwise I'll finish this in a new PR using the changes from here. |
Since it's a very old request from a customer that never went online, we are not working on it anymore. |
…UnpublishButtons # Conflicts: # src/Orchard.Web/Core/Orchard.Core.csproj
|
@AndreaPiovanelli so are you working on this? Let me know if it's ready for review. |
I was addressing the refactoring and changes you requested and merging the latest 1.10.x to the pr branch. It should be done, now. |
BenedekFarkas
left a comment
There was a problem hiding this comment.
Minor changes suggested, otherwise LGTM!
|
After merging 1.10.x again inside the branch and applying the style corrections suggested by @BenedekFarkas , looks good imho: |
|
Yup yup, that's exactly what it should look like! |

Fixes #8565
Added unpublish and delete buttons to backoffice content edit view.
Adapted Orchard.Blogs and Orchard.Widgets to be in line with the patch, adding a "unpublish-button" css class too (it is identical to "publish-button".
Regarding Orchard.Widgets, I removed previous delete button (Widget_DeleteButton shape, Widget.DeleteButton.cshtml) because it was now redundant and conflicted with the Core/Contents... button (not a terrible conflict, but both were displayed and editing the Placement.info turned to be a unreliable solution).
Modified / added actions to controllers when needed.