test harness is back, and pages fixed after refactor

This commit is contained in:
2022-12-08 17:16:29 +02:00
parent a8aa16170a
commit 308b9e1d2e
22 changed files with 257 additions and 23 deletions

View File

@ -60,7 +60,7 @@ module Merged
end
def template_style
Style.cards[ section.card_template ]
CardStyle.cards[ section.card_template ]
end
def allowed_fields
template_style.fields
@ -68,7 +68,7 @@ module Merged
def self.build_data(card_template)
data = { "id" => SecureRandom.hex(10) }
Style.cards[ card_template ].fields.each do |key|
CardStyle.cards[ card_template ].fields.each do |key|
data[key] = key.upcase
end
data

View File

@ -1,6 +1,8 @@
module Merged
class Option
@@options = {}
attr_reader :name , :default , :description
def initialize(options)
@ -30,6 +32,10 @@ module Merged
@values.split(" ")
end
def self.options
@@options
end
def self.load(yaml)
yaml.each do |content|
option = Option.new(content)

View File

@ -49,7 +49,7 @@ module Merged
end
def template_style
Style.sections[ template ]
SectionStyle.sections[ template ]
end
def allowed_fields