Module: Adminterface::Extensions::Views::TableActions
- Defined in:
- lib/adminterface/extensions/views/index_as_table.rb
Instance Method Summary collapse
- #confirm?(options) ⇒ Boolean
- #confirm_dialog_config ⇒ Object
- #default_class_name ⇒ Object
- #item(*args) ⇒ Object
Instance Method Details
#confirm?(options) ⇒ Boolean
39 40 41 |
# File 'lib/adminterface/extensions/views/index_as_table.rb', line 39 def confirm?() .dig(:data, :confirm).present? end |
#confirm_dialog_config ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/adminterface/extensions/views/index_as_table.rb', line 43 def confirm_dialog_config { buttons: { confirm: { text: I18n.t(:confirm, scope: "active_admin.confirm_dialog"), class: confirm_dialog_css_classes[:confirm] }, cancel: { text: I18n.t(:cancel, scope: "active_admin.confirm_dialog"), class: confirm_dialog_css_classes[:cancel] } } } end |
#default_class_name ⇒ Object
28 29 30 |
# File 'lib/adminterface/extensions/views/index_as_table.rb', line 28 def default_class_name "#{super} #{index_as_table_css_classes.dig(:actions, :buttons, :group)}".squish end |
#item(*args) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/adminterface/extensions/views/index_as_table.rb', line 32 def item(*args) = args. [:class] = "#{options[:class]} #{index_as_table_css_classes.dig(:actions, :buttons, :item)}".squish ["data-aa-confirm-dialog"] = confirm_dialog_config.to_json if confirm?() text_node link_to(*args, ) end |