From caf9df61d8de8316e5ceb6203bf3eadca03e2181 Mon Sep 17 00:00:00 2001 From: Odell McFarland IV Date: Sat, 7 Dec 2024 21:42:14 -0800 Subject: [PATCH 1/3] feat: present fostered start and end date on fostered pets index page --- .../adopter_fosterer/fostered_pets/index.html.erb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/views/organizations/adopter_fosterer/fostered_pets/index.html.erb b/app/views/organizations/adopter_fosterer/fostered_pets/index.html.erb index b45cca6fe..35994053a 100644 --- a/app/views/organizations/adopter_fosterer/fostered_pets/index.html.erb +++ b/app/views/organizations/adopter_fosterer/fostered_pets/index.html.erb @@ -4,7 +4,7 @@
<% @fostered_pets.each_with_index do |fostered_pet, index| %> -
+
<%= link_to adopter_fosterer_fostered_pet_files_path(fostered_pet.pet, pet_id: fostered_pet.pet.id), data: { turbo_frame: "pet_files", action: "click->card#selectCard" } do %>
@@ -13,7 +13,13 @@ class: 'rounded-circle', style: "width: 100%; height: 100%; object-fit: cover;") %>
-
<%= fostered_pet.pet.name %>
+
<%= fostered_pet.pet.name %>
+
+
+
Start Date: <%= fostered_pet.start_date.strftime("%m/%d/%y") %>
+
End Date: <%= fostered_pet.end_date.strftime("%m/%d/%y") %>
+
+
<% end %> From 78d5defb1ceb063625b1e314bfa0c555df24a4d0 Mon Sep 17 00:00:00 2001 From: Odell McFarland IV Date: Sat, 7 Dec 2024 22:23:05 -0800 Subject: [PATCH 2/3] Refactor: present the phrase term instead of start date and end date to make text more simple to read and reduce amount of text on the card --- .../adopter_fosterer/fostered_pets/index.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/organizations/adopter_fosterer/fostered_pets/index.html.erb b/app/views/organizations/adopter_fosterer/fostered_pets/index.html.erb index 35994053a..bbad26c55 100644 --- a/app/views/organizations/adopter_fosterer/fostered_pets/index.html.erb +++ b/app/views/organizations/adopter_fosterer/fostered_pets/index.html.erb @@ -16,8 +16,8 @@
<%= fostered_pet.pet.name %>
-
Start Date: <%= fostered_pet.start_date.strftime("%m/%d/%y") %>
-
End Date: <%= fostered_pet.end_date.strftime("%m/%d/%y") %>
+
Term:
+
<%= fostered_pet.end_date.strftime("%m/%d/%y") %> - <%=fostered_pet.start_date.strftime("%m/%d/%y")%>
From a5192c4bd8e722eaad65a1dfd97f8de7c35b6747 Mon Sep 17 00:00:00 2001 From: Odell McFarland IV Date: Sat, 7 Dec 2024 22:33:41 -0800 Subject: [PATCH 3/3] Fix: ensure dates are in chronological order --- .../organizations/adopter_fosterer/fostered_pets/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/organizations/adopter_fosterer/fostered_pets/index.html.erb b/app/views/organizations/adopter_fosterer/fostered_pets/index.html.erb index bbad26c55..628aa28f8 100644 --- a/app/views/organizations/adopter_fosterer/fostered_pets/index.html.erb +++ b/app/views/organizations/adopter_fosterer/fostered_pets/index.html.erb @@ -17,7 +17,7 @@
Term:
-
<%= fostered_pet.end_date.strftime("%m/%d/%y") %> - <%=fostered_pet.start_date.strftime("%m/%d/%y")%>
+
<%= fostered_pet.start_date.strftime("%m/%d/%y") %> - <%=fostered_pet.end_date.strftime("%m/%d/%y")%>