master
 1<nav class="level">
 2  <div class="level-left">
 3    <div class="level-item">
 4      <%= search_form %>
 5    </div>
 6    <div class="level-item">
 7      <p class="subtitle is-5">
 8        <strong><%= @gyms.total_count %></strong> gyms
 9      </p>
10    </div>
11  </div>
12</nav>
13
14<table class="table">
15  <thead>
16  <tr>
17    <th>Name</th>
18    <th>Address</th>
19    <th></th>
20  </tr>
21  </thead>
22  <tbody>
23  <% @gyms.each do |gym| %>
24    <tr>
25      <td><%= gym.new_record? ? gym.name : link_to(gym.name, gym_path(gym)) %></td>
26      <td>
27        <%= gym.full_address %>
28        <%= link_to gym.map_url do %>
29          <i class="fa fa-map-marker" aria-hidden="true"></i>
30        <% end %>
31      </td>
32      <td>
33        <% if gym.new_record? && !gym.duplicate? %>
34          <%= form_for(gym) do |form| %>
35            <%= form.hidden_field :name %>
36            <%= form.hidden_field :yelp_id %>
37            <%= form.fields_for :location do |location_form| %>
38              <%= location_form.hidden_field :address %>
39              <%= location_form.hidden_field :city %>
40              <%= location_form.hidden_field :region %>
41              <%= location_form.hidden_field :country %>
42              <%= location_form.hidden_field :postal_code %>
43            <% end %>
44            <%= form.submit t(:add), class: "button tiny" %>
45          <% end %>
46        <% end %>
47      </td>
48    </tr>
49  <% end %>
50  </tbody>
51</table>
52<%= paginate @gyms, remote: true %>