From c50aed74a97f9822d11b491023fea7835fa7e559 Mon Sep 17 00:00:00 2001 From: drusepth Date: Mon, 9 Jan 2023 15:33:41 -0800 Subject: [PATCH] allow creating folders from content pages with modal --- app/controllers/content_controller.rb | 6 +- .../display/_tailwind_foldered_index.html.erb | 1045 +++++++++-------- 2 files changed, 530 insertions(+), 521 deletions(-) diff --git a/app/controllers/content_controller.rb b/app/controllers/content_controller.rb index fd93f994..48a64f95 100644 --- a/app/controllers/content_controller.rb +++ b/app/controllers/content_controller.rb @@ -56,9 +56,9 @@ class ContentController < ApplicationController @content = @content.sort_by {|x| [x.favorite? ? 0 : 1, x.name] } @folders = current_user - .folders - .where(context: @content_type_name, parent_folder_id: nil) - .order('title ASC') + .folders + .where(context: @content_type_name, parent_folder_id: nil) + .order('title ASC') @questioned_content = @content.sample @attribute_field_to_question = SerendipitousService.question_for(@questioned_content) diff --git a/app/views/content/display/_tailwind_foldered_index.html.erb b/app/views/content/display/_tailwind_foldered_index.html.erb index bacb7cca..2896b6f2 100644 --- a/app/views/content/display/_tailwind_foldered_index.html.erb +++ b/app/views/content/display/_tailwind_foldered_index.html.erb @@ -11,586 +11,595 @@ end %> - -
- -
- -
-
-
- Workflow -
-
- +
+
+ +
+ +
+
+
+ Workflow +
+
+ +
-
-
-
+
+
- -
-
- <%= image_tag asset_path(header_image), class: 'h-32 w-full object-cover lg:h-48' %> -
+ +
+
+ <%= image_tag asset_path(header_image), class: 'h-32 w-full object-cover lg:h-48' %> +
-
-
-
- <% if @universe_scope %> - <%= link_to @universe_scope do %> - <%= image_tag @universe_scope.random_image_including_private(format: :hero), class: 'h-24 w-24 rounded-full ring-4 ring-purple-800 sm:h-32 sm:w-32' %> - <% end %> - <% else %> - <%= image_tag current_user.image_url, class: 'h-24 w-24 rounded-full ring-4 ring-green-800 sm:h-32 sm:w-32' %> - <% end %> -
-
-
-

- Showing <%= pluralize content.count, content_type_name.downcase %> -

+
+
+
<% if @universe_scope %> -
- in <%= link_to @universe_scope.name, @universe_scope, class: Universe.text_color %> -
- <% end %> -
-
- <%= link_to attribute_customization_path(content_type_name.downcase) do %> - - <% end %> - - <% if current_user.can_create?(content_type_class) || PermissionService.user_has_active_promotion_for_this_content_type(user: current_user, content_type: content_type_class.name) %> - <%= link_to new_polymorphic_path(content_type_class) do %> - + <%= link_to @universe_scope do %> + <%= image_tag @universe_scope.random_image_including_private(format: :hero), class: 'h-24 w-24 rounded-full ring-4 ring-purple-800 sm:h-32 sm:w-32' %> <% end %> <% else %> - <%= link_to subscription_path do %> - - <% end %> + <%= image_tag current_user.image_url, class: 'h-24 w-24 rounded-full ring-4 ring-green-800 sm:h-32 sm:w-32' %> <% end %>
-
-
- -
-
- - -
- -
- - -
+ + + + + +
-
- -