This commit is contained in:
Andrew Brown 2023-03-31 22:48:41 -07:00
parent 470569e98f
commit df916b150b
3 changed files with 35 additions and 30 deletions

View File

@ -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?

View File

@ -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'

View File

@ -1,17 +1,20 @@
<%
creating = defined?(creating) && creating
editing = defined?(editing) && editing
page_type_enabled = BasilService::ENABLED_PAGE_TYPES.include? content.class_name
%>
<ul class="collection content-tabs">
<li class="active center grey-text uppercase">
Tools
</li>
<% if page_type_enabled %>
<ul class="collection content-tabs">
<li class="active center grey-text uppercase">
Tools
</li>
<li class="collection-item">
<%= link_to basil_content_path(content_type: content.class_name, id: content.id) do %>
<i class="material-icons left">palette</i>
Image Generation
<% end %>
</li>
</ul>
<li class="collection-item">
<%= link_to basil_content_path(content_type: content.class_name, id: content.id) do %>
<i class="material-icons left">palette</i>
Image Generation
<% end %>
</li>
</ul>
<% end %>