From 0ba0cff5e512ed3c411374e1b65a80c4d8a93bfd Mon Sep 17 00:00:00 2001 From: Virginia Dooley <7017118+VirginiaDooley@users.noreply.github.com> Date: Thu, 4 Dec 2025 11:24:47 +0000 Subject: [PATCH 1/2] resize columns and padding for more device flexibility --- .../_representatives_table.html.erb | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/views/representatives/_representatives_table.html.erb b/app/views/representatives/_representatives_table.html.erb index 4f541a7a..4ec03b4e 100644 --- a/app/views/representatives/_representatives_table.html.erb +++ b/app/views/representatives/_representatives_table.html.erb @@ -1,35 +1,35 @@ <%# app/views/pages/_representatives_table.html.erb %> <% if representatives.present? %>
- +
- - + + <% representatives.each do |rep_obj| %> <% rep = rep_obj.is_a?(Hash) ? rep_obj : rep_obj.respond_to?(:data) ? rep_obj.data : {} %> <% initials = rep["name"].to_s.split.size >= 2 ? rep["name"].to_s.split.first[0] + rep["name"].to_s.split.last[0] : rep["name"].to_s[0,2] rescue '??' %> - - + - - - -
+
<% if rep["image"] %>
- " alt="<%= rep["name"] || 'Representative' %>" class="h-28 w-28 sm:h-32 sm:w-32 md:h-24 md:w-24 rounded-lg object-cover" onerror="this.style.display='none';this.nextElementSibling.style.display='flex';"> - + " alt="<%= rep["name"] || 'Representative' %>" class="h-32 w-32 sm:h-36 sm:w-36 md:h-36 md:w-36 rounded-lg object-cover" onerror="this.style.display='none';this.nextElementSibling.style.display='flex';"> +
<% else %> -
<%= initials %>
+
<%= initials %>
<% end %>
+
<%= rep["name"].presence || '-' %>
+ <% office_text = rep["office"].presence || rep["title"].presence || rep["level"].presence || rep["position"].presence || rep["role"].presence %> <% if rep["other_names"].present? && rep["other_names"].is_a?(Array) %> <% names = rep["other_names"].map { |n| n.is_a?(Hash) ? n["name"] : n.to_s }.reject(&:blank?) %> @@ -45,7 +45,7 @@
<%= office_text %>
<% end %>
+ <% email = (rep["contact_details"]&.find { |c| c["type"] == 'email' }&.dig("value") rescue nil) || rep["email"] || rep["contact_email"] %> <% phone = (rep["contact_details"]&.find { |c| c["type"] == 'phone' }&.dig("value") rescue nil) || rep["phone"] || rep["contact_phone"] %> <% if email.present? || phone.present? %> @@ -61,7 +61,7 @@
-
<% end %>
+ <% all_links = [] %> <% website = rep["website"] || rep["url"] || rep["official_website"] %> <% if website.present? %> From ede5720b38f85ea2aaa3184df9a7501607b2355f Mon Sep 17 00:00:00 2001 From: Virginia Dooley <7017118+VirginiaDooley@users.noreply.github.com> Date: Thu, 4 Dec 2025 11:25:07 +0000 Subject: [PATCH 2/2] stop search results from spilling outside container' --- app/views/dashboard/_address_search.html.erb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/dashboard/_address_search.html.erb b/app/views/dashboard/_address_search.html.erb index 49667bf3..a4f6d40b 100644 --- a/app/views/dashboard/_address_search.html.erb +++ b/app/views/dashboard/_address_search.html.erb @@ -15,9 +15,11 @@ <% reps = (defined?(representatives) ? representatives : @representatives) %> <% did_search = (defined?(searched) ? searched : @searched) %> <% if did_search %> -
- <%= render partial: 'representatives_table', locals: { representatives: reps } %> -
+
+
+ <%= render partial: 'representatives_table', locals: { representatives: reps } %> +
+
<% end %>