Sha256: de7962e1b39ba0e55f031706d76133e8adbbfd9e78f7108c8486094c85b7d92b

Contents?: true

Size: 1.24 KB

Versions: 82

Compression:

Stored size: 1.24 KB

Contents

<% if available_view_types.count > 1 %>
  <%
    info = {
      table: {
        new_view_type: 'table',
        new_icon: "avo/table-view-type",
        translation_key: 'avo.table_view',
      },
      grid: {
        new_view_type: 'grid',
        new_icon: "avo/grid-view-type",
        translation_key: 'avo.grid_view',
      },
      list: {
        new_view_type: 'list',
        new_icon: 'queue-list',
      },
      map: {
        new_view_type: 'map',
        new_icon: "avo/map-view-type",
        translation_key: 'avo.map_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

82 entries across 82 versions & 1 rubygems

Version Path
avo-3.18.1.tw4 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.18.1 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.18.0.tw4 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.18.0 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.17.9.beta2 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.17.9.beta1 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.17.9.tw4 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.17.9 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.17.8.tw4 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.17.8 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.17.7 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.17.6.tw4 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.17.6 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.17.5 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.17.4 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.17.3 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.17.5.tw4 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.17.4.tw4 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.17.3.tw4 app/views/avo/partials/_view_toggle_button.html.erb
avo-3.17.2.tw4 app/views/avo/partials/_view_toggle_button.html.erb