diff --git a/app/controllers/basil_controller.rb b/app/controllers/basil_controller.rb index 3a16142a..481bd723 100644 --- a/app/controllers/basil_controller.rb +++ b/app/controllers/basil_controller.rb @@ -207,7 +207,7 @@ class BasilController < ApplicationController @in_progress_commissions = @commissions.select { |c| c.completed_at.nil? } @generated_images_count = current_user.basil_commissions.with_deleted.count - @can_request_another = (true || current_user.on_premium_plan?) || @generated_images_count < BasilService::FREE_IMAGE_LIMIT + @can_request_another = current_user.on_premium_plan? || @generated_images_count < BasilService::FREE_IMAGE_LIMIT @can_request_another = @can_request_another && @in_progress_commissions.count < BasilService::MAX_JOB_QUEUE_SIZE end @@ -454,7 +454,7 @@ class BasilController < ApplicationController def commission @generated_images_count = current_user.basil_commissions.with_deleted.count - if false && !current_user.on_premium_plan? && @generated_images_count > BasilService::FREE_IMAGE_LIMIT + if !current_user.on_premium_plan? && @generated_images_count > BasilService::FREE_IMAGE_LIMIT redirect_back fallback_location: basil_path, notice: "You've reached your free image limit. Please upgrade to generate more images." return end diff --git a/app/controllers/browse_controller.rb b/app/controllers/browse_controller.rb index 7f84cc88..3a28efa3 100644 --- a/app/controllers/browse_controller.rb +++ b/app/controllers/browse_controller.rb @@ -158,6 +158,7 @@ class BrowseController < ApplicationController # Set a default accent color for the page @accent_color = 'purple' + # Sort content types so Characters always appear first @tagged_content = @tagged_content.sort_by do |content_group| if content_group[:type] == 'Character' diff --git a/app/controllers/content_controller.rb b/app/controllers/content_controller.rb index 8ced2f79..3d3951a8 100644 --- a/app/controllers/content_controller.rb +++ b/app/controllers/content_controller.rb @@ -3,7 +3,7 @@ # TODO: we should probably spin off an Api::ContentController for #api_sort and anything else # api-wise we need class ContentController < ApplicationController - before_action :authenticate_user!, except: [:show, :changelog, :api_sort] \ + before_action :authenticate_user!, except: [:show, :changelog, :api_sort, :gallery] \ + Rails.application.config.content_types[:all_non_universe].map { |type| type.name.downcase.pluralize.to_sym } skip_before_action :cache_most_used_page_information, only: [ @@ -430,6 +430,7 @@ class ContentController < ApplicationController # Get all images for this content with proper ordering # Only show private images to the owner or contributors is_owner_or_contributor = false + # Check if the user is the owner or a contributor if current_user.present? && (@content.user == current_user || (@content.respond_to?(:universe_id) && @content.universe_id.present? && @@ -854,6 +855,21 @@ class ContentController < ApplicationController @navbar_actions = [] return if [AttributeCategory, AttributeField].include?(content_type) + + # Set up navbar actions for gallery specifically + if action_name == 'gallery' && @content.present? + # Add a link to view the content page + @navbar_actions << { + label: @content.name, + href: polymorphic_path(@content) + } + + # Add a gallery title indicator + @navbar_actions << { + label: 'Gallery', + href: send("gallery_#{@content.class.name.downcase}_path", @content) + } + end end def set_sidenav_expansion diff --git a/app/views/basil/content.html.erb b/app/views/basil/content.html.erb index 8c84a401..2b6161cf 100644 --- a/app/views/basil/content.html.erb +++ b/app/views/basil/content.html.erb @@ -95,10 +95,6 @@ function commission_basil(style) { --> -