Sha256: 51ac27421e069af07e4adf46330eb5dae7eca5ec6d3ea12f747a24029aa4a024

Contents?: true

Size: 1.48 KB

Versions: 31

Compression:

Stored size: 1.48 KB

Contents

<% unless @only_chart %>
  <%= render partial: "caching" %>
  <p class="text-muted" style="margin-bottom: 10px;">
    <%= pluralize(@rows.size, "cohort") %>
  </p>
<% end %>
<% if @rows.any? %>
  <div class="results-container">
    <table class="table results-table">
      <thead>
        <tr>
          <th style="min-width: 100px;">Cohort</th>
          <% 12.times do |i| %>
            <th style="width: 7.5%; text-align: right;"><%= @conversion_period.titleize %> <%= i + 1 %></th>
          <% end %>
        </tr>
      </thead>
      <tbody>
        <% @rows.each do |row| %>
          <tr>
            <td>
              <%= row[0] %>
              <div style="font-size: 12px; color: #999;"><%= row[1] == 1 ? "1 user" : "#{number_with_delimiter(row[1])} users" %></div>
            </td>
            <% 12.times do |i| %>
              <td style="text-align: right;">
                <% num = row[i + 2] %>
                <% if num %>
                  <% denom = row[1] %>
                  <% if denom > 0 %>
                    <%= (100.0 * num / denom).round %>%
                  <% else %>
                    -
                  <% end %>
                  <div style="font-size: 12px; color: #999;"><%= number_with_delimiter(num) %></div>
                <% else %>
                  -
                <% end %>
              </td>
            <% end %>
          </tr>
        <% end %>
      </tbody>
    </table>
  </div>
<% elsif @only_chart %>
  <p class="text-muted">No cohorts</p>
<% end %>

Version data entries

31 entries across 31 versions & 3 rubygems

Version Path
blazer-3.2.0 app/views/blazer/queries/_cohorts.html.erb
blazer-3.1.0 app/views/blazer/queries/_cohorts.html.erb
blazer-3.0.4 app/views/blazer/queries/_cohorts.html.erb
blazer_xlsx-3.0.8 app/views/blazer/queries/_cohorts.html.erb
blazer_xlsx-3.0.7 app/views/blazer/queries/_cohorts.html.erb
blazer_xlsx-3.0.6 app/views/blazer/queries/_cohorts.html.erb
blazer_xlsx-3.0.5 app/views/blazer/queries/_cohorts.html.erb
blazer-3.0.3 app/views/blazer/queries/_cohorts.html.erb
blazer-3.0.2 app/views/blazer/queries/_cohorts.html.erb
finery-3.0.3 app/views/blazer/queries/_cohorts.html.erb
finery-3.0.2 app/views/blazer/queries/_cohorts.html.erb
blazer-3.0.1 app/views/blazer/queries/_cohorts.html.erb
finery-3.0.1 app/views/blazer/queries/_cohorts.html.erb
finery-3.0.0 app/views/blazer/queries/_cohorts.html.erb
blazer-3.0.0 app/views/blazer/queries/_cohorts.html.erb
blazer-2.6.5 app/views/blazer/queries/_cohorts.html.erb
blazer-2.6.4 app/views/blazer/queries/_cohorts.html.erb
blazer-2.6.3 app/views/blazer/queries/_cohorts.html.erb
blazer-2.6.2 app/views/blazer/queries/_cohorts.html.erb
blazer-2.6.1 app/views/blazer/queries/_cohorts.html.erb