From bfff163667fc3e4688e4aad35e84b3d46a60e0d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20K=C3=B6ves?= Date: Tue, 9 Oct 2018 21:10:58 -0500 Subject: [PATCH 1/2] Added lines index placeholder text This makes it clear if a Caravan has no lines --- app/views/favorites/index.html.erb | 4 ++-- app/views/lines/index.html.erb | 8 ++++++-- app/views/pages/history.html.erb | 6 +++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/views/favorites/index.html.erb b/app/views/favorites/index.html.erb index 60672261..4232cab8 100644 --- a/app/views/favorites/index.html.erb +++ b/app/views/favorites/index.html.erb @@ -1,11 +1,11 @@

Favorite Stops

- <% unless current_user.favorites.empty? %> + <% if current_user.favorites.any? %> <% current_user.favorites.each do |stop| %> <%= render "stops/show_with_issues", stop: stop %> <% end %> <% else %> - You have no favorite stops! Go to <%= link_to "All Lines", lines_path %> or search for stops to favorite them. + You have no favorite stops! Go to <%= link_to "All Lines", lines_path %> or search for stops to favorite them. <% end %>
diff --git a/app/views/lines/index.html.erb b/app/views/lines/index.html.erb index 56231315..bcefad26 100644 --- a/app/views/lines/index.html.erb +++ b/app/views/lines/index.html.erb @@ -3,8 +3,12 @@

All Lines

<%= stylesheet_link_tag "application" %> - <% @lines.each do |line| %> - <%= render "lines/show", line: line %> + <% if @lines.any? %> + <% @lines.each do |line| %> + <%= render "lines/show", line: line %> + <% end %> + <% else %> + There are no lines in this Caravan! <% end %> diff --git a/app/views/pages/history.html.erb b/app/views/pages/history.html.erb index 98477e3d..918ace3d 100644 --- a/app/views/pages/history.html.erb +++ b/app/views/pages/history.html.erb @@ -1,13 +1,13 @@

Reported Issues

- <% if current_user %> + <% if current_user %> <% if current_user.issues.any? %>
You have <%= pluralize(current_user.issues.length, 'issue') %>:
<%= render 'issues/show_list', issues: current_user.issues %> <% else %> - You have not reported any issues yet! + You have not reported any issues yet! <% end %> - <% else %> + <% else %>
Login to see your reported issues.
<% end %>
From 83340347fa97eef02fc53325077fc6c092a1713e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20K=C3=B6ves?= Date: Tue, 16 Oct 2018 19:43:35 -0500 Subject: [PATCH 2/2] Moved all placeholder text to use one class It has no special styling, but it could well later, and this makes this text easier to find --- app/views/favorites/index.html.erb | 2 +- app/views/lines/index.html.erb | 2 +- app/views/pages/history.html.erb | 2 +- app/views/pages/view_issues.html.erb | 5 ++--- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/views/favorites/index.html.erb b/app/views/favorites/index.html.erb index 4232cab8..a8f2ecda 100644 --- a/app/views/favorites/index.html.erb +++ b/app/views/favorites/index.html.erb @@ -5,7 +5,7 @@ <%= render "stops/show_with_issues", stop: stop %> <% end %> <% else %> - You have no favorite stops! Go to <%= link_to "All Lines", lines_path %> or search for stops to favorite them. + You have no favorite stops! Go to <%= link_to "All Lines", lines_path %> or search for stops to favorite them. <% end %> diff --git a/app/views/lines/index.html.erb b/app/views/lines/index.html.erb index bcefad26..cab9e031 100644 --- a/app/views/lines/index.html.erb +++ b/app/views/lines/index.html.erb @@ -8,7 +8,7 @@ <%= render "lines/show", line: line %> <% end %> <% else %> - There are no lines in this Caravan! + There are no lines in this Caravan! <% end %> diff --git a/app/views/pages/history.html.erb b/app/views/pages/history.html.erb index 918ace3d..0bfe9bfb 100644 --- a/app/views/pages/history.html.erb +++ b/app/views/pages/history.html.erb @@ -5,7 +5,7 @@
You have <%= pluralize(current_user.issues.length, 'issue') %>:
<%= render 'issues/show_list', issues: current_user.issues %> <% else %> - You have not reported any issues yet! + You have not reported any issues yet! <% end %> <% else %>
Login to see your reported issues.
diff --git a/app/views/pages/view_issues.html.erb b/app/views/pages/view_issues.html.erb index f0d6ac85..e492ec11 100644 --- a/app/views/pages/view_issues.html.erb +++ b/app/views/pages/view_issues.html.erb @@ -13,7 +13,7 @@ <%= render "stops/show_with_issues", stop: stop %> <% end %> <% else %> -

There seem to be no nearby stops!

+ There seem to be no nearby stops! <% end %> <% else %>

We can't show you nearby stops without location services allowed!

@@ -21,7 +21,6 @@ <% if current_user %> -

<%= image_tag "star.svg", width: "30px", class: "star" %> Favorite Stops @@ -31,7 +30,7 @@ <%= render "stops/show_with_issues", stop: stop %> <% end %> <% if current_user.favorites.empty? %> - You have no favorite stops! Go to <%= link_to "All Lines", lines_path %> or search for stops to favorite them. + You have no favorite stops! Go to <%= link_to "All Lines", lines_path %> or search for stops to favorite them. <% end %> <% end %>