Commit b531c05

mo khan <mo@mokhan.ca>
2017-02-18 22:47:58
tidy up gym pages.
1 parent c616e98
Changed files (2)
app/views/gyms/new.html.erb
@@ -2,38 +2,33 @@
   <%= t(".title") %>
 <% end %>
 
-<div class="row">
+<div class="container">
   <div class="columns">
-    <h1><%= t(:search) %></h1>
-    <%= form_tag gyms_path(source: 'yelp'), method: :get, remote: true do %>
-      <%= hidden_field_tag :city, current_session.location.try(:city) %>
-      <% ["gyms", "stadiumsarenas"].each do |category| %>
-        <%= hidden_field_tag 'categories[]', category %>
+    <div class="column is-12">
+      <h1 class="title"><%= t(".title") %></h1>
+      <%= form_for(@gym) do |form| %>
+        <%= form.label :name, class: 'label' %>
+        <%= form.text_field :name, class: 'input' %>
+        <%= form.fields_for :location do |location_form| %>
+          <%= location_form.label :address, class: 'label' %>
+          <%= location_form.text_field :address, class: 'input' %>
+          <%= location_form.label :city, class: 'label' %>
+          <%= location_form.text_field :city, class: 'input' %>
+          <%= location_form.label :region, class: 'label' %>
+          <%= location_form.text_field :region, class: 'input' %>
+          <%= location_form.label :country, class: 'label' %>
+          <p class="control">
+            <span class+'select is-large'>
+              <%= location_form.select :country, @countries %>
+            </span>
+          </p>
+          <%= location_form.label :postal_code, class: 'label' %>
+          <%= location_form.text_field :postal_code, class: 'input' %>
+        <% end %>
+        <p class="control">
+          <%= form.submit t(:save), class: 'button is-primary is-fullwidth' %>
+        </p>
       <% end %>
-      <%= hidden_field_tag :per_page, 10 %>
-      <%= hidden_field_tag :source, 'yelp' %>
-      <%= search_field_tag :q, params[:q], placeholder: t(:search) %>
-      <%= submit_tag t(:search), class: "button" %>
-    <% end %>
-    <div id="results"></div>
-
-    <h1><%= t(".title") %></h1>
-    <%= form_for(@gym) do |form| %>
-      <%= form.label :name %>
-      <%= form.text_field :name %>
-      <%= form.fields_for :location do |location_form| %>
-        <%= location_form.label :address %>
-        <%= location_form.text_field :address %>
-        <%= location_form.label :city %>
-        <%= location_form.text_field :city %>
-        <%= location_form.label :region %>
-        <%= location_form.text_field :region %>
-        <%= location_form.label :country %>
-        <%= location_form.select :country, @countries %>
-        <%= location_form.label :postal_code %>
-        <%= location_form.text_field :postal_code %>
-      <% end %>
-      <%= form.submit t(:save), class: 'button' %>
-    <% end %>
+    </div>
   </div>
 </div>
app/views/gyms/show.html.erb
@@ -1,25 +1,27 @@
-<div class="row">
+<div class="container">
   <div class="columns">
-    <h1><%= @gym.name %></h1>
-    <p>
-    <%= @gym.full_address %>
-    <%= link_to @gym.map_url do %>
-      <i class="fa fa-map-marker" aria-hidden="true"></i>
-    <% end %>
-    </p>
+    <div class="column is-12">
+      <h1 class="title"><%= @gym.name %></h1>
+      <p>
+      <%= @gym.full_address %>
+      <%= link_to @gym.map_url do %>
+        <i class="fa fa-map-marker" aria-hidden="true"></i>
+      <% end %>
+      </p>
+    </div>
   </div>
-</div>
 
-<div class="row">
-  <div class="columns map no-padding">
-    <div id="googleMap" style="width:100%;height:500px;"></div>
+  <div class="columns">
+    <div class="column is-12 map">
+      <div id="googleMap" style="width:100%;height:500px;"></div>
+    </div>
   </div>
 </div>
 
-<script type="text/javascript" charset="utf-8">
+<% content_for :javascript do %>
   window.currentView = new Stronglifters.GoogleMap("googleMap").present({
     name: '<%= @gym.name %>',
     latitude: <%= @gym.location.latitude %>,
     longitude: <%= @gym.location.longitude %>,
   });
-</script>
+<% end %>