Sha256: 76cd6a04f45eb64132a3af4e14c06292d519c806cbf3d0c4dbccc193962a9c07
Contents?: true
Size: 1.21 KB
Versions: 83
Compression:
Stored size: 1.21 KB
Contents
<% background_color = component[:attributes][:bgcolor] || "rgba(255, 255, 255, 0)" background_images = [] background_positions = [] background_sizes = [] has_background = !(background_color =~ /rgba\(\s*255\s*,\s*255\s*,\s*255\s*,\s*0\s*\)/) if component[:attributes] && component[:attributes].has_key?(:backgrounds) # retro-compatibility component[:attributes][:backgrounds].each do |item| image_data = item[:image] if image_data && image_data[:id] blob_id = image_data[:id] blob = ActiveStorage::Blob.find blob_id url = "url(#{url_for(blob)})" position = "#{item[:posh]} #{item[:posv]}" background_images << url background_positions << position background_sizes << item[:size] end end end %> <div class="row <%= promethee_class_for component %><%= ' promethee__component__row--background' if has_background %>" style="background-color: <%= background_color %>; <%= background_images.count > 0 ? "background-repeat: no-repeat; background-image: #{background_images.join(', ')}; background-position: #{background_positions.join(', ')}; background-size: #{background_sizes.join(', ')};" : '' %>"> <%= render 'promethee/show/components', components: component[:children] %> </div>
Version data entries
83 entries across 83 versions & 1 rubygems