From e1aee4ed263f9687bc0521145fc636a4719a6198 Mon Sep 17 00:00:00 2001
From: Jessieliuzx
Date: Tue, 21 Nov 2017 21:41:07 +0000
Subject: [PATCH 01/18] Removed extra items in nav bar
---
app/views/layouts/application.html.erb | 5 -----
1 file changed, 5 deletions(-)
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index 881e961..f802a74 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -41,13 +41,8 @@
From 28af60da5b1eea3c3888c059ba2e3d96b7d7c70c Mon Sep 17 00:00:00 2001
From: Jessieliuzx
Date: Tue, 21 Nov 2017 21:47:50 +0000
Subject: [PATCH 02/18] Correct Navbar name
---
app/views/layouts/application.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index f802a74..4847939 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -42,7 +42,7 @@
From add16b330a8a09c2f8b4dcd9406273742f0f63f2 Mon Sep 17 00:00:00 2001
From: Jessieliuzx
Date: Tue, 21 Nov 2017 21:57:06 +0000
Subject: [PATCH 03/18] home page changed to dishes
---
config/routes.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/routes.rb b/config/routes.rb
index 6f92ce5..4372e87 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,5 +1,5 @@
Rails.application.routes.draw do
- root :to => "venues#index"
+ root :to => "dishes#index"
# Routes for the Bookmark resource:
# CREATE
From 6c8afc1c1c4e3fbfa9c082b139854a5b859de958 Mon Sep 17 00:00:00 2001
From: Jessieliuzx
Date: Tue, 21 Nov 2017 22:07:02 +0000
Subject: [PATCH 04/18] link name to dish show page
---
app/views/dishes/index.html.erb | 5 +++--
grades.yml | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/app/views/dishes/index.html.erb b/app/views/dishes/index.html.erb
index bc51992..63d0e3b 100644
--- a/app/views/dishes/index.html.erb
+++ b/app/views/dishes/index.html.erb
@@ -94,7 +94,9 @@
<% @dishes.each do |dish| %>
- | <%= dish.name %> |
+
+ <%= dish.name %>
+ |
<% if dish.cuisine.present? %>
@@ -103,7 +105,6 @@
<% end %>
|
- Show
Edit
Delete
|
diff --git a/grades.yml b/grades.yml
index 2f40b8d..3558ded 100644
--- a/grades.yml
+++ b/grades.yml
@@ -1,4 +1,4 @@
---
submission_url: https://grades.firstdraft.com
project_token: ''
-personal_access_token:
+personal_access_token: aENQx7CCKcpTVTKgBU1zXCPE
From 1b39d0d898f51b45490b135d39a2a4216d301f1b Mon Sep 17 00:00:00 2001
From: Jessieliuzx
Date: Wed, 22 Nov 2017 01:57:03 +0000
Subject: [PATCH 05/18] added bookmarked venue to dishes on dish index page
---
app/views/dishes/index.html.erb | 13 ++++++++++---
app/views/layouts/application.html.erb | 2 +-
whitelist.yml | 1 +
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/app/views/dishes/index.html.erb b/app/views/dishes/index.html.erb
index 63d0e3b..1c84f9f 100644
--- a/app/views/dishes/index.html.erb
+++ b/app/views/dishes/index.html.erb
@@ -87,9 +87,9 @@
- | Name |
- Cuisine |
- Actions |
+ The very best... |
+ is at... |
+ |
<% @dishes.each do |dish| %>
@@ -97,6 +97,13 @@
<%= dish.name %>
|
+
+ <% if dish.bookmarks.find_by(:dish_id => dish.id).present? %>
+
+ <%= dish.bookmarks.find_by(:dish_id => dish.id).venue.name %>
+
+ <% end %>
+ |
<% if dish.cuisine.present? %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index 4847939..b51f355 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -42,7 +42,7 @@
diff --git a/whitelist.yml b/whitelist.yml
index ab11e34..e0d7945 100644
--- a/whitelist.yml
+++ b/whitelist.yml
@@ -2,3 +2,4 @@
- 127.0.0.1
- 10.240.0.0/16
- "::1"
+- 50.232.11.130
From 04d0ae438efb3ee18f3a117eee9fbf2525cff27d Mon Sep 17 00:00:00 2001
From: Jessieliuzx
Date: Wed, 22 Nov 2017 02:30:15 +0000
Subject: [PATCH 06/18] add bookmark option for unbooked dish on dish index
---
app/controllers/cuisines_controller.rb | 2 +-
app/controllers/dishes_controller.rb | 2 +-
app/views/dishes/index.html.erb | 15 +++++++++++++++
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/app/controllers/cuisines_controller.rb b/app/controllers/cuisines_controller.rb
index ef26e20..619f6c4 100644
--- a/app/controllers/cuisines_controller.rb
+++ b/app/controllers/cuisines_controller.rb
@@ -2,7 +2,7 @@ class CuisinesController < ApplicationController
def index
@q = Cuisine.ransack(params[:q])
@cuisines = @q.result(:distinct => true).includes(:dishes).page(params[:page]).per(10)
-
+ @bookmark = Bookmark.new
render("cuisines/index.html.erb")
end
diff --git a/app/controllers/dishes_controller.rb b/app/controllers/dishes_controller.rb
index 84facab..8f3c069 100644
--- a/app/controllers/dishes_controller.rb
+++ b/app/controllers/dishes_controller.rb
@@ -2,7 +2,7 @@ class DishesController < ApplicationController
def index
@q = Dish.ransack(params[:q])
@dishes = @q.result(:distinct => true).includes(:cuisine, :bookmarks, :fans, :specialists).page(params[:page]).per(10)
-
+ @bookmark = Bookmark.new
render("dishes/index.html.erb")
end
diff --git a/app/views/dishes/index.html.erb b/app/views/dishes/index.html.erb
index 1c84f9f..72127b1 100644
--- a/app/views/dishes/index.html.erb
+++ b/app/views/dishes/index.html.erb
@@ -102,6 +102,21 @@
<%= dish.bookmarks.find_by(:dish_id => dish.id).venue.name %>
+ <% else %>
+
<% end %>
|
From 9130094a4f9311ca9d56e6bd6cf9614b83385c74 Mon Sep 17 00:00:00 2001
From: Jessieliuzx
Date: Wed, 22 Nov 2017 02:41:04 +0000
Subject: [PATCH 07/18] adding bookmark for unbookmarked dish
---
app/views/dishes/index.html.erb | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/app/views/dishes/index.html.erb b/app/views/dishes/index.html.erb
index 72127b1..e8e1bb0 100644
--- a/app/views/dishes/index.html.erb
+++ b/app/views/dishes/index.html.erb
@@ -111,11 +111,19 @@
-
- <%= select_tag(:venue_id, options_from_collection_for_select(Venue.all, :id, :name, @bookmark.venue_id), prompt:"Choose a venue...",:class => "form-control") %>
-
+
+
+ <%= select_tag(:venue_id, options_from_collection_for_select(Venue.all, :id, :name, @bookmark.venue_id), prompt:"Choose a venue...", :class => "form-control input-sm") %>
+
+
+
+
<% end %>
|
From 7105be654f3f0b5e531f9462ed8f765be87fcdff Mon Sep 17 00:00:00 2001
From: Jessieliuzx
Date: Wed, 22 Nov 2017 02:49:31 +0000
Subject: [PATCH 08/18] dish index displaying only signed in users' bookmark
---
app/views/dishes/index.html.erb | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/app/views/dishes/index.html.erb b/app/views/dishes/index.html.erb
index e8e1bb0..06c8a0a 100644
--- a/app/views/dishes/index.html.erb
+++ b/app/views/dishes/index.html.erb
@@ -98,9 +98,9 @@
<%= dish.name %>
- <% if dish.bookmarks.find_by(:dish_id => dish.id).present? %>
-
- <%= dish.bookmarks.find_by(:dish_id => dish.id).venue.name %>
+ <% if dish.bookmarks.find_by(:user_id => current_user.id).present? %>
+
+ <%= dish.bookmarks.find_by(:user_id => current_user.id).venue.name %>
<% else %>
<% end %>
|
-
- <% if dish.cuisine.present? %>
-
- <%= dish.cuisine.name %>
-
- <% end %>
- |
-
- Edit
- Delete
+ |
+
+ <% if dish.cuisine.present? %>
+
+ <%= dish.cuisine.name %>
+
+ <% end %>
+
|
+
+
<% end %>
From 312a0375c03163bc001baba541cdcd36d0fc6bf6 Mon Sep 17 00:00:00 2001
From: Jessieliuzx
Date: Wed, 22 Nov 2017 03:03:27 +0000
Subject: [PATCH 11/18] dish index page can add new venue
---
app/views/dishes/index.html.erb | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/app/views/dishes/index.html.erb b/app/views/dishes/index.html.erb
index 3bc231c..1f2bd04 100644
--- a/app/views/dishes/index.html.erb
+++ b/app/views/dishes/index.html.erb
@@ -1,7 +1,6 @@
From 099af8218f83faa6ac95d40101858fdabf385523 Mon Sep 17 00:00:00 2001
From: Jessieliuzx
Date: Wed, 22 Nov 2017 04:25:05 +0000
Subject: [PATCH 12/18] add cuisine option to filter and deleted extra filters
---
app/controllers/dishes_controller.rb | 1 +
app/views/dishes/index.html.erb | 76 +++++-----------------------
2 files changed, 15 insertions(+), 62 deletions(-)
diff --git a/app/controllers/dishes_controller.rb b/app/controllers/dishes_controller.rb
index 8f3c069..49747c8 100644
--- a/app/controllers/dishes_controller.rb
+++ b/app/controllers/dishes_controller.rb
@@ -3,6 +3,7 @@ def index
@q = Dish.ransack(params[:q])
@dishes = @q.result(:distinct => true).includes(:cuisine, :bookmarks, :fans, :specialists).page(params[:page]).per(10)
@bookmark = Bookmark.new
+ @cuisines = Cuisine.all
render("dishes/index.html.erb")
end
diff --git a/app/views/dishes/index.html.erb b/app/views/dishes/index.html.erb
index 1f2bd04..e5a7459 100644
--- a/app/views/dishes/index.html.erb
+++ b/app/views/dishes/index.html.erb
@@ -3,74 +3,25 @@
Add a new venue
-
+
<%= search_form_for @q, :class => "collapse", :id => "dishes_filters" do |f| %>
Narrow results:
-
- <%= f.label :name_cont, "Name contains" %>
- <%= f.text_field :name_cont, :class => "form-control", :placeholder => "Name contains" %>
-
-
-
-
-
-
From 2c647a1f75f74907f934f7c933c1aec6898f25d0 Mon Sep 17 00:00:00 2001
From: Jessieliuzx
Date: Wed, 22 Nov 2017 05:01:31 +0000
Subject: [PATCH 13/18] Attempt to make filter by cuisine work
---
app/views/dishes/index.html.erb | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/app/views/dishes/index.html.erb b/app/views/dishes/index.html.erb
index e5a7459..1c6f98e 100644
--- a/app/views/dishes/index.html.erb
+++ b/app/views/dishes/index.html.erb
@@ -14,16 +14,16 @@
- <%= f.submit :class => "btn btn-primary btn-block mb-1" %>
+ <%= f.submit :class => "btn btn-primary btn-block mb-1", :name=>"commit", :value=>"Search" %>
Clear filters
<% end %>
From 81a5421b32037fc5601927bec3c0b325db1b3131 Mon Sep 17 00:00:00 2001
From: Jessieliuzx
Date: Wed, 22 Nov 2017 16:33:32 +0000
Subject: [PATCH 14/18] venue index only shows logged in users' preference
---
app/views/dishes/show.html.erb | 6 +-----
app/views/venues/index.html.erb | 6 ++++--
app/views/venues/show.html.erb | 2 +-
whitelist.yml | 1 +
4 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/app/views/dishes/show.html.erb b/app/views/dishes/show.html.erb
index 36415db..0d1b040 100644
--- a/app/views/dishes/show.html.erb
+++ b/app/views/dishes/show.html.erb
@@ -1,7 +1,3 @@
-
-
-
+
<% @venues.each do |venue| %>
-
+ <% if venue.bookmarks.find_by(:user_id => current_user.id).present? %>
+
| <%= venue.name %> |
<%= venue.address %> |
@@ -119,6 +120,7 @@
Delete
|
+ <%end%>
<% end %>
<%= paginate @venues, theme: 'twitter-bootstrap-4' %>
diff --git a/app/views/venues/show.html.erb b/app/views/venues/show.html.erb
index 3fc6f2d..12cea5d 100644
--- a/app/views/venues/show.html.erb
+++ b/app/views/venues/show.html.erb
@@ -48,7 +48,7 @@
-
Bookmarks
-
+
<% @venue.bookmarks.each do |bookmark| %>
-
diff --git a/whitelist.yml b/whitelist.yml
index e0d7945..8db53fa 100644
--- a/whitelist.yml
+++ b/whitelist.yml
@@ -3,3 +3,4 @@
- 10.240.0.0/16
- "::1"
- 50.232.11.130
+- 128.135.98.148
From ebd2c4194a29272d50863cbac7f9c52ceab50943 Mon Sep 17 00:00:00 2001
From: Jessieliuzx
Date: Fri, 24 Nov 2017 01:54:02 +0000
Subject: [PATCH 15/18] filter by dish on venue index page
---
app/views/dishes/index.html.erb | 10 +++----
app/views/venues/index.html.erb | 53 ++-------------------------------
2 files changed, 8 insertions(+), 55 deletions(-)
diff --git a/app/views/dishes/index.html.erb b/app/views/dishes/index.html.erb
index 1c6f98e..b75c871 100644
--- a/app/views/dishes/index.html.erb
+++ b/app/views/dishes/index.html.erb
@@ -15,15 +15,15 @@
<%= f.label :cuisine_name, "Cuisine" %>
- <% @cuisines.each do |cuisine|%>
- <%= f.check_box :cuisine_name, :id => "cuisine_id", :value => cuisine.id%>
-
<%= cuisine.name%>
- <% end %>
+ <% @cuisines.each do |cuisine|%>
+ <%= f.check_box :cuisine_name, :id => "cuisine_id", :value => cuisine.id%>
+
<%= cuisine.name%>
+ <% end %>
- <%= f.submit :class => "btn btn-primary btn-block mb-1", :name=>"commit", :value=>"Search" %>
+ <%= f.submit :class => "btn btn-primary btn-block mb-1" %>
Clear filters
<% end %>
diff --git a/app/views/venues/index.html.erb b/app/views/venues/index.html.erb
index 02e1ed3..e8f428f 100644
--- a/app/views/venues/index.html.erb
+++ b/app/views/venues/index.html.erb
@@ -13,64 +13,17 @@
<%= 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 :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 :specialties_name_cont, "Dish name contains" %>
- <%= f.text_field :specialties_name_cont, :class => "form-control", :placeholder => "Dish name contains" %>
+ <%= f.label :specialties_name_cont, "Bookmarked dish name contains" %>
+ <%= f.text_field :specialties_name_cont, :class => "form-control", :placeholder => "Bookmarked dish name contains" %>
<%= f.submit :class => "btn btn-primary btn-block mb-1" %>
From 3776dae1f58a22fce18398a5e1a593cfc779bdcc Mon Sep 17 00:00:00 2001
From: Jessieliuzx
Date: Fri, 24 Nov 2017 03:05:46 +0000
Subject: [PATCH 16/18] dish show page show all past venues
---
app/views/dishes/show.html.erb | 38 +++++-----------------------------
whitelist.yml | 1 +
2 files changed, 6 insertions(+), 33 deletions(-)
diff --git a/app/views/dishes/show.html.erb b/app/views/dishes/show.html.erb
index 0d1b040..9d255e4 100644
--- a/app/views/dishes/show.html.erb
+++ b/app/views/dishes/show.html.erb
@@ -95,36 +95,6 @@
-
-
-
@@ -136,10 +106,11 @@
<% @dish.specialists.each do |venue| %>
-
-
+ <% if venue.bookmarks.find_by(:user_id => current_user.id).present? %>
+
+
<%= venue.name %>
-
+
+ <% end %>
<% end %>
diff --git a/whitelist.yml b/whitelist.yml
index 8db53fa..d152ac8 100644
--- a/whitelist.yml
+++ b/whitelist.yml
@@ -4,3 +4,4 @@
- "::1"
- 50.232.11.130
- 128.135.98.148
+- 96.47.146.150
From 4ac62689e758bf7071f3eacf4abc3fd3865f3e01 Mon Sep 17 00:00:00 2001
From: elizabeth campbell
Date: Tue, 28 Nov 2017 15:20:21 +0000
Subject: [PATCH 17/18] Filtering dishes by cuisine type
Checkbox for filtering on /dishes now works by cuisine
---
app/views/dishes/index.html.erb | 32 +++++++++++++++++++++-----------
whitelist.yml | 1 +
2 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/app/views/dishes/index.html.erb b/app/views/dishes/index.html.erb
index b75c871..0f16f4f 100644
--- a/app/views/dishes/index.html.erb
+++ b/app/views/dishes/index.html.erb
@@ -2,34 +2,41 @@
-
+
+
+
<%= search_form_for @q, :class => "collapse", :id => "dishes_filters" do |f| %>
+
Narrow results:
<%= f.label :name_cont, "Name contains" %>
<%= f.text_field :name_cont, :class => "form-control", :placeholder => "Name contains" %>
-
@@ -53,6 +60,8 @@
<%= dish.bookmarks.find_by(:user_id => current_user.id).venue.name %>
+
+
<% else %>
<% end %>
diff --git a/whitelist.yml b/whitelist.yml
index d152ac8..0b3d452 100644
--- a/whitelist.yml
+++ b/whitelist.yml
@@ -5,3 +5,4 @@
- 50.232.11.130
- 128.135.98.148
- 96.47.146.150
+- 203.141.155.157
From 90d51d4b4d43ed63f4b35a9b1ff02ad3e16d9116 Mon Sep 17 00:00:00 2001
From: Larry
Date: Tue, 28 Nov 2017 20:33:30 +0000
Subject: [PATCH 18/18] Dish show page matches target
Page after selecting a dish from dishes index
---
app/views/dishes/show.html.erb | 185 ++++++++++++---------------------
whitelist.yml | 1 +
2 files changed, 69 insertions(+), 117 deletions(-)
diff --git a/app/views/dishes/show.html.erb b/app/views/dishes/show.html.erb
index 9d255e4..9825abb 100644
--- a/app/views/dishes/show.html.erb
+++ b/app/views/dishes/show.html.erb
@@ -1,130 +1,81 @@
-
-
-
-
+
+
+
+
+
You loved the <%= @dish.name %> at...
+
+ <%= @dish.cuisine.name %>
+
+
+
-
-
-
-
-
-
-
-
-
- -
- Specialists
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <%= select_tag(:venue_id, options_from_collection_for_select(Venue.all, :id, :name), :class => "form-control", :prompt => "Choose a venue...") %>
+
+
+
+
+
+ right now
+
+
+
+
- <% @dish.specialists.each do |venue| %>
- <% if venue.bookmarks.find_by(:user_id => current_user.id).present? %>
+ <% @dish.bookmarks.each do |bookmark| %>
+ <% if bookmark.user_id == current_user.id %>
-
-
- <%= venue.name %>
-
-
-
+
+
+ <%= bookmark.venue.name %>
+
+
+
+ <%= time_ago_in_words(bookmark.created_at) %>
+
+
+
+
+
+
+
+
+
<% end %>
<% end %>
+
+
+
+
+
+
+
diff --git a/whitelist.yml b/whitelist.yml
index 0b3d452..6f0f67f 100644
--- a/whitelist.yml
+++ b/whitelist.yml
@@ -6,3 +6,4 @@
- 128.135.98.148
- 96.47.146.150
- 203.141.155.157
+- 108.75.174.66