2022-11-22 15:42:20 +01:00
|
|
|
module CmsHelper
|
2022-11-22 18:44:34 +01:00
|
|
|
# sectio should be hash with at least 'template' key
|
|
|
|
def find_template(section)
|
|
|
|
"sections/" + section["template"]
|
|
|
|
end
|
|
|
|
|
|
|
|
def bg(section)
|
|
|
|
#{'background-image' => url('#{image_url('cms/' + section['image'])}')}
|
|
|
|
img = image_url "cms/house.jpg"
|
|
|
|
"background-image: url('#{img}');"
|
|
|
|
end
|
2022-11-23 10:05:22 +01:00
|
|
|
def image_for(section , classes)
|
|
|
|
image_tag("cms/#{section['image']}" , class: classes)
|
|
|
|
end
|
|
|
|
def has_button(section)
|
|
|
|
section['button']
|
|
|
|
end
|
2022-11-22 15:42:20 +01:00
|
|
|
end
|