mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
parent
50035d6945
commit
11136b9115
@ -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
|
||||
|
||||
@ -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'
|
||||
|
||||
@ -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
|
||||
|
||||
@ -95,10 +95,6 @@ function commission_basil(style) {
|
||||
-->
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 1.5rem; margin-bottom: 1rem;" class="card-panel yellow lighten-5 black-text">
|
||||
Image generation is a Premium feature, but this month (June 2025), all users can generate unlimited images for free!
|
||||
</div>
|
||||
<!--
|
||||
<div style="margin-top: 1.5rem; margin-bottom: 1rem;">
|
||||
<% unless current_user.on_premium_plan? %>
|
||||
<div class="orange lighten-2 card-panel">
|
||||
@ -119,7 +115,6 @@ function commission_basil(style) {
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
@ -39,10 +39,6 @@
|
||||
</div>
|
||||
<div class="col s12 m8 l9">
|
||||
|
||||
<div style="margin-top: 1.5rem; margin-bottom: 1rem;" class="card-panel yellow lighten-5">
|
||||
Image generation is a Premium feature, but this month (June 2025), all users can generate unlimited images for free!
|
||||
</div>
|
||||
<!--
|
||||
<% unless current_user.on_premium_plan? %>
|
||||
<div class="orange lighten-2 card-panel">
|
||||
<strong>
|
||||
@ -61,7 +57,6 @@
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
-->
|
||||
|
||||
<% if @universe_scope %>
|
||||
<div class="card-panel <%= Universe.color %> white-text">
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -15,7 +15,19 @@
|
||||
<span class="new badge <%= raw_model.class.color %> left" data-badge-caption="<%= tag %>"></span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= link_to user_tag_path(username: content.user.username, tag_slug: PageTagService.slug_for(tag)) do %>
|
||||
<%
|
||||
# Use browse_tag_path which doesn't require username if it's a globally browsable tag like artfight2025
|
||||
if PageTagService.slug_for(tag).downcase == 'artfight2025'
|
||||
path = browse_tag_path(tag_slug: 'artfight2025')
|
||||
elsif content.user.present? && content.user.username.present?
|
||||
# Fall back to user_tag_path if username is available
|
||||
path = user_tag_path(username: content.user.username, tag_slug: PageTagService.slug_for(tag))
|
||||
else
|
||||
# If neither condition is met, link to the page_tag route for this content type
|
||||
path = send("page_tag_#{raw_model.class.name.downcase.pluralize}_path", slug: PageTagService.slug_for(tag))
|
||||
end
|
||||
%>
|
||||
<%= link_to path do %>
|
||||
<span class="new badge <%= raw_model.class.color %> left" data-badge-caption="<%= tag %>"></span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user