Skip to content

#8565: Delete and Unpublish buttons in backoffice content edit#8566

Merged
BenedekFarkas merged 19 commits intoOrchardCMS:1.10.xfrom
LaserSrl:8565_DeleteUnpublishButtons
Jun 13, 2025
Merged

#8565: Delete and Unpublish buttons in backoffice content edit#8566
BenedekFarkas merged 19 commits intoOrchardCMS:1.10.xfrom
LaserSrl:8565_DeleteUnpublishButtons

Conversation

@AndreaPiovanelli
Copy link
Copy Markdown
Contributor

@AndreaPiovanelli AndreaPiovanelli commented Jun 10, 2022

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.

return EditPOST(id, returnUrl, contentItem => _contentManager.Publish(contentItem));
}

[HttpPost, ActionName("Edit")]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this different that the other unpublish/delete actions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/Orchard.Web/Core/Contents/Drivers/ContentsDriver.cs Outdated
Comment thread src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj Outdated
@AndreaPiovanelli
Copy link
Copy Markdown
Contributor Author

@sebastienros fixed as requested.

Comment thread src/Orchard.Web/Core/Contents/Drivers/ContentsDriver.cs Outdated
Comment thread src/Orchard.Web/Core/Contents/Drivers/ContentsDriver.cs
@AndreaPiovanelli
Copy link
Copy Markdown
Contributor Author

Modified the code following Sebastien's remarks.

@BenedekFarkas BenedekFarkas linked an issue Apr 16, 2024 that may be closed by this pull request
Copy link
Copy Markdown
Member

@BenedekFarkas BenedekFarkas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. BlogPost, Page, etc., when Draftable is enabled (default configuration) - too much space
    image
  2. BlogPost, when Draftable is disabled - spacing missing:
    image

EDIT: These spacing problems are addressed by my suggestions below.

Comment thread src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogPostAdminController.cs Outdated
Comment thread src/Orchard.Web/Core/Contents/Views/Content.DeleteButton.cshtml Outdated
Comment thread src/Orchard.Web/Core/Contents/Views/Content.UnpublishButton.cshtml Outdated
Comment thread src/Orchard.Web/Modules/Orchard.Widgets/Drivers/WidgetPartDriver.cs Outdated
Comment thread src/Orchard.Web/Core/Contents/Views/Content.UnpublishButton.cshtml Outdated
Comment thread src/Orchard.Web/Core/Contents/Drivers/ContentsDriver.cs Outdated
@BenedekFarkas BenedekFarkas changed the title Delete and Unpublish buttons in backoffice content edit #8565: Delete and Unpublish buttons in backoffice content edit Apr 18, 2024
@MatteoPiovanelli MatteoPiovanelli force-pushed the 8565_DeleteUnpublishButtons branch from e2d564e to 18a7f37 Compare May 16, 2024 07:58
@MatteoPiovanelli
Copy link
Copy Markdown
Contributor

rebased on 1.10.x and applied some of @BenedekFarkas suggestions

@BenedekFarkas
Copy link
Copy Markdown
Member

Sorry for replying just now, I'll be able to review later towards the end of September (after Harvest).

Comment thread src/Orchard.Web/Core/Contents/Views/Content.DeleteButton.cshtml Outdated
Comment thread src/Orchard.Web/Core/Contents/Views/Content.UnpublishButton.cshtml Outdated
Comment thread src/Orchard.Web/Modules/Orchard.Widgets/Drivers/WidgetPartDriver.cs Outdated
Comment thread src/Orchard.Web/Core/Contents/Views/Content.UnpublishButton.cshtml
Comment thread src/Orchard.Web/Core/Contents/Drivers/ContentsDriver.cs Outdated
Comment thread src/Orchard.Web/Core/Contents/Placement.info Outdated
Comment thread src/Orchard.Web/Themes/TheAdmin/Styles/site.css Outdated
Comment thread src/Orchard.Web/Themes/TheAdmin/Styles/site.css
Comment thread src/Orchard.Web/Modules/Orchard.Widgets/Drivers/WidgetPartDriver.cs Outdated
@BenedekFarkas
Copy link
Copy Markdown
Member

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

@AndreaPiovanelli
Copy link
Copy Markdown
Contributor Author

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

@BenedekFarkas
Copy link
Copy Markdown
Member

@AndreaPiovanelli so are you working on this? Let me know if it's ready for review.

@AndreaPiovanelli
Copy link
Copy Markdown
Contributor Author

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

Comment thread src/Orchard.Web/Modules/Orchard.Widgets/Drivers/LayerPartDriver.cs
Copy link
Copy Markdown
Member

@BenedekFarkas BenedekFarkas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor changes suggested, otherwise LGTM!

Comment thread src/Orchard.Web/Themes/TheAdmin/Styles/site.css Outdated
Comment thread src/Orchard.Web/Themes/TheAdmin/Styles/site.css Outdated
@AndreaPiovanelli
Copy link
Copy Markdown
Contributor Author

After merging 1.10.x again inside the branch and applying the style corrections suggested by @BenedekFarkas , looks good imho:
image

@BenedekFarkas
Copy link
Copy Markdown
Member

Yup yup, that's exactly what it should look like!

@BenedekFarkas BenedekFarkas merged commit b14c295 into OrchardCMS:1.10.x Jun 13, 2025
3 checks passed
@AndreaPiovanelli AndreaPiovanelli deleted the 8565_DeleteUnpublishButtons branch June 13, 2025 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unpublish and Delete buttons in backoffice content edit page

5 participants