Sha256: 51a25b3b2d220aabe8ecf918a447a1511c1357f548dafc1436506b16958c1eae

Contents?: true

Size: 1.84 KB

Versions: 12

Compression:

Stored size: 1.84 KB

Contents

<p>
  <%= link_to root_path do %>
    &laquo; Experiments
  <% end %>
</p>

<h1><%= @experiment.name %></h1>

<% if @experiment.description %>
  <p class="description"><%= @experiment.description %></p>
<% end %>

<table>
  <thead>
    <tr>
      <th>Participant</th>
      <th style="width: 20%;">Variant</th>
      <th style="width: 20%;">Converted</th>
      <th style="width: 20%;">Started</th>
    </tr>
  </thead>
  <tbody>
    <% @memberships.each do |membership| %>
      <tr>
        <td><%= field_test_participant_link(membership) %></td>
        <td><%= membership.variant %></td>
        <td>
          <% converted = false %>
          <% @experiment.goals.each do |goal| %>
            <% if @events[[membership.id, goal]] %>
              <% converted = true %>
              <div>
                <span class="check">✓</span>
                <% if @experiment.multiple_goals? %>
                  <%= goal.titleize %>
                <% end %>
              </div>
            <% end %>
          <% end %>

          <% if !converted && membership.try(:converted) %>
            <span class="check">✓</span>
          <% end %>
        </td>
        <td>
          <% if membership.created_at > 1.day.ago %>
            <%= time_ago_in_words(membership.created_at, include_seconds: true) %> ago
          <% else %>
            <%= membership.created_at.to_formatted_s(:short) %>
          <% end %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

<p class="pagination">
  <% unless @page == 1 %>
    <%= link_to experiment_path(@experiment.id, page: @page - 1) do %>
      &laquo; Prev
    <% end %>
  <% end %>
  <!-- there may not be a next page, but don't want another DB query -->
  <% if @memberships.size == @per_page %>
    <%= link_to experiment_path(@experiment.id, page: @page + 1) do %>
      Next &raquo;
    <% end %>
  <% end %>
</p>

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
field_test-0.6.0 app/views/field_test/experiments/show.html.erb
field_test-0.5.5 app/views/field_test/experiments/show.html.erb
field_test-0.5.4 app/views/field_test/experiments/show.html.erb
field_test-0.5.3 app/views/field_test/experiments/show.html.erb
field_test-0.5.2 app/views/field_test/experiments/show.html.erb
field_test-0.5.1 app/views/field_test/experiments/show.html.erb
field_test-0.5.0 app/views/field_test/experiments/show.html.erb
field_test-0.4.1 app/views/field_test/experiments/show.html.erb
field_test-0.4.0 app/views/field_test/experiments/show.html.erb
field_test-0.3.2 app/views/field_test/experiments/show.html.erb
field_test-0.3.1 app/views/field_test/experiments/show.html.erb
field_test-0.3.0 app/views/field_test/experiments/show.html.erb