fix table, again

git-svn-id: https://dev.finn.de/svn/cockpit/branches/reporting_merge@1352 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
rkh 15 years ago
parent 41ae8577b7
commit c8851a0333
  1. 10
      app/views/cost_reports/_cost_report_table.rhtml

@ -15,7 +15,7 @@
subrows
end
walker.for_empty_cell { "<td>&nbsp;</td>" }
walker.for_empty_cell { "<td>&nbsp;#{":)" if params[:debug]}</td>" }
walker.for_cell do |result|
"<td>#{number_to_currency result.real_costs}#{"," << result.fields.inspect if params[:debug]}</td>"
@ -25,11 +25,11 @@
<table style="text-align: center; border-collapse: collapse" border="1">
<% walker.headers do |list, first, first_in_col, last_in_col| %>
<%= '<tr>' if first_in_col %>
<%= "<td rowspan='#{query.depth_of(:column)}' colspan='#{query.depth_of(:row) - 1}'></td>" if first %>
<%= "<td rowspan='#{query.depth_of(:column) + 1}' colspan='#{query.depth_of(:row) - 1}'></td>" if first %>
<% list.each do |column| %>
<td colspan="<%= column.final_number(:column) %>"><%= show_row column %></td>
<% end %>
<%= "<td rowspan='#{@query.depth_of(:column)}' colspan='#{query.depth_of(:row) - 1}'></td>" if first %>
<%= "<td rowspan='#{@query.depth_of(:column) + 1}' colspan='#{query.depth_of(:row) - 1}'></td>" if first %>
<%= '</tr>' if last_in_col %>
<% end %>
@ -40,12 +40,12 @@
<% walker.headers(:reverse) do |list, final, first_in_col, last_in_col| %>
<% first = list.first.final_column? %>
<%= '<tr>' if first_in_col %>
<%= "<td rowspan='#{query.depth_of(:column)}' colspan='#{query.depth_of(:row) - 1}'></td>" if first && first_in_col %>
<%= "<td rowspan='#{query.depth_of(:column) + 1}' colspan='#{query.depth_of(:row) - 1}'></td>" if first && first_in_col %>
<% list.each do |column| %>
<td colspan="<%= column.final_number(:column) %>"><%= number_to_currency column.real_costs %></td>
<% end %>
<% if first && last_in_col %>
<%= "<td rowspan='#{query.depth_of(:column)}' colspan='#{query.depth_of(:row) - 1}'>#{number_to_currency query.real_costs}</td>" %>
<%= "<td rowspan='#{query.depth_of(:column) + 1}' colspan='#{query.depth_of(:row) - 1}'>#{number_to_currency query.real_costs}</td>" %>
<% end %>
<%= '</tr>' if last_in_col %>
<% end %>

Loading…
Cancel
Save