From 42296054eca26f8545033a5f0c5192db15945790 Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Fri, 20 Dec 2024 19:09:47 -0800 Subject: [PATCH 1/4] initial commit; --- .../staff/pets/tabs/_fosters.html.erb | 38 +++++++++---------- .../staff/pets/tabs/partials/_foster.html.erb | 17 +++++---- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/app/views/organizations/staff/pets/tabs/_fosters.html.erb b/app/views/organizations/staff/pets/tabs/_fosters.html.erb index c6c87c619..18bf0c4f9 100644 --- a/app/views/organizations/staff/pets/tabs/_fosters.html.erb +++ b/app/views/organizations/staff/pets/tabs/_fosters.html.erb @@ -1,24 +1,24 @@ -
+
- <% #headers %> -
-
- <%= t("organizations.staff.pets.show.fosterer")%> + <% fosters.each do |foster|%> + <% #headers %> +
+
+ <%= t("organizations.staff.pets.show.fosterer")%> +
+
+ <%= t("organizations.staff.pets.show.status")%> +
+
+ <%= t("organizations.staff.pets.show.start_date")%> +
+
+ <%= t("organizations.staff.pets.show.end_date")%> +
+
+
-
- <%= t("organizations.staff.pets.show.status")%> -
-
- <%= t("organizations.staff.pets.show.start_date")%> -
-
- <%= t("organizations.staff.pets.show.end_date")%> -
-
-
-
- - <% fosters.each do |foster|%> + <%= render 'organizations/staff/pets/tabs/partials/foster', foster: foster %> <% end %>
diff --git a/app/views/organizations/staff/pets/tabs/partials/_foster.html.erb b/app/views/organizations/staff/pets/tabs/partials/_foster.html.erb index ab06fc1af..df012f2a1 100644 --- a/app/views/organizations/staff/pets/tabs/partials/_foster.html.erb +++ b/app/views/organizations/staff/pets/tabs/partials/_foster.html.erb @@ -1,17 +1,19 @@ -
+
-
+
<%= link_to link_to "PLACEHOLDER FOR FORM ANSWERS", nil, class: "link-underline link-underline-opacity-0" %>
+ -
+
<%= foster.status.to_s.titleize %>
+ -
+
<%= turbo_frame_tag dom_id(foster, :start_date) do %> <%= link_to foster.start_date.strftime("%m/%d/%Y"), edit_staff_manage_foster_path(foster), @@ -19,15 +21,16 @@ <% end %>
-
+
<%= turbo_frame_tag dom_id(foster, :end_date) do %> <%= link_to foster.end_date.strftime("%m/%d/%Y"), edit_staff_manage_foster_path(foster), class: "btn btn-outline-primary mb-2 px-2 py-1" %> <% end %>
- -
+ + +
<%= button_to t('general.delete'), staff_manage_foster_path(foster), method: :delete, class: "btn btn-outline-danger px-2 py-1", From 6acbe986a5f373c7eac77e55036c4a8c8e0a7032 Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Mon, 23 Dec 2024 14:22:37 -0800 Subject: [PATCH 2/4] repurposing existing partial files --- .../staff/pets/tabs/_fosters.html.erb | 30 +++-------- .../staff/pets/tabs/partials/_foster.html.erb | 41 -------------- .../pets/tabs/partials/_foster_cards.html.erb | 54 +++++++++++++++++++ .../pets/tabs/partials/_foster_table.html.erb | 28 ++++++++++ .../tabs/partials/_foster_table_row.html.erb | 44 +++++++++++++++ 5 files changed, 133 insertions(+), 64 deletions(-) delete mode 100644 app/views/organizations/staff/pets/tabs/partials/_foster.html.erb create mode 100644 app/views/organizations/staff/pets/tabs/partials/_foster_cards.html.erb create mode 100644 app/views/organizations/staff/pets/tabs/partials/_foster_table.html.erb create mode 100644 app/views/organizations/staff/pets/tabs/partials/_foster_table_row.html.erb diff --git a/app/views/organizations/staff/pets/tabs/_fosters.html.erb b/app/views/organizations/staff/pets/tabs/_fosters.html.erb index 18bf0c4f9..0890f0bd5 100644 --- a/app/views/organizations/staff/pets/tabs/_fosters.html.erb +++ b/app/views/organizations/staff/pets/tabs/_fosters.html.erb @@ -1,25 +1,9 @@ -
-
- <% fosters.each do |foster|%> - <% #headers %> -
-
- <%= t("organizations.staff.pets.show.fosterer")%> -
-
- <%= t("organizations.staff.pets.show.status")%> -
-
- <%= t("organizations.staff.pets.show.start_date")%> -
-
- <%= t("organizations.staff.pets.show.end_date")%> -
-
-
-
- - <%= render 'organizations/staff/pets/tabs/partials/foster', foster: foster %> - <% end %> +
+ <%# Table layout %> +
+ <%= render "organizations/staff/pets/tabs/partials/foster_table", fosters: fosters %> +
+
+ <%= render 'organizations/staff/pets/tabs/partials/foster_cards', fosters: fosters %>
diff --git a/app/views/organizations/staff/pets/tabs/partials/_foster.html.erb b/app/views/organizations/staff/pets/tabs/partials/_foster.html.erb deleted file mode 100644 index df012f2a1..000000000 --- a/app/views/organizations/staff/pets/tabs/partials/_foster.html.erb +++ /dev/null @@ -1,41 +0,0 @@ -
- -
- <%= link_to link_to "PLACEHOLDER FOR FORM ANSWERS", nil, - class: "link-underline link-underline-opacity-0" %> -
- - -
-
- <%= foster.status.to_s.titleize %> -
-
- - -
- <%= turbo_frame_tag dom_id(foster, :start_date) do %> - <%= link_to foster.start_date.strftime("%m/%d/%Y"), - edit_staff_manage_foster_path(foster), - class: "btn btn-outline-primary mb-2 px-2 py-1" %> - <% end %> -
- -
- <%= turbo_frame_tag dom_id(foster, :end_date) do %> - <%= link_to foster.end_date.strftime("%m/%d/%Y"), - edit_staff_manage_foster_path(foster), - class: "btn btn-outline-primary mb-2 px-2 py-1" %> - <% end %> -
- - -
- <%= button_to t('general.delete'), staff_manage_foster_path(foster), - method: :delete, - class: "btn btn-outline-danger px-2 py-1", - data: { - turbo_confirm: "Click OK to delete this foster." - } %> -
-
diff --git a/app/views/organizations/staff/pets/tabs/partials/_foster_cards.html.erb b/app/views/organizations/staff/pets/tabs/partials/_foster_cards.html.erb new file mode 100644 index 000000000..f4fcf572b --- /dev/null +++ b/app/views/organizations/staff/pets/tabs/partials/_foster_cards.html.erb @@ -0,0 +1,54 @@ +<% fosters.each do |foster| %> + <%# Grid cell %> +
+ <%# Card %> +
+ <%# Card body %> +
    +
  • +
      +
    • + Fosterer: +
      + <%= link_to foster.person.full_name, staff_person_form_submissions_path(foster.person)%> +
      +
    • +
    • +
      + <%= foster.status.to_s.titleize %> +
      +
    • +
    • + Start date: + <%= turbo_frame_tag dom_id(foster, :start_date) do %> + <%= link_to foster.start_date.strftime("%m/%d/%Y"), + edit_staff_manage_foster_path(foster, page: params[:page]), + class: "btn btn-outline-primary mb-2" + %> + <% end %> +
    • +
    • + End date: + <%= turbo_frame_tag dom_id(foster, :end_date) do %> + <%= link_to foster.end_date.strftime("%m/%d/%Y"), + edit_staff_manage_foster_path(foster, page: params[:page]), + class: "btn btn-outline-primary mb-2" + %> + <% end %> +
    • +
    • + <%= button_to t('general.delete'), + staff_manage_foster_path(foster, page: params[:page]), + method: :delete, + class: "btn btn-outline-danger", + data: { + turbo_confirm: "Click OK to delete this foster." + } + %> +
    • +
    +
  • +
+
+
+<% end %> \ No newline at end of file diff --git a/app/views/organizations/staff/pets/tabs/partials/_foster_table.html.erb b/app/views/organizations/staff/pets/tabs/partials/_foster_table.html.erb new file mode 100644 index 000000000..afb5bf4d7 --- /dev/null +++ b/app/views/organizations/staff/pets/tabs/partials/_foster_table.html.erb @@ -0,0 +1,28 @@ +
+
+ +

+ <%= link_to @pet.name, staff_pet_path(@pet), + class: "link-underline link-underline-opacity-0" + %> +

+
+
+ + + + + + + + + + + + <% fosters.each do |foster|%> + <%= render "organizations/staff/pets/tabs/partials/foster_table_row", foster: foster %> + <% end %> + +
FostererStatusStart DateEnd Date
+
+
diff --git a/app/views/organizations/staff/pets/tabs/partials/_foster_table_row.html.erb b/app/views/organizations/staff/pets/tabs/partials/_foster_table_row.html.erb new file mode 100644 index 000000000..b7503f9c0 --- /dev/null +++ b/app/views/organizations/staff/pets/tabs/partials/_foster_table_row.html.erb @@ -0,0 +1,44 @@ + + + + <%= link_to foster.person.full_name, staff_person_form_submissions_path(foster.person)%> + + + + +
+ <%= foster.status.to_s.titleize %> +
+ + + + <%= turbo_frame_tag dom_id(foster, :start_date) do %> + <%= link_to foster.start_date.strftime("%m/%d/%Y"), + edit_staff_manage_foster_path(foster, page: params[:page]), + class: "btn btn-outline-primary" + %> + <% end %> + + + + <%= turbo_frame_tag dom_id(foster, :end_date) do %> + <%= link_to foster.end_date.strftime("%m/%d/%Y"), + edit_staff_manage_foster_path(foster, page: params[:page]), + class: "btn btn-outline-primary" + %> + <% end %> + + + +
+ <%= button_to t('general.delete'), + staff_manage_foster_path(foster, page: params[:page]), + method: :delete, + class: "btn btn-outline-danger", + data: { + turbo_confirm: "Click OK to delete this foster." + } + %> +
+ + From 6e17c7d3e27857c7cdb259247ccd6a7fdcf08284 Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Mon, 23 Dec 2024 14:26:05 -0800 Subject: [PATCH 3/4] removing name --- .../staff/pets/tabs/partials/_foster_table.html.erb | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/views/organizations/staff/pets/tabs/partials/_foster_table.html.erb b/app/views/organizations/staff/pets/tabs/partials/_foster_table.html.erb index afb5bf4d7..79a1095dd 100644 --- a/app/views/organizations/staff/pets/tabs/partials/_foster_table.html.erb +++ b/app/views/organizations/staff/pets/tabs/partials/_foster_table.html.erb @@ -1,12 +1,4 @@
-
- -

- <%= link_to @pet.name, staff_pet_path(@pet), - class: "link-underline link-underline-opacity-0" - %> -

-
From 09e53e5c48e35e47d543be2bdaba982dec2c8ca3 Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Thu, 26 Dec 2024 11:52:33 -0800 Subject: [PATCH 4/4] adding new line --- .../staff/pets/tabs/partials/_foster_cards.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/organizations/staff/pets/tabs/partials/_foster_cards.html.erb b/app/views/organizations/staff/pets/tabs/partials/_foster_cards.html.erb index f4fcf572b..6ce44f39c 100644 --- a/app/views/organizations/staff/pets/tabs/partials/_foster_cards.html.erb +++ b/app/views/organizations/staff/pets/tabs/partials/_foster_cards.html.erb @@ -51,4 +51,4 @@ -<% end %> \ No newline at end of file +<% end %>