From eac08a7d3e802cd81a54d4b89cbca67e3adbb8e8 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Sun, 6 Jul 2025 16:05:57 -0700 Subject: [PATCH] content#index polish for empty/null state content lists --- .../display/_tailwind_foldered_index.html.erb | 192 ++++++++++++++---- 1 file changed, 148 insertions(+), 44 deletions(-) diff --git a/app/views/content/display/_tailwind_foldered_index.html.erb b/app/views/content/display/_tailwind_foldered_index.html.erb index 5477af41..31080bc1 100644 --- a/app/views/content/display/_tailwind_foldered_index.html.erb +++ b/app/views/content/display/_tailwind_foldered_index.html.erb @@ -265,12 +265,32 @@
- <% if Rails.application.config.content_type_names.include?(content_type_name) %> - <%= link_to attribute_customization_path(content_type_name.downcase) do %> - + <% if @current_user_content.fetch(content_type_name, []).any? %> + <% if content.any? %> + +
+ +
+
+ <%= link_to attribute_customization_path(content_type_name.downcase), class: "group flex items-center px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900" do %> + tune + Customize template + <% end %> +
+
+
+ <% else %> + + <%= link_to attribute_customization_path(content_type_name.downcase) do %> + + <% end %> <% end %> <% end %> @@ -638,6 +658,35 @@ <% end %>
<% end %> + + + <% if @current_user_content.fetch(content_type_name, []).any? %> +
+ <%= link_to attribute_customization_path(content_type_name.downcase), class: "block" do %> +
+
+
+
+
+ tune +
+
Template
+
+
+
+
+

+ Customize +

+

+ Template +

+
+
+
+ <% end %> +
+ <% end %> @@ -707,46 +756,101 @@ <% else %> -
-
-
- <%= content_type_class.icon %> +
+
+ +
+
+ <%= content_type_class.icon %> +
+

Welcome to your <%= content_type_name.pluralize %>

+

+ Ready to start building your world? Choose how you'd like to begin your <%= content_type_name.downcase %> collection. +

-

No <%= content_type_name.pluralize.downcase %> yet

-

Get started by creating your first <%= content_type_name.downcase %>. You can also customize your template to organize information exactly how you want.

-
- <% if Rails.application.config.content_type_names.include?(content_type_name) %> - <%= link_to attribute_customization_path(content_type_name.downcase) do %> - - <% end %> - <% end %> - <% if current_user.can_create?(content_type_class) %> - <%= link_to new_polymorphic_path(content_type_class) do %> - - <% end %> - <% else %> - <%= link_to subscription_path do %> - - <% end %> - <% end %> - - <%= link_to attribute_customization_path(content_type_name.downcase) do %> - + +
+ +
+ <%= link_to attribute_customization_path(content_type_name.downcase), class: "block h-full" do %> +
+
+
+
+
+ tune +
+
Template
+
+
+
+
+

+ Customize +

+

+ Template +

+
+
+
+ <% end %> +
+ + + <% if current_user.can_create?(content_type_class) %> +
+ <%= link_to new_polymorphic_path(content_type_class), class: "block h-full" do %> +
+
+
+
+
+ <%= content_type_class.icon %> +
+
Create
+
+
+
+
+

+ New +

+

+ <%= content_type_name %> +

+
+
+
+ <% end %> +
+ <% else %> +
+ <%= link_to subscription_path, class: "block h-full" do %> +
+
+
+
+
+ star +
+
Premium
+
+
+
+
+

+ Upgrade +

+

+ Premium +

+
+
+
+ <% end %> +
<% end %>