From bd9b5f04f4978d66381ed8d20f3d94b594513cdc Mon Sep 17 00:00:00 2001 From: cryptogopher Date: Tue, 19 Jan 2021 11:27:02 +0100 Subject: [PATCH] Restore Redmine default table header --- app/views/targets/_index.html.erb | 12 ++++++++---- assets/stylesheets/body_tracking.css | 16 +++------------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/app/views/targets/_index.html.erb b/app/views/targets/_index.html.erb index 5c667de..3477220 100644 --- a/app/views/targets/_index.html.erb +++ b/app/views/targets/_index.html.erb @@ -15,12 +15,15 @@ <% header.each_with_index do |row, i| %> <% if i == 0 %> - <%= l(:field_effective_from) %> <% end %> <% row.each do |q, span| %> - + <% row_classes << 'quantity' unless i == header.length-1 %> + <% row_classes << 'empty' unless span %> + <%= "colspan=#{span}" if span && span > 0 %> <%= "rowspan=#{-span}" if span && span < 0 %> style="width: <%= (span && span > 0 ? span : 1) * 100/total_width %>%;" @@ -30,8 +33,9 @@ <% end %> <% if i == 0 %> - <%= l(:field_action) %> + + <%= l(:field_action) %> + <% end %> <% end %> diff --git a/assets/stylesheets/body_tracking.css b/assets/stylesheets/body_tracking.css index c372512..4178621 100644 --- a/assets/stylesheets/body_tracking.css +++ b/assets/stylesheets/body_tracking.css @@ -4,22 +4,12 @@ table.list tr.food.hidden {opacity: 0.4} table.list .date, table.list .name, -table.list .quantity {text-align: left;} +table.list td.quantity {text-align: left;} /* TODO: merge with .closable and/or remove .closable */ /* TODO: replace .quantityhead(empty) with th.quantity/.empty */ -table.list .quantityhead, table.list th.quantity { - text-align: center; - position: relative; - padding: 2px 0; - border-bottom: none; -} +table.list .quantityhead {border-bottom: none;} table.list .quantityheadempty {border-top: none; border-bottom: none;} -table.list th.quantity { - text-align: center; - position: relative; - padding: 2px 0; - border-bottom: none; -} +table.list th.quantity {border-bottom: none;} table.list th.empty {border-top: none;} table.list .action,