Sha256: 67bcb8df94fbfc1c855a2a0f0a0887b9a9cd45eea13968d11f22b37b936f6c44

Contents?: true

Size: 1.15 KB

Versions: 19

Compression:

Stored size: 1.15 KB

Contents

<%
background_color = component[:attributes].dig(:bgcolor, :value)&.to_s || "rgba(255, 255, 255, 0)"
backgrounds = component[:attributes].dig(:backgrounds, :value)
background_images = []
background_positions = []
background_sizes = []

has_background = !(background_color =~ /rgba\(\s*255\s*,\s*255\s*,\s*255\s*,\s*0\s*\)/)

if backgrounds
  backgrounds.each do |item|
    blob = blob_from_data item.dig(:image, :value)
    if blob
      url = "url(#{url_for(blob)})"
      position = "#{item.dig(:posh, :value)} #{item.dig(:posv, :value)}"
      background_images << url
      background_positions << position
      background_sizes << item.dig(:size, :value)
    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

19 entries across 19 versions & 1 rubygems

Version Path
promethee-4.1.9 app/views/promethee/components/row/_show.html.erb
promethee-4.1.8 app/views/promethee/components/row/_show.html.erb
promethee-4.1.7 app/views/promethee/components/row/_show.html.erb
promethee-4.1.6 app/views/promethee/components/row/_show.html.erb
promethee-4.1.5 app/views/promethee/components/row/_show.html.erb
promethee-4.1.4 app/views/promethee/components/row/_show.html.erb
promethee-4.1.3 app/views/promethee/components/row/_show.html.erb
promethee-4.1.2 app/views/promethee/components/row/_show.html.erb
promethee-4.1.1 app/views/promethee/components/row/_show.html.erb
promethee-4.1.0 app/views/promethee/components/row/_show.html.erb
promethee-4.0.8 app/views/promethee/components/row/_show.html.erb
promethee-4.0.7 app/views/promethee/components/row/_show.html.erb
promethee-4.0.6 app/views/promethee/components/row/_show.html.erb
promethee-4.0.5 app/views/promethee/components/row/_show.html.erb
promethee-4.0.4 app/views/promethee/components/row/_show.html.erb
promethee-4.0.3 app/views/promethee/components/row/_show.html.erb
promethee-4.0.2 app/views/promethee/components/row/_show.html.erb
promethee-4.0.1 app/views/promethee/components/row/_show.html.erb
promethee-4.0.0 app/views/promethee/components/row/_show.html.erb