Sha256: 2b32be677497380bafac9735f6f222760cc6d51ca9b85dbbb4fea634fc8d38da

Contents?: true

Size: 1.57 KB

Versions: 39

Compression:

Stored size: 1.57 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 = @ar_object ? available_actions(@model, @ar_object, 'destroy') : nil

div[data-behaviour="custom-action-modal-container"]

- 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 }

- 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 }

- elsif @current_action&.action_type == :custom && @associated_ar_object&.data.present?
  - @associated_ar_object.data.each do |ar_object|
    - custom_action_with_modals.select{|custom_action| custom_action.model_name == @current_action.child_records.to_s.classify}.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

39 entries across 39 versions & 1 rubygems

Version Path
cm-admin-2.4.6 app/views/layouts/_custom_action_modals.html.slim
cm-admin-2.4.5 app/views/layouts/_custom_action_modals.html.slim
cm-admin-2.4.4 app/views/layouts/_custom_action_modals.html.slim
cm-admin-2.4.3 app/views/layouts/_custom_action_modals.html.slim
cm-admin-2.4.2 app/views/layouts/_custom_action_modals.html.slim
cm-admin-2.4.1 app/views/layouts/_custom_action_modals.html.slim
cm-admin-2.4.0 app/views/layouts/_custom_action_modals.html.slim
cm-admin-2.3.4 app/views/layouts/_custom_action_modals.html.slim
cm-admin-2.3.3 app/views/layouts/_custom_action_modals.html.slim
cm-admin-2.3.2 app/views/layouts/_custom_action_modals.html.slim
cm-admin-2.3.1 app/views/layouts/_custom_action_modals.html.slim
cm-admin-2.3.0 app/views/layouts/_custom_action_modals.html.slim
cm-admin-2.2.1 app/views/layouts/_custom_action_modals.html.slim
cm-admin-2.2.0 app/views/layouts/_custom_action_modals.html.slim
cm-admin-2.1.5 app/views/layouts/_custom_action_modals.html.slim
cm-admin-2.1.4 app/views/layouts/_custom_action_modals.html.slim
cm-admin-2.1.3 app/views/layouts/_custom_action_modals.html.slim
cm-admin-2.1.2 app/views/layouts/_custom_action_modals.html.slim
cm-admin-2.1.1 app/views/layouts/_custom_action_modals.html.slim
cm-admin-2.1.0 app/views/layouts/_custom_action_modals.html.slim