diff --git a/app/controllers/content_controller.rb b/app/controllers/content_controller.rb index 9ac5107f..797826c4 100644 --- a/app/controllers/content_controller.rb +++ b/app/controllers/content_controller.rb @@ -523,7 +523,7 @@ class ContentController < ApplicationController @navbar_actions << { label: "New #{content_type.name.downcase}", href: main_app.new_polymorphic_path(content_type) - } + } if current_user.can_create?(content_type) discussions_link = ForumsLinkbuilderService.worldbuilding_url(content_type) if discussions_link.present? @@ -551,11 +551,11 @@ class ContentController < ApplicationController href: main_app.polymorphic_path(content_type) } end - # - # @navbar_actions << { - # label: "New #{content_type.name.downcase}", - # href: main_app.new_polymorphic_path(content_type) - # } + + @navbar_actions << { + label: "New #{content_type.name.downcase}", + href: main_app.new_polymorphic_path(content_type) + } end end diff --git a/app/services/subscription_service.rb b/app/services/subscription_service.rb index 75282b56..de365cac 100644 --- a/app/services/subscription_service.rb +++ b/app/services/subscription_service.rb @@ -13,7 +13,9 @@ class SubscriptionService < Service # Add any one-time referral bonuses add_any_referral_bonuses(user, plan_id) - user.update(selected_billing_plan_id: related_plan.id) + # We intentionally skip callbacks on this to ensure the billing plan changes even on invalid users + user.update_column(:selected_billing_plan_id, related_plan.id) + user.subscriptions.create( billing_plan: related_plan, start_date: DateTime.now, diff --git a/app/views/content/list/_cards.html.erb b/app/views/content/list/_cards.html.erb index f2fc986f..ff1d745a 100644 --- a/app/views/content/list/_cards.html.erb +++ b/app/views/content/list/_cards.html.erb @@ -88,5 +88,22 @@ <% end %> + <% else %> +
+ <%= content_type.icon %> +
++ An active + <%= link_to 'Notebook.ai Premium', subscription_path, class: 'blue-text text-darken-2' %> subscription + is required to create additional + <%= content_type.name.downcase %> pages, but pages you've already created will always + be available here. +
+