From df916b150b910a1d4278925a44bcb06ca98203e3 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Fri, 31 Mar 2023 22:48:41 -0700 Subject: [PATCH] cleanup --- app/controllers/basil_controller.rb | 20 +-------------- app/services/basil_service.rb | 20 +++++++++++++++ .../content/display/sidebar/_apps.html.erb | 25 +++++++++++-------- 3 files changed, 35 insertions(+), 30 deletions(-) diff --git a/app/controllers/basil_controller.rb b/app/controllers/basil_controller.rb index e387f3d9..03f10592 100644 --- a/app/controllers/basil_controller.rb +++ b/app/controllers/basil_controller.rb @@ -6,25 +6,7 @@ class BasilController < ApplicationController def index disabled_content_types = [Universe] - @enabled_content_types = [ - Character, Location, Item, - Creature, Flora, - Food, Planet, - Landmark, Town, - - # TODO improve these before release, if possible; otherwise disable - # Building, Vehicle, - - # TODO before release - # Continent, Country, - # Creature, Deity, - # Magic, School, Sport, Technology, - # Tradition - - # Probably won't do before release - # Condition, Government, Group, Job, Language, Lore, - # Race, Religion, Scene - ].map(&:name) + @enabled_content_types = BasilService::ENABLED_PAGE_TYPES @content_type = params[:content_type].try(:humanize) || 'Character' if @content_type.present? diff --git a/app/services/basil_service.rb b/app/services/basil_service.rb index 7a36ce32..402059e3 100644 --- a/app/services/basil_service.rb +++ b/app/services/basil_service.rb @@ -1,6 +1,26 @@ class BasilService < Service IGNORED_VALUES = ['', 'none', 'n/a', '.', '-', ' ', '?', '??', '???', 'x', nil] + ENABLED_PAGE_TYPES = [ + Character, Location, Item, + Creature, Flora, + Food, Planet, + Landmark, Town, + + # TODO improve these before release, if possible; otherwise disable + # Building, Vehicle, + + # TODO before release + # Continent, Country, + # Creature, Deity, + # Magic, School, Sport, Technology, + # Tradition + + # Probably won't do before release + # Condition, Government, Group, Job, Language, Lore, + # Race, Religion, Scene + ].map(&:name) + def self.enabled_styles_for(page_type) case page_type when 'Character' diff --git a/app/views/content/display/sidebar/_apps.html.erb b/app/views/content/display/sidebar/_apps.html.erb index 89e23ca6..11a097f9 100644 --- a/app/views/content/display/sidebar/_apps.html.erb +++ b/app/views/content/display/sidebar/_apps.html.erb @@ -1,17 +1,20 @@ <% creating = defined?(creating) && creating editing = defined?(editing) && editing + page_type_enabled = BasilService::ENABLED_PAGE_TYPES.include? content.class_name %> - +<% end %> \ No newline at end of file