diff --git a/app/controllers/venues_controller.rb b/app/controllers/venues_controller.rb index c368d81..2087ddc 100644 --- a/app/controllers/venues_controller.rb +++ b/app/controllers/venues_controller.rb @@ -1,11 +1,11 @@ class VenuesController < ApplicationController def index @q = Venue.ransack(params[:q]) - @venues = @q.result(:distinct => true).includes(:bookmarks, :neighborhood, :fans, :specialties).page(params[:page]).per(10) + @venues = @q.result(:distinct => true).includes(:bookmarks, :neighborhood, :fans, :specialties).page(params[:page]).per(100) @location_hash = Gmaps4rails.build_markers(@venues.where.not(:address_latitude => nil)) do |venue, marker| marker.lat venue.address_latitude marker.lng venue.address_longitude - marker.infowindow "
#{venue.created_at}
#{venue.address_formatted_address}" + marker.infowindow "
#{venue.name}
#{venue.address_formatted_address}" end render("venues/index.html.erb") diff --git a/app/views/dishes/index.html.erb b/app/views/dishes/index.html.erb index 93e9966..e791958 100644 --- a/app/views/dishes/index.html.erb +++ b/app/views/dishes/index.html.erb @@ -103,3 +103,5 @@ <%= paginate @dishes, theme: 'twitter-bootstrap-4' %> + + diff --git a/app/views/venues/index.html.erb b/app/views/venues/index.html.erb index 169f95b..74b7f8f 100644 --- a/app/views/venues/index.html.erb +++ b/app/views/venues/index.html.erb @@ -1,127 +1,68 @@ -
-
- <%= search_form_for @q, :class => "collapse", :id => "venues_filters" do |f| %> -

Narrow results:

+
+
+ <%= search_form_for @q, :class => collapse_search_form, :id => "venues_filters" do |f| %> +

Narrow results:

-
- <%= f.label :name_cont, "Name contains" %> - <%= f.text_field :name_cont, :class => "form-control", :placeholder => "Name contains" %> -
- -
- <%= f.label :created_at, "Created at" %> -
-
-
- <%= f.text_field :created_at_gteq, :class => "form-control", :placeholder => "Created at greater than or equal to" %> - - - -
-
- -
-
- <%= f.text_field :created_at_lteq, :class => "form-control", :placeholder => "Created at less than or equal to" %> - - - -
-
-
-
- +
+ <%= f.label :name_cont, "Name contains" %> + <%= f.text_field :name_cont, :class => "form-control", :placeholder => "Name contains" %> +
-
- <%= f.label :bookmarks_notes_cont, "Bookmark notes contains" %> - <%= f.text_field :bookmarks_notes_cont, :class => "form-control", :placeholder => "Bookmark notes contains" %> +
+ <%= f.label :bookmarks_notes_or_specialties_name_cont, "Bookmarks keyword" %> + <%= f.text_field :bookmarks_notes_or_specialties_name_cont, :class => "form-control", :placeholder => "Enter a keyword..." %>
-
+
<%= f.label :neighborhood_name_cont, "Neighborhood name contains" %> <%= f.text_field :neighborhood_name_cont, :class => "form-control", :placeholder => "Neighborhood name contains" %>
-
- <%= f.label :fans_username_cont, "User username contains" %> - <%= f.text_field :fans_username_cont, :class => "form-control", :placeholder => "User username contains" %> +
+ <%= f.label :neighborhood_city_cont, "City name contains" %> + <%= f.text_field :neighborhood_city_cont, :class => "form-control", :placeholder => "City name contains" %>
-
- <%= f.label :specialties_name_cont, "Dish name contains" %> - <%= f.text_field :specialties_name_cont, :class => "form-control", :placeholder => "Dish name contains" %> +
+ <%= f.label :neighborhood_state_cont, "State name contains" %> + <%= f.text_field :neighborhood_state_cont, :class => "form-control", :placeholder => "State name contains" %>
- <%= f.submit :class => "btn btn-primary btn-block mb-1" %> + <%= f.submit :class => "btn btn-primary btn-block mb-1" %> - Clear filters + Clear filters <% end %> Show Filters
-
+
+
+
+
+
-
-
-
-
-
-
-
+
    + <% @venues.order(:name).each do |venue| %> +
  • + + <%= venue.name %> + -
    -
    - - - - - - - + + <%= venue.neighborhood.name %>, + <%= venue.neighborhood.city %> + + + <% end %> + - <% @venues.each do |venue| %> - - - - - - - <% end %> -
    NameAddressNeighborhoodActions
    <%= venue.name %><%= venue.address %> - <% if venue.neighborhood.present? %> - - <%= venue.neighborhood.name %> - - <% end %> - - Show - Edit - Delete -
    - <%= paginate @venues, theme: 'twitter-bootstrap-4' %> + + +
@@ -134,4 +75,4 @@ handler.bounds.extendWith(markers); handler.fitMapToBounds(); }); - \ No newline at end of file + diff --git a/app/views/venues/show.html.erb b/app/views/venues/show.html.erb index cc27b35..515c7de 100644 --- a/app/views/venues/show.html.erb +++ b/app/views/venues/show.html.erb @@ -84,7 +84,7 @@ Popular dishes here - <% @venue.specialties.order(:name).each do |dish| %> + <% @venue.specialties.order(:name).distinct.each do |dish| %>
  • <%= dish.name %>