From 1577eccc7bf890616667a25b4f36e047c60f3576 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Tue, 18 Apr 2023 19:55:08 -0700 Subject: [PATCH] auto-expand worldbuilding sidebar pages --- app/controllers/customization_controller.rb | 6 ++---- app/views/layouts/tailwind.html.erb | 7 ++++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/controllers/customization_controller.rb b/app/controllers/customization_controller.rb index 246a883d..909a3bf9 100644 --- a/app/controllers/customization_controller.rb +++ b/app/controllers/customization_controller.rb @@ -1,16 +1,14 @@ class CustomizationController < ApplicationController layout 'tailwind' - # todo require login for all actions :O - + before_action :authenticate_user! before_action :verify_content_type_can_be_toggled, only: [:toggle_content_type] def content_types - return redirect_to(root_path) unless user_signed_in? - @all_content_types = Rails.application.config.content_types[:all] @premium_content_types = Rails.application.config.content_types[:premium] @my_activators = current_user.user_content_type_activators.pluck(:content_type) + @sidenav_expansion = 'worldbuilding' @page_title = "Customize your notebook pages" end diff --git a/app/views/layouts/tailwind.html.erb b/app/views/layouts/tailwind.html.erb index 1e52b3d8..c96033e3 100644 --- a/app/views/layouts/tailwind.html.erb +++ b/app/views/layouts/tailwind.html.erb @@ -38,7 +38,7 @@ <% end %> --> -
+
book @@ -59,6 +59,11 @@ <% end %> <% end %> + + <%= link_to main_app.customization_content_types_path, class: 'flex items-center px-4 py-2 cursor-pointer group hover:bg-notebook-blue hover:text-white rounded-l-full' do %> + add + Add more... + <% end %>