Class: RubyCms::Admin::BulkActionTable::BulkActionTableHeader

Inherits:
RubyCms::Admin::BaseComponent show all
Defined in:
app/components/ruby_cms/admin/bulk_action_table/bulk_action_table_header.rb

Overview

Table header component Renders <thead> with column headers and optional select-all checkbox

Instance Method Summary collapse

Methods inherited from RubyCms::Admin::BaseComponent

#build_classes, #conditional_attributes, #controller, #form_authenticity_token, #helpers, #merge_data_attributes, #token_from_controller, #token_from_controller?, #token_from_helpers?

Constructor Details

#initialize(headers: [], bulk_actions_enabled: true, controller_name: "ruby-cms--bulk-action-table") ⇒ BulkActionTableHeader

Returns a new instance of BulkActionTableHeader.



13
14
15
16
17
18
19
20
21
22
# File 'app/components/ruby_cms/admin/bulk_action_table/bulk_action_table_header.rb', line 13

def initialize(
  headers: [],
  bulk_actions_enabled: true,
  controller_name: "ruby-cms--bulk-action-table"
)
  super
  @headers = headers
  @bulk_actions_enabled = bulk_actions_enabled
  @controller_name = controller_name
end

Instance Method Details

#view_templateObject



24
25
26
27
28
29
30
31
# File 'app/components/ruby_cms/admin/bulk_action_table/bulk_action_table_header.rb', line 24

def view_template
  thead(class: "sticky top-0 z-20 bg-muted/40 [&_tr]:border-b [&_tr]:border-border/60") do
    tr do
      render_bulk_checkbox_header
      render_table_headers
    end
  end
end