diff --git a/app/models/page_types/content_page.rb b/app/models/page_types/content_page.rb index b9f4c22f..5f762e4a 100644 --- a/app/models/page_types/content_page.rb +++ b/app/models/page_types/content_page.rb @@ -35,7 +35,15 @@ class ContentPage < ApplicationRecord end def favorite? - !!favorite + # Handle different formats that might come from SQL queries + case favorite + when true, 1, "1", "true" + true + when false, 0, "0", "false", nil + false + else + !!favorite + end end def view_path diff --git a/app/views/content/display/_tailwind_foldered_index.html.erb b/app/views/content/display/_tailwind_foldered_index.html.erb index 9fb7baf1..56c3912f 100644 --- a/app/views/content/display/_tailwind_foldered_index.html.erb +++ b/app/views/content/display/_tailwind_foldered_index.html.erb @@ -505,56 +505,27 @@
<% content.each do |item| %>
@@ -570,7 +541,7 @@ <%= image_tag item_image, class: 'h-48 w-full object-cover' %>
-
+

<%= item.page_type %>

@@ -578,23 +549,21 @@ <%= item.name %>
- <% if item.respond_to?(:favorite?) %> - - <% end %>
<% end %> + <% if item.respond_to?(:favorite?) %> + + <% end %>
<% end %>
@@ -605,60 +574,31 @@
<% content.each_with_index do |item, index| %>
- <%= link_to (item.is_a?(ContentPage) ? item.view_path : item), class: "flex items-center p-4 space-x-4" do %> + <%= link_to (item.is_a?(ContentPage) ? item.view_path : item), class: "flex items-center p-4 space-x-4 pr-16" do %>
<% item_image = nil @@ -673,23 +613,21 @@

<%= item.name %>

<%= item.page_type %>

-
- <% if item.respond_to?(:favorite?) %> - - <% end %> +
chevron_right
<% end %> + <% if item.respond_to?(:favorite?) %> + + <% end %>
<% end %>
@@ -768,6 +706,42 @@