From 65ad86d9deeda5c06fdde060680180e343dabcb7 Mon Sep 17 00:00:00 2001 From: Aaryan <53212802+Aaryanpal@users.noreply.github.com> Date: Wed, 11 Sep 2024 01:04:35 +0530 Subject: [PATCH] Added condition to handle null state (#965) --- .../adopter_applications/_applications_table.html.erb | 9 +++++++++ .../organizations/adopter_fosterer/likes/index.html.erb | 4 ++++ config/locales/en.yml | 2 ++ 3 files changed, 15 insertions(+) diff --git a/app/views/organizations/adopter_fosterer/adopter_applications/_applications_table.html.erb b/app/views/organizations/adopter_fosterer/adopter_applications/_applications_table.html.erb index 7b1d548ad..ec86d4b90 100644 --- a/app/views/organizations/adopter_fosterer/adopter_applications/_applications_table.html.erb +++ b/app/views/organizations/adopter_fosterer/adopter_applications/_applications_table.html.erb @@ -12,6 +12,8 @@ + <% if applications.present? %> + <% applications.each do |app| %> <%= turbo_stream_from app %> <% pet = app.pet %> @@ -49,6 +51,13 @@ <% end %> + <% else %> + + + <%= t("dashboard.applications.no_applications")%> + + + <%end%> diff --git a/app/views/organizations/adopter_fosterer/likes/index.html.erb b/app/views/organizations/adopter_fosterer/likes/index.html.erb index a57ee4b2d..03b2c177c 100644 --- a/app/views/organizations/adopter_fosterer/likes/index.html.erb +++ b/app/views/organizations/adopter_fosterer/likes/index.html.erb @@ -3,6 +3,7 @@ <% c.with_body do %>
+ <% if @pets.present? %> <% @pets.each do |pet| %>
@@ -16,6 +17,9 @@
<% end %> + <% else %> +

<%= t('organizations.adopter_fosterer.likes.index.no_pets')%>

+ <%end %>
<% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 5c0d1f9b5..b06969ab2 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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" @@ -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."