Use bootstrap table striping to replace hand-cycled table stripes

This cuts down on the complexity of having to use the `cycle` function
and makes the templates easier to read. CSS-based striping has been
around for many years.

The CSS is in order to keep our custom colour for striped tables.
This commit is contained in:
Andy Allan 2020-03-18 11:27:36 +01:00
parent b0c50ab344
commit 5fdada204c
9 changed files with 22 additions and 33 deletions

View file

@ -1,6 +1,5 @@
<tr>
<% cl = cycle("table0", "table1") %>
<td class="<%= cl %>">
<td>
<% if Settings.status != "gpx_offline" %>
<% if trace.inserted %>
<a href="<%= url_for :controller => "traces", :action => "show", :id => trace.id, :display_name => trace.user.display_name %>"><img src="<%= url_for :controller => "traces", :action => "icon", :id => trace.id, :display_name => trace.user.display_name %>" border="0" alt="" /></a>
@ -9,7 +8,7 @@
<% end %>
<% end %>
</td>
<td class="<%= cl %>"><%= link_to trace.name, :controller => "traces", :action => "show", :display_name => trace.user.display_name, :id => trace.id %>
<td><%= link_to trace.name, :controller => "traces", :action => "show", :display_name => trace.user.display_name, :id => trace.id %>
<span class="trace_summary" title="<%= trace.timestamp %>"> ...
<% if trace.inserted %>
(<%= t ".count_points", :count => trace.size %>)

View file

@ -25,7 +25,7 @@
<% if @traces.size > 0 %>
<%= render :partial => "trace_paging_nav" %>
<table id="trace_list" cellpadding="3">
<table id="trace_list" class="table table-borderless table-striped">
<thead>
<tr>
<th></th>