Sha256: dec4c885786c5827c88723b51779f12361059ebf50f118f932f466acb96e27c7

Contents?: true

Size: 1.01 KB

Versions: 13

Compression:

Stored size: 1.01 KB

Contents

<%
background_color = component[:attributes][:bgcolor]
background_images = []
background_positions = []
background_sizes = []

if 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

13 entries across 13 versions & 1 rubygems

Version Path
promethee-1.6.29 app/views/promethee/components/row/_show.html.erb
promethee-1.6.28 app/views/promethee/components/row/_show.html.erb
promethee-1.6.27 app/views/promethee/components/row/_show.html.erb
promethee-1.6.26 app/views/promethee/components/row/_show.html.erb
promethee-1.6.25 app/views/promethee/components/row/_show.html.erb
promethee-1.6.24 app/views/promethee/components/row/_show.html.erb
promethee-1.6.23 app/views/promethee/components/row/_show.html.erb
promethee-1.6.22 app/views/promethee/components/row/_show.html.erb
promethee-1.6.21 app/views/promethee/components/row/_show.html.erb
promethee-1.6.20 app/views/promethee/components/row/_show.html.erb
promethee-1.6.19 app/views/promethee/components/row/_show.html.erb
promethee-1.6.18 app/views/promethee/components/row/_show.html.erb
promethee-1.6.16 app/views/promethee/components/row/_show.html.erb