Sha256: b6f5f7ca455a1fc6bf820c9fc01c2efd8a3d672209bbbb79ec5260d4872b0674

Contents?: true

Size: 1.13 KB

Versions: 8

Compression:

Stored size: 1.13 KB

Contents

<%
row_classes = table.row_classes if !defined?(row_classes) || row_classes.nil?
table_class = table.options[:table_class].to_s if !defined?(table_class) || table_class.nil?
%>
<%= content_tag(:h4, table_name) %>
<div class='list_container'>
<%= content_tag(:table, :class => "table table-condensed #{table_class}") do %>
  <% unless @report[:table_header] == false %>
    <%= content_tag(:thead, content_tag(:tr, table.to_a.shift.map { |h| html_cell(h, tag: :th, inline_css: table.options[:inline_css])}.join.html_safe ) ) %>
  <% end %>
  <tbody>
    <% table.to_a.each_with_index do |row, i|
      style = nil
      if table[:inline_css] && row_classes[i]
        color = nil
        row_classes[i].split(/\s+/).each do |token|
          if color = meta_report_color(token)
            break
          end
        end
        style = "background-color: ##{color}"
        #TODO: handle bold, alignment
      end
      %>
      <%= content_tag(:tr, class: row_classes[i], style: style) do
        row.each do |cell|
          %><%= html_cell(cell, inline_css: table.options[:inline_css]) %><%
        end
      end %>
    <% end %>
  </tbody>
<% end %>
</div>

Version data entries

8 entries across 4 versions & 1 rubygems

Version Path
meta_reports-0.1.3 app/views/meta_reports/_default_table.html.erb
meta_reports-0.1.3 spec/dummy/app/views/meta_reports/_default_table.html.erb
meta_reports-0.1.2 app/views/meta_reports/_default_table.html.erb
meta_reports-0.1.2 spec/dummy/app/views/meta_reports/_default_table.html.erb
meta_reports-0.1.1 app/views/meta_reports/_default_table.html.erb
meta_reports-0.1.1 spec/dummy/app/views/meta_reports/_default_table.html.erb
meta_reports-0.1.0 app/views/meta_reports/_default_table.html.erb
meta_reports-0.1.0 spec/dummy/app/views/meta_reports/_default_table.html.erb