Sha256: 07e504bfdf98c125fe6adbba429405f19c5470221575e6adb72d3ada26fbe68d

Contents?: true

Size: 1.83 KB

Versions: 29

Compression:

Stored size: 1.83 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
- 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 }
- 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

29 entries across 29 versions & 1 rubygems

Version Path
cm-admin-1.5.40 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.5.39 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.5.38 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.5.37 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.5.36 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.5.35 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.5.34 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.5.33 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.5.32 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.5.31 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.5.30 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.5.29 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.5.28 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.5.10 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.5.27 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.5.26 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.5.25 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.5.23 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.5.22 app/views/layouts/_custom_action_modals.html.slim
cm-admin-1.5.21 app/views/layouts/_custom_action_modals.html.slim