Sha256: 95c77da3c3506477cd4ffec48085f5c2b97b9d2e75d9aca60842f37081c27fee

Contents?: true

Size: 1.12 KB

Versions: 17

Compression:

Stored size: 1.12 KB

Contents

<%
  return unless ([:cols, :cols_data, :rows, :rows_data] - component[:attributes].keys).empty?
  columns = component[:attributes][:cols].map { |colUid|
    colData = component[:attributes][:cols_data][colUid.to_sym] || {}
    { uid: colUid, searchable_text: colData[:searchable_text] }
  }

  rows = component[:attributes][:rows].map { |rowUid|
    rowData = component[:attributes][:rows_data][rowUid.to_sym] || {}
    { uid: rowUid, data: rowData }
  }
%>

<div id="component-<%= component[:id] %>" class="<%= promethee_class_for(component) %>">
  <div class="table-responsive">
    <table class="table">
      <thead>
        <tr>
          <% columns.each do |col| %>
            <th><%= col[:searchable_text] %></th>
          <% end %>
        </tr>
      </thead>
      <tbody>
        <% rows.each do |row| %>
          <tr>
            <% columns.each do |col| %>
              <%
                cell = row[:data][col[:uid].to_sym]
                next if cell.nil?
              %>
              <td><%= cell[:searchable_text] %></td>
            <% end %>
          </tr>
        <% end %>
      </tbody>
    </table>
  </div>
</div>

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
promethee-3.0.2 app/views/promethee/components/table/_show.html.erb
promethee-3.0.1 app/views/promethee/components/table/_show.html.erb
promethee-3.0.0 app/views/promethee/components/table/_show.html.erb
promethee-2.1.3 app/views/promethee/components/table/_show.html.erb
promethee-2.1.2 app/views/promethee/components/table/_show.html.erb
promethee-2.1.1 app/views/promethee/components/table/_show.html.erb
promethee-2.1.0 app/views/promethee/components/table/_show.html.erb
promethee-2.0.9 app/views/promethee/components/table/_show.html.erb
promethee-2.0.8 app/views/promethee/components/table/_show.html.erb
promethee-2.0.7 app/views/promethee/components/table/_show.html.erb
promethee-2.0.6 app/views/promethee/components/table/_show.html.erb
promethee-2.0.5 app/views/promethee/components/table/_show.html.erb
promethee-2.0.4 app/views/promethee/components/table/_show.html.erb
promethee-2.0.3 app/views/promethee/components/table/_show.html.erb
promethee-2.0.2 app/views/promethee/components/table/_show.html.erb
promethee-2.0.1 app/views/promethee/components/table/_show.html.erb
promethee-2.0.0 app/views/promethee/components/table/_show.html.erb