-if @admin
  Slider :
  =input.home_slider.slug if input.home_slider
-else
  
  -if input.home_slider
    %div{:class => "slider_content_#{input.style}_wrapper"}
      %div{:class => "slider_content_#{input.style}"}

        -@home_slider = input.home_slider
        -@date = Time.now
        -if @home_slider
          -@home_slides_simu = @home_slider.home_slider_slides.where(:enabled => true)
          -@home_slides_simu = @home_slides_simu.where("start_at IS NULL or start_at <= ?",@date)
          -@home_slides_simu = @home_slides_simu.where("end_at IS NULL or end_at >= ?",@date)
          -@home_slides_simu = @home_slides_simu.order(:position)
          -@home_slides_simu = @home_slides_simu.joins(:lang_sites).where("lang_sites.id = ?", @lang.id)
          -@home_slides_simu.each do |home_slider_slide|
            -if input.style == "agir"
              .agir_slide
                -if home_slider_slide.image_file
                  =image_tag home_slider_slide.image_file.file.square.url , :class => ""
          
                .description
     
               
                  =simple_format home_slider_slide.description1
                  .cta
                    -if home_slider_slide.cta_text?
                      =link_to home_slider_slide.cta_text, home_slider_slide.url, :target => ("_blank" if home_slider_slide.popup), :class => "btn orange"
                .clear  
        
         
    .clear  

    :javascript
      $(document).ready(function(){
      $('.slider_content_agir').bxSlider({
        nextText: '>',
        prevText: '<'
        
      });
      });
  