Sha256: 71fd5ae12dfd5ba4458318bc2ee9e86f4a09baff5a15ee82442acaacb6d75d6c

Contents?: true

Size: 1.13 KB

Versions: 9

Compression:

Stored size: 1.13 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|
    blob = blob_from_data item[:image]
    if blob
      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

9 entries across 9 versions & 1 rubygems

Version Path
promethee-3.0.2 app/views/promethee/components/row/_show.html.erb
promethee-3.0.1 app/views/promethee/components/row/_show.html.erb
promethee-3.0.0 app/views/promethee/components/row/_show.html.erb
promethee-2.1.3 app/views/promethee/components/row/_show.html.erb
promethee-2.1.2 app/views/promethee/components/row/_show.html.erb
promethee-2.1.1 app/views/promethee/components/row/_show.html.erb
promethee-2.1.0 app/views/promethee/components/row/_show.html.erb
promethee-2.0.9 app/views/promethee/components/row/_show.html.erb
promethee-2.0.8 app/views/promethee/components/row/_show.html.erb