.center_content
  .circuit_show
    -if @circuit.logo
      .right
        =image_tag(@circuit.logo.file.large.medium.url, :class => "logo" )
    %h1
      =@circuit.name

    

    .clear

    -img = ""
    -img = @circuit.image_file.file.large.medium.url if @circuit.image_file 
    
    =image_tag img, :class => "circuit_img"
    .description
      =simple_format @circuit.description

      %br
      
        .right
          -if @circuit.website?
            =link_to "Site officiel", @circuit.website, :target => "_blank", :class => "new_btn"
          -if @circuit.facebook?
        
            =link_to raw(ic(:'facebook-f')+"   Page Facebook"), @circuit.facebook, :target => "_blank", :class => "new_btn"
          
          
      .clear
    .clear
    %br
    %br
    %p.localisation
      <img src="https://www.mamotosurcircuit.com/images/interface/picto_pointer.png">
      =@circuit.address2
      =@circuit.address3 if @circuit.address3?
      =@circuit.cp
      =@circuit.city
      =@circuit.country
    .info_lien

      
      -if @circuit.longueur?
        .block_info
          %img{:src => "https://www.mamotosurcircuit.com/images/interface/picto_flag.png"}/
          =@circuit.longueur


      -if @circuit.nbr_courbes?
        .block_info
          %img{:src => "https://www.mamotosurcircuit.com/images/interface/picto_nombre_virages.png"}/
          =@circuit.nbr_courbes

      -if @circuit.longueur_ligne?
        .block_info
          %img{:src => "https://www.mamotosurcircuit.com/images/interface/picto_longueur_circuit.png"}/
          =@circuit.longueur_ligne
    
    -@m_events = MEvent.where("start_at >= ? or end_at >= ?", Date.today.beginning_of_day, Date.today.beginning_of_day).where(:circuit_id => @circuit.id)
    -if @m_events.count > 0
      %h3 Les prochaines journées :



      

      =render @m_events 
   
