Sha256: 785181fd94b8ae04c6c8c7dc93842655c822aa2691a9133255ffe47e3f05e8ae

Contents?: true

Size: 1.68 KB

Versions: 2

Compression:

Stored size: 1.68 KB

Contents

-# = dropdown(variation: :dropleft, btn_class: btn_class) do
-#   - authorized_resource_actions(resource, for_action: action_name).select{ |x| x.show_in_datatable }.each do |a|
-#     - path = a.path_helper.is_a?(Proc) ? a.path_helper.call(resource) : send(a.path_helper, resource.id)
-#     - data = a.turbo_frame.present? ? { turbo: true, turbo_frame: a.turbo_frame } : {}
-#     = dropdown_link_to resource_form_action_label(resource, a.sym), path, data: data
- actions = authorized_resource_actions(resource, for_action: action_name).select{ |x| x.show_in_datatable }
- crud_actions = actions.select{ |a| a.crud_action }
- non_crud_actions = actions.select{ |a| !a.crud_action }
.btn-group
  - if non_crud_actions.size.positive?
    .btn-group
      %button.btn.btn-sm.dropdown-toggle{ type: :button, data: { toggle: 'dropdown' }}
      %ul.dropdown-menu
        - non_crud_actions.each do |a|
          - path = a.path_helper.is_a?(Proc) ? a.path_helper.call(resource) : send(a.path_helper, resource.id)
          - data = a.turbo_frame.present? ? { turbo: true, turbo_frame: a.turbo_frame } : {}
          %li
            = dropdown_link_to resource_form_action_label(resource, a.sym), path, data: data, method: a.verb
  - crud_actions.each do |a|
    - path = a.path_helper.is_a?(Proc) ? a.path_helper.call(resource) : send(a.path_helper, resource.id)
    - icon_class = (a.verb == :delete ? '' : '')
    = link_to path, a.args_hash(title: resource_form_action_label(resource, a.sym), class: "btn btn-sm #{icon_class}") do
      %i{ class: resource_form_action_icon(resource, a.sym), style: 'display: block; font-size: 10px' }
      %span{ style: 'font-size: 12px' }= resource_form_action_label(resource, a.sym)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
five-two-nw-olivander-0.2.0.2 app/views/effective/resource/_actions_dropleft.html.haml
five-two-nw-olivander-0.2.0.1 app/views/effective/resource/_actions_dropleft.html.haml