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

Version Path
promethee-2.0.7 app/views/promethee/components/row/_show.html.erb
promethee-2.0.6 app/views/promethee/components/row/_show.html.erb
promethee-2.0.5 app/views/promethee/components/row/_show.html.erb
promethee-2.0.4 app/views/promethee/components/row/_show.html.erb
promethee-2.0.3 app/views/promethee/components/row/_show.html.erb
promethee-2.0.2 app/views/promethee/components/row/_show.html.erb
promethee-2.0.1 app/views/promethee/components/row/_show.html.erb
promethee-2.0.0 app/views/promethee/components/row/_show.html.erb
promethee-1.11.29 app/views/promethee/components/row/_show.html.erb
promethee-1.11.28 app/views/promethee/components/row/_show.html.erb
promethee-1.11.27 app/views/promethee/components/row/_show.html.erb
promethee-1.11.26 app/views/promethee/components/row/_show.html.erb
promethee-1.11.25 app/views/promethee/components/row/_show.html.erb
promethee-1.11.24 app/views/promethee/components/row/_show.html.erb
promethee-1.11.23 app/views/promethee/components/row/_show.html.erb
promethee-1.11.22 app/views/promethee/components/row/_show.html.erb
promethee-1.11.21 app/views/promethee/components/row/_show.html.erb
promethee-1.11.20 app/views/promethee/components/row/_show.html.erb
promethee-1.11.19 app/views/promethee/components/row/_show.html.erb
promethee-1.11.18 app/views/promethee/components/row/_show.html.erb