Skip to content

Commit 50163a4

Browse files
committed
enable items for basil
1 parent b876973 commit 50163a4

File tree

3 files changed

+33
-10
lines changed

3 files changed

+33
-10
lines changed

app/controllers/basil_controller.rb

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@ class BasilController < ApplicationController
44
before_action :require_admin_access, only: [:review], unless: -> { Rails.env.development? }
55

66
def index
7-
@enabled_content_types = [Character, Location].map(&:name)
7+
disabled_content_types = [Universe]
8+
9+
@enabled_content_types = [
10+
Character, Location, Item,
11+
# Building, Condition, Continent, Country,
12+
# Creature, Deity, Flora, Food, Government, Group, Job, Landmark, Language,
13+
# Lore, Magic, Planet, Race, Religion, Scene, School, Sport, Technology,
14+
# Town, Tradition, Vehicle
15+
].map(&:name)
816

917
@content_type = params[:content_type].try(:humanize) || 'Character'
1018
if @content_type.nil? || !@enabled_content_types.include?(@content_type)
@@ -30,6 +38,7 @@ def content
3038
# and format them into an array of [field, value] pairs to pass to the view
3139
@relevant_fields = []
3240

41+
# TODO: either move this to the default field template (metadata for each field) or to a BasilService
3342
case @content_type
3443
when 'Character'
3544
@relevant_fields.push BasilService.include_specific_field(current_user, @content, 'Overview', 'Gender')
@@ -325,16 +334,28 @@ def commission
325334
"Name",
326335
"Identifying Marks",
327336
"Type",
328-
"Description"
337+
"Description",
338+
"Body Type",
339+
"Item type",
329340
].map(&:downcase)
330341
field_importance_multipliers = {
331-
'hair': 1.15,
332-
'hair color': 1.55,
333-
'hair style': 1.10,
334-
'skin tone': 1.05,
335-
'race': 1.10,
336-
'eye color': 1.05,
337-
'gender': 1.15
342+
'hair': 1.15,
343+
'hair color': 1.55,
344+
'hair style': 1.10,
345+
'skin tone': 1.05,
346+
'race': 1.10,
347+
'eye color': 1.05,
348+
'gender': 1.15,
349+
'description': 1.00,
350+
'item type': 1.55,
351+
'type': 1.15,
352+
'type of building': 1.25,
353+
'type of condition': 1.25,
354+
'type of food': 1.15,
355+
'type of landmark': 1.25,
356+
'type of magic': 1.25,
357+
'type of school': 1.25,
358+
'type of vehicle': 1.25
338359
}
339360
label_value_pairs_to_skip_entirely = [
340361
['race', 'human']

app/services/basil_service.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ def self.enabled_styles_for(page_type)
77
%w(realistic painting sketch digital abstract)
88
when 'Location'
99
%w(realistic painting sketch)
10+
when 'Item'
11+
%w(realistic painting sketch)
1012
else
1113
%w(Default)
1214
end

lib/tasks/data_migrations.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
namespace :data_migrations do
2-
desc "Attach S3 images to BasilCommissioms"
2+
desc "Attach S3 images to BasilCommissions"
33
task attach_s3_images_to_basil_commissions: :environment do
44
BasilCommission.find_each do |commission|
55
# Skip if we've already attached an image

0 commit comments

Comments
 (0)