Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 1293: Add a card for mobile #1295

Merged
merged 4 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 7 additions & 23 deletions app/views/organizations/staff/pets/tabs/_fosters.html.erb
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
<div id="fosters_tab_table" class="card">
<div class="card-body px-5">
<% #headers %>
<div class="row border-bottom pb-3 pt-1">
<div class="col-4 fw-semibold">
<%= t("organizations.staff.pets.show.fosterer")%>
</div>
<div class="col-2 fw-semibold">
<%= t("organizations.staff.pets.show.status")%>
</div>
<div class="col-2 fw-semibold">
<%= t("organizations.staff.pets.show.start_date")%>
</div>
<div class="col-2 fw-semibold">
<%= t("organizations.staff.pets.show.end_date")%>
</div>
<div class="col-2 fw-semibold">
</div>
</div>

<% fosters.each do |foster|%>
<%= render 'organizations/staff/pets/tabs/partials/foster', foster: foster %>
<% end %>
<div id="fosters_tab_table">
<%# Table layout %>
<div class="d-flex flex-wrap justify-content-center">
<%= render "organizations/staff/pets/tabs/partials/foster_table", fosters: fosters %>
</div>
<div class="d-xl-none d-flex flex-wrap">
<%= render 'organizations/staff/pets/tabs/partials/foster_cards', fosters: fosters %>
</div>
</div>
38 changes: 0 additions & 38 deletions app/views/organizations/staff/pets/tabs/partials/_foster.html.erb

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<% fosters.each do |foster| %>
<%# Grid cell %>
<div class="col-lg-4 col-md-6 p-0">
<%# Card %>
<div class="card card-hover m-4" style='overflow: hidden'>
<%# Card body %>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<ul class="list-group list-group-flush d-flex flex-column justify-content-between">
<li class="list-group-item">
<span>Fosterer:</span>
<div>
<%= link_to foster.person.full_name, staff_person_form_submissions_path(foster.person)%>
</div>
</li>
<li class="list-group-item">
<div class="badge <%= status_classes(foster.status) %>">
<%= foster.status.to_s.titleize %>
</div>
</li>
<li class="list-group-item">
<span>Start date:</span>
<%= 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 %>
</li>
<li class="list-group-item">
<span>End date:</span>
<%= 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 %>
</li>
<li class="list-group-item d-flex justify-content-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."
}
%>
</li>
</ul>
</li>
</ul>
</div>
</div>
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<div class="card d-none d-xl-block mb-4 flex-grow-1 w-100">
<div class="card-body px-5">
<table class="table mb-0 text-nowrap table-hover table-centered">
<thead>
<tr>
<th scope="col">Fosterer</th>
<th scope="col">Status</th>
<th scope="col">Start Date</th>
<th scope="col">End Date</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<% fosters.each do |foster|%>
<%= render "organizations/staff/pets/tabs/partials/foster_table_row", foster: foster %>
<% end %>
</tbody>
</table>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<tr>
<!-- fosterer -->
<td class="w-20 align-middle">
<%= link_to foster.person.full_name, staff_person_form_submissions_path(foster.person)%>
</td>

<!-- status -->
<td class="w-20 align-middle">
<div class="badge <%= status_classes(foster.status) %>">
<%= foster.status.to_s.titleize %>
</div>
</td>
<!-- start date -->
<td class="w-20 align-middle">
<%= 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 %>
</td>
<!-- end date -->
<td class="w-20 align-middle">
<%= 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 %>
</td>
<!-- buttons -->
<td class="w-20 align-middle">
<div class="d-flex justify-content-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."
}
%>
</div>
</td>
</tr>
Loading