Sha256: 6fc47e790f7cc67316c66d9f53ea824017f8070e7a0eaa2239ae17f1b1d81334

Contents?: true

Size: 1.02 KB

Versions: 71

Compression:

Stored size: 1.02 KB

Contents

<% if available_view_types.count > 1 %>
  <%
    info = {
      table: {
        new_view_type: 'table',
        new_icon: 'table-view-type',
        translation_key: 'avo.table_view',
      },
      grid: {
        new_view_type: 'grid',
        new_icon: 'grid-view-type',
        translation_key: 'avo.grid_view',
      },
    }
  %>
  <div class="flex">
    <div class="button-group">
      <% available_view_types.each do |type| %>
        <% is_active_view = view_type.to_s == type.to_s %>

        <%= a_link url_for(params.permit!.merge(view_type: type)).to_s,
          icon: info[type][:new_icon],
          color: is_active_view ? :primary : :gray,
          rounded: false,
          size: :sm,
          class: is_active_view ? "z-20" : "bg-gray-100 border-gray-300",
          title: t('avo.switch_to_view', view_type: type),
          data: {
            tippy: 'tooltip',
            'turbo-frame': turbo_frame,
            control: "view-type-toggle-#{type}"
          }
        %>
      <% end %>
    </div>
  </div>
<% end %>

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
avo-3.0.0.pre8 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.0.0.pre7 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.0.0.pre5 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.0.0.pre6 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.0.0.pre4 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.0.0.pre3 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.0.0.pre2 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.0.0.pre1 app/views/avo/partials/_view_toggle_button.html.erb
avo-2.30.1 app/views/avo/partials/_view_toggle_button.html.erb
avo-2.30.0 app/views/avo/partials/_view_toggle_button.html.erb
avo-2.29.1 app/views/avo/partials/_view_toggle_button.html.erb
avo-2.29.1.pre.pr1652 app/views/avo/partials/_view_toggle_button.html.erb
avo-2.29.0 app/views/avo/partials/_view_toggle_button.html.erb
avo-2.28.3.pre.pr1646 app/views/avo/partials/_view_toggle_button.html.erb
avo-2.28.2.pre.pr1642 app/views/avo/partials/_view_toggle_button.html.erb
avo-2.28.1.pre.pr1642 app/views/avo/partials/_view_toggle_button.html.erb
avo-2.28.0 app/views/avo/partials/_view_toggle_button.html.erb
avo-2.27.2.pre.pr1606 app/views/avo/partials/_view_toggle_button.html.erb
avo-2.27.1 app/views/avo/partials/_view_toggle_button.html.erb
avo-2.27.0 app/views/avo/partials/_view_toggle_button.html.erb