Module: RubyCms::Admin::BulkActionTableHelper
- Defined in:
- app/helpers/ruby_cms/admin/bulk_action_table_helper.rb
Instance Method Summary collapse
-
#bulk_action_button(name:, label:, url:, confirm: nil, action_type: nil, class: nil) ⇒ Hash
Build bulk action button configuration hash.
-
#render_admin_page(title:, subtitle: nil, actions: nil, breadcrumbs: nil, padding: true, overflow: true, turbo_frame: nil, turbo_frame_options: nil) ⇒ String
Render an admin page with consistent layout.
-
#render_bulk_action_table(headers:, turbo_frame: "admin_table_content", pagination: nil, pagination_path: nil, bulk_actions_url: nil, bulk_action_buttons: [], item_name: "item", controller_name: "ruby-cms--bulk-action-table", &block) ⇒ String
Render a complete bulk action table using Phlex components.
Instance Method Details
#bulk_action_button(name:, label:, url:, confirm: nil, action_type: nil, class: nil) ⇒ Hash
Build bulk action button configuration hash
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'app/helpers/ruby_cms/admin/bulk_action_table_helper.rb', line 140 def ( name:, label:, url:, confirm: nil, action_type: nil, class: nil ) { name: name, label: label, url: url, confirm: confirm, action_type: action_type, class: binding.local_variable_get(:class) }.compact end |
#render_admin_page(title:, subtitle: nil, actions: nil, breadcrumbs: nil, padding: true, overflow: true, turbo_frame: nil, turbo_frame_options: nil) ⇒ String
Render an admin page with consistent layout
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'app/helpers/ruby_cms/admin/bulk_action_table_helper.rb', line 99 def render_admin_page( title:, subtitle: nil, actions: nil, breadcrumbs: nil, padding: true, overflow: true, turbo_frame: nil, turbo_frame_options: nil ) render RubyCms::Admin::AdminPage.new( title:, subtitle:, actions:, breadcrumbs:, padding:, overflow:, turbo_frame:, turbo_frame_options: ) do yield if block_given? end end |
#render_bulk_action_table(headers:, turbo_frame: "admin_table_content", pagination: nil, pagination_path: nil, bulk_actions_url: nil, bulk_action_buttons: [], item_name: "item", controller_name: "ruby-cms--bulk-action-table", &block) ⇒ String
Render a complete bulk action table using Phlex components
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'app/helpers/ruby_cms/admin/bulk_action_table_helper.rb', line 43 def render_bulk_action_table( headers:, turbo_frame: "admin_table_content", pagination: nil, pagination_path: nil, bulk_actions_url: nil, bulk_action_buttons: [], item_name: "item", controller_name: "ruby-cms--bulk-action-table", &block ) render RubyCms::Admin::BulkActionTable::BulkActionTable.new( turbo_frame: turbo_frame, pagination: pagination, pagination_path: pagination_path, bulk_actions_url: bulk_actions_url, bulk_actions_buttons: , item_name: item_name, controller_name: controller_name, csrf_token: form_authenticity_token ) do render RubyCms::Admin::BulkActionTable::BulkActionTableHeader.new( headers: headers, bulk_actions_enabled: bulk_actions_url.present? || .any?, controller_name: controller_name ) render RubyCms::Admin::BulkActionTable::BulkActionTableBody.new(&block) end end |