new cards

This commit is contained in:
2022-12-02 23:22:43 +02:00
parent 6287373dae
commit 1e452ca62a
8 changed files with 62 additions and 22 deletions

View File

@ -6,17 +6,19 @@ module Merged
"merged/view/" + section.template
end
# background image as inline style
def bg(section)
return "" if section.image.blank?
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.image_root}/#{section.image}" , class: classes)
end
def has_button(section)
section.content['button']
# works for with sections and cards that respond to .image
def image_for(element , classes)
return "" if element.image.blank?
image_tag("#{Image.image_root}/#{element.image}" , class: classes)
end
end
end