Sha256: 32f306b3f294bb93f32a33634bf2c532225d38d48546e63883701c978b84b58e

Contents?: true

Size: 1.3 KB

Versions: 9

Compression:

Stored size: 1.3 KB

Contents

- custom_action_with_modals = @model.available_actions.select{ |act| act if act.display_type == :modal && act.action_type == :custom }
- bulk_action_with_modals = @model.available_actions.select{ |act| act if act.display_type == :modal && act.action_type == :bulk_action }
- destroy_action = available_actions(@model, @ar_object, 'destroy')
- if @associated_model
  - custom_action_with_modals += @associated_model.available_actions.select{ |act| act if act.display_type == :modal }
- if @current_action&.name == 'index'
  - bulk_action_with_modals.each do |bulk_action|
    = render partial: '/layouts/custom_action_modal', locals: { custom_action: bulk_action, ar_object: nil }
  - @ar_object.data.each do |ar_object|
    - custom_action_with_modals.each do |custom_action|
      = render partial: '/layouts/custom_action_modal', locals: { custom_action: custom_action, ar_object: ar_object }
    - if destroy_action
      = render partial: '/layouts/destroy_action_modal', locals: { ar_object: ar_object }
- elsif @current_action&.name == 'show'
  - custom_action_with_modals.each do |custom_action|
    = render partial: '/layouts/custom_action_modal', locals: { custom_action: custom_action, ar_object: @ar_object }
  - if destroy_action
      = render partial: '/layouts/destroy_action_modal', locals: { ar_object: @ar_object }

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
cm-admin-1.4.0 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.3.9 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.3.8 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.3.7 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.3.6 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.3.5 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.3.4 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.3.3 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.3.2 app/views/layouts/_custom_action_modals.html.slim