Sha256: d96f47fdccc20e6f8d9ca09bcbb9def7d2a8d9e6232e1fdc1f9702c8a909c608

Contents?: true

Size: 1.06 KB

Versions: 5

Compression:

Stored size: 1.06 KB

Contents

<%
background_color = "rgba(255, 255, 255, 1)" || component[:attributes][:bgcolor]
background_images = []
background_positions = []
background_sizes = []

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 %>" 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

5 entries across 5 versions & 1 rubygems

Version Path
promethee-1.6.34 app/views/promethee/components/row/_show.html.erb
promethee-1.6.33 app/views/promethee/components/row/_show.html.erb
promethee-1.6.32 app/views/promethee/components/row/_show.html.erb
promethee-1.6.31 app/views/promethee/components/row/_show.html.erb
promethee-1.6.30 app/views/promethee/components/row/_show.html.erb