Sha256: d59780a36a02b5f8fc2b64ad8def999565e12155f4b9cdf45a668f1a34f0f62e

Contents?: true

Size: 1.11 KB

Versions: 7

Compression:

Stored size: 1.11 KB

Contents

<%
  items_per_line = component[:attributes].dig(:items_per_line, :value)
  case items_per_line
  when 6
    col_classes = "col-md-2 col-sm-4 col-xs-6 col-6"
  when 4
    col_classes = "col-md-3 col-xs-6 col-6"
  when 3
    col_classes = "col-md-4"
  when 2
    col_classes = "col-md-6"
  end
%>

<div  class="<%= promethee_class_for component %>"
      id="<%= promethee_id_for component %>">
  <div class="row promethee__component__row">
    <% component[:children].each.with_index do |child, n| %>
      <div class="<%= col_classes %>">
        <%= render 'promethee/show/component', component: child %>
      </div>
      <% if n%items_per_line === items_per_line - 1 %>
        <div class="clearfix hidden-sm hidden-xs d-none d-md-block"></div>
      <% end %>
      <% if items_per_line >= 4 && n.odd? %>
        <div class="clearfix visible-xs-block d-block <%= items_per_line === 4 ? 'visible-sm-block d-md-none' : 'd-sm-none' %>"></div>
      <% end %>
      <% if items_per_line == 6 && n%3 == 2 %>
        <div class="clearfix visible-sm-block .d-none .d-sm-block .d-md-none"></div>
      <% end %>
    <% end %>
  </div>
</div>

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
promethee-5.1.1 app/views/promethee/components/collection/_show.html.erb
promethee-5.1.0 app/views/promethee/components/collection/_show.html.erb
promethee-5.0.2 app/views/promethee/components/collection/_show.html.erb
promethee-5.0.1 app/views/promethee/components/collection/_show.html.erb
promethee-5.0.0 app/views/promethee/components/collection/_show.html.erb
promethee-4.1.28 app/views/promethee/components/collection/_show.html.erb
promethee-4.1.27 app/views/promethee/components/collection/_show.html.erb