style overview, sections only for now

This commit is contained in:
2022-11-29 15:57:10 +02:00
parent 4136eaf282
commit 15ef3c34fd
12 changed files with 105 additions and 6 deletions

View File

@ -48,7 +48,7 @@ module Merged
end
def save
file_name = Rails.root.join(@root , name + ".yaml")
file_name = Rails.root.join(@@root , name + ".yaml")
File.write( file_name , @content.to_yaml)
end

View File

@ -0,0 +1,35 @@
module Merged
class Style
include ActiveModel::API
attr_reader :content
def initialize content
@content = content
end
def template
@content["template"]
end
def header
@content["header"]
end
def text
@content["text"]
end
def cards
@content["cards"] == true
end
def preview
"merged/section_preview/" + template
end
def self.all
# should account for app styles. now just loading engines
@@styles = YAML.load_file(Engine.root.join("config/styles.yaml"))
@@styles.collect{ |content| Style.new(content) }
end
end
end