Skip to content

Commit

Permalink
Added condition to handle null state (rubyforgood#965)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaryanpal authored Sep 10, 2024
1 parent 8b8f033 commit 65ad86d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
</tr>
</thead>
<tbody>
<% if applications.present? %>

<% applications.each do |app| %>
<%= turbo_stream_from app %>
<% pet = app.pet %>
Expand Down Expand Up @@ -49,6 +51,13 @@
</td>
</tr>
<% end %>
<% else %>
<tr>
<td colspan="4" class="text-center">
<%= t("dashboard.applications.no_applications")%>
</td>
</tr>
<%end%>
</tbody>
</table>
</div>
4 changes: 4 additions & 0 deletions app/views/organizations/adopter_fosterer/likes/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<% c.with_body do %>
<div class="justify-content-md-between mb-4 mb-xl-0 gx-3">
<div class="row">
<% if @pets.present? %>
<% @pets.each do |pet| %>
<div class="col-lg-4 col-md-6 p-2">
<div class="pet-box p-3 border rounded bg-white d-flex align-items-center">
Expand All @@ -16,6 +17,9 @@
</div>
</div>
<% end %>
<% else %>
<p class = "text-center"><%= t('organizations.adopter_fosterer.likes.index.no_pets')%></p>
<%end %>
</div>
</div>
<% end %>
Expand Down
2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ en:
status: Status
withdraw_application: Withdraw Application
confirm_withdraw: Withdraw your application
no_applications: You do not have any adoption applications
root:
index:
title: "Manage"
Expand Down Expand Up @@ -593,6 +594,7 @@ en:
likes:
index:
liked_pets: 'Liked Pets'
no_pets: 'You do not have any liked pets'
create:
success: "%{name} added to your liked pets."
failed: "Error, %{name} not added to your liked pets."
Expand Down

0 comments on commit 65ad86d

Please sign in to comment.