
-if input.nbr_columns == 1 and admin == "dd"
  -input.blocks.each do |block|
    .block
      =render :partial => "admin/blocks/block", :locals => {:block => block, :sortable => false}
  .clear
    
-else



  - css_class = ""
  - css_class = "blanc_encadre" if input.style == 2
  - css_class = "center_block" if input.style == 3
  - css_class = "dark_center_block" if input.style == 5
  - css_class = "home_gray" if input.style == 6
  -css_style = ""
  -css_columns = ""
  
  
  -css_style += "background-color:#{input.background_color};" if input.background_color?
  
  - if input.image_file
    -url = input.image_file.file.large.url
    -if input.image_file and input.image_file.photograph
      -@page_images_credits << input.image_file.photograph
    
    
    -css_style += "background-image:url('#{url}');background-size:100%;background-size:cover;background-position:center center;"
    
  -css_columns += "padding-top:#{input.padding_top}px;" if input.padding_top?
  -css_columns += "padding-bottom:#{input.padding_bottom}px;" if input.padding_bottom?
  -css_columns += "padding-left:#{input.padding_left}px;" if input.padding_left?
  -css_columns += "padding-right:#{input.padding_right}px;" if input.padding_right?
  
  -css_style += "margin-top:#{input.margin_top}px;" if input.margin_top?
  -css_style += "margin-bottom:#{input.margin_bottom}px;" if input.margin_bottom?
  -css_style += "margin-left:#{input.margin_left}px;" if input.margin_left?
  -css_style += "margin-right:#{input.margin_right}px;" if input.margin_right?
  -css_style += "text-align:center;" if input.style == 3
  
  
  =raw "</div>" if input.style == 5 or input.style == 6 and !@admin
  
  
  =raw "<div class='#{css_class}' style=\""+css_style+"\">" 
  
  =raw "<div class='inner_frame'>" if input.style == 2
  
  =raw "<div class='center'>" if input.center
  .row
    -for i in 1..input.nbr_columns.to_i
      %div{:class => "columns span_"+eval("input.row#{i}").to_s, :style => css_columns}
        -if admin
          =render :partial => "admin/blocks/block", :locals => {:admin => false,:block => input.blocks[i-1], :sortable => false}
        -else
          =render :partial => "public/blocks/block", :locals => {:admin => false, :block => input.blocks[i-1], :sortable => false}
    .clear

  =raw "</div>" if input.center
  
  =raw "</div>" if input.style == 2
  
  =raw "</div>" 
  
  =raw "<div class='main row-fluid'>" if input.style == 5 or input.style == 6 and !@admin


  
  