pub struct BulkActionSpec {
pub resource: &'static str,
pub key: &'static str,
pub label: &'static str,
pub icon: &'static str,
pub danger: bool,
pub confirm_message: &'static str,
pub action_url: &'static str,
}Expand description
Plugin-contributed bulk action declaration.
Each spec targets a specific listing resource (e.g. "cms_page",
"cms_snippet", "cms_media"). The framework renders the button
on every matching listing’s bulk bar; clicking it POSTs the
selected ids to action_url. Hosts wire that route themselves —
the hook stays decoupled from the request lifecycle so plugins
don’t need to interact with the framework’s tenancy / session
extractors.
The existing per-handler bulk_actions() shape on
crate::library::LibraryTypeHandler keeps working unchanged;
this hook provides an additional, cross-listing extension point
for plugins that want to contribute actions without owning a
page-type or library-type handler.
Fields§
§resource: &'static strResource slug — "cms_page", "cms_snippet", "cms_media",
"cms_redirect", etc. Listings filter by this.
key: &'static strStable identifier (used for dedup + the POST body’s action
key).
label: &'static strDisplay label rendered in the bulk-bar dropdown.
icon: &'static strMaterial-symbols icon name.
danger: boolWhen true, the button renders in the danger style + the confirm modal is shown before submit.
confirm_message: &'static strConfirmation message shown via the existing data-confirm
modal. Empty means no confirm step.
action_url: &'static strURL the form POSTs to. The framework appends the selected
ids as ids=<id>&ids=<id>… and the spec’s key as
action=<key>. Host wires the route to receive that shape.
Trait Implementations§
Source§impl Clone for BulkActionSpec
impl Clone for BulkActionSpec
impl Collect for BulkActionSpec
impl Copy for BulkActionSpec
Auto Trait Implementations§
impl Forget for BulkActionSpec
impl Freeze for BulkActionSpec
impl RefUnwindSafe for BulkActionSpec
impl Send for BulkActionSpec
impl Sync for BulkActionSpec
impl Unpin for BulkActionSpec
impl UnsafeUnpin for BulkActionSpec
impl UnwindSafe for BulkActionSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more