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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
38 changes: 19 additions & 19 deletions app/views/organizations/staff/pets/tabs/_fosters.html.erb
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<div id="fosters_tab_table" class="card">
<div id="fosters_tab_table" class="card col-6 col-xl-12">
<div class="card-body px-5">
Copy link
Collaborator

@kasugaijin kasugaijin Dec 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this will be a full width table above 1200px right? Then below this it will collapse into half width and flex will place items accordingly (referring to the use of flex-xl-row below).

I am curious how this looks as you drag screen width from 1200+px down. I imagine that we will show the row above 1200px then show 'cards' below 1200px. In my mind, there's a lot of possible devices (tablets or horizontal cell) that might do fine with a table row below 1200px? So XL might be a bit of a large breakpoint? Do you think we can set this breakpoint at Lg or even Md?

<% #headers %>
<div class="row border-bottom pb-3 pt-1">
<div class="col-4 fw-semibold">
<%= t("organizations.staff.pets.show.fosterer")%>
<% fosters.each do |foster|%>
<% #headers %>
<div class="row border-bottom pb-3 pt-1 d-none d-xl-flex">
<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>
<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>
Expand Down
17 changes: 10 additions & 7 deletions app/views/organizations/staff/pets/tabs/partials/_foster.html.erb
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
<div class="row pt-3" id="<%= dom_id(foster) %>">
<div class="row flex-column flex-xl-row py-2 align-items-start" id="<%= dom_id(foster) %>">
<!-- fosterer -->
<div class="align-middle col-4">
<div class="col-4 d-flex mb-4">
<%= link_to link_to "PLACEHOLDER FOR FORM ANSWERS", nil,
class: "link-underline link-underline-opacity-0" %>
</div>

<!-- status -->
<div class="align-middle col-2">
<div class="col-2 d-flex mb-4">
<div class="badge <%= status_classes(foster.status) %>">
<%= foster.status.to_s.titleize %>
</div>
</div>

<!-- start date -->
<div class="align-middle col-2">
<div class="col-2 d-flex mb-2">
<%= 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 %>
</div>
<!-- end date -->
<div class="align-middle col-2">
<div class="col-2 d-flex mb-2">
<%= 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 %>
</div>
<!-- delete -->
<div class="align-middle col-2">

<!-- delete -->
<div class="col-2 d-flex align-items-start">
<%= button_to t('general.delete'), staff_manage_foster_path(foster),
method: :delete,
class: "btn btn-outline-danger px-2 py-1",
Expand Down
Loading