web/app/views/index/_compare_table.html.erb
author Marcel Hlopko <marcel.hlopko@gmail.com>
Sun, 23 Jun 2013 11:22:20 +0200
changeset 91 d430a8ac253d
child 92 c61f1cae722c
permissions -rw-r--r--
comparison page kinda works

<% make_chart = true if local_assigns[:make_chart].nil? %>
<div >
  <div class="<%= make_chart ? "line-chart flot time-chart" : "" %>">
    <table class="table table-condensed">
      <thead>
        <tr>
          <th>Měsíc</th>
          <% impls.each do |impl| %> 
            <th><%= impl.name %></th>
          <% end %>
        </tr>
      </thead>
      <tbody>
        <% all_dates_when_performed(impls).each do |date| %>
          <tr>
            <%= content_tag :th, 
              (make_chart ? date_to_millis(date) : t(date)), 
              'data-timestamp' => date_to_millis(date) %>
            <% impls.each do |impl| %>
              td><%= impl.results_of(benchmark_info, date).try(:min_duration) %></td>
            <% end %>
          </tr>
        <% end %>
      </tbody>
    </table>
  </div>
</div>