Convert index tables to using table builder

This commit is contained in:
BrokenEagle
2020-01-03 06:19:30 +00:00
parent 917ffa87ed
commit 043944e1dd
47 changed files with 1161 additions and 1628 deletions

View File

@@ -1,18 +1,24 @@
<%= tag.table table.html_attributes do %>
<%= tag.table table.table_attributes do %>
<thead>
<tr>
<% table.columns.each do |column| %>
<th><%= column.name %></th>
<%= tag.th column.header_attributes do %>
<% if column.is_html_safe %>
<%= column.name.html_safe %>
<% else %>
<%= column.name %>
<% end %>
<% end %>
<% end %>
</tr>
</thead>
<tbody>
<% table.items.each do |item| %>
<%= tag.tr table.row_attributes(item) do %>
<% table.columns.each do |column| %>
<%= tag.td column.html_attributes do %>
<%= column.value(item) %>
<% table.items.each_with_index do |item, i| %>
<%= tag.tr table.all_row_attributes(item, i) do %>
<% table.columns.each_with_index do |column, j| %>
<%= tag.td column.body_attributes do %>
<%= column.value(item, i, j) %>
<% end %>
<% end %>
<% end %>