Sha256: 7ec4a5a1bece75d1468146c21313661a6eee836304f3b8d1f7113fc2ea070b71

Contents?: true

Size: 1.74 KB

Versions: 1

Compression:

Stored size: 1.74 KB

Contents

<div class="relative flex flex-col w-full sm:w-auto z-40 js-actions-dropdown"
  data-controller="toggle-panel actions-picker"
  data-actions-picker-enabled-class="text-black hover:bg-blue-500 hover:text-white"
  data-actions-picker-disabled-class="cursor-wait text-gray-500"
>
  <%= a_button style: :primary,
    class: "focus:outline-none",
    icon: 'arrow-circle-right',
    icon_class: 'transform rotate-90',
    'data-action': "click->toggle-panel#togglePanel",
    'data-actions-dropdown-button': @resource.model_key do %>
    <%= t 'avo.actions' %>
  <% end %>
  <div
    class="absolute flex inset-auto right-0 top-full bg-white w-full sm:w-auto sm:min-w-[300px] mt-2 z-20 shadow-modal rounded overflow-hidden hidden"
    data-toggle-panel-target="panel"
  >
    <div class="w-full space divide-y">
      <% @actions.each_with_index do |action, index| %>
        <%
          path = action_name == 'show' ?
            "#{@resource.record_path}/actions/#{action.param_id}" :
            "#{@resource.records_path}/actions/#{action.param_id}"
          if action_name == 'show' || action.standalone
            disabled = false
          else
            disabled = true
          end
        %>
        <%= link_to path,
          data: {
            'turbo-frame': 'actions_show',
            'action': 'click->actions-picker#visitAction',
            'actions-picker-target': action.standalone ? 'standaloneAction' : 'resourceAction',
            'disabled': disabled,
          },
          class: "flex items-center px-4 py-4 w-full font-medium #{disabled ? 'text-gray-500' : 'text-black hover:bg-blue-500 hover:text-white'}" do %>
          <%= svg 'play', class: 'h-5 mr-1 inline' %> <%= action.action_name %>
        <% end %>
      <% end %>
    </div>
  </div>
</div>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
avo-2.0.0 app/components/avo/actions_component.html.erb