change views to use objects instead of yaml

This commit is contained in:
2022-12-02 11:10:38 +02:00
parent 4f6538e135
commit 48cfcb592d
14 changed files with 55 additions and 42 deletions

View File

@ -2,19 +2,19 @@ module Merged
module ViewHelper
# section should be hash with at least 'template' key
def find_template(section)
"merged/view/" + section["template"]
"merged/view/" + section.template
end
def bg(section)
puts "--#{Image.root}/#{section['image']}--"
img = asset_url( "#{Image.root}/#{section['image']}" )
puts "--#{Image.image_root}/#{section.image}--"
img = asset_url( "#{Image.image_root}/#{section.image}" )
"background-image: url('#{img}');"
end
def image_for(section , classes)
image_tag("#{Image.root}/#{section['image']}" , class: classes)
image_tag("#{Image.image_root}/#{section.image}" , class: classes)
end
def has_button(section)
section['button']
section.content['button']
end
end
end