
-if !@new_site  

  =render :partial => "public/articles/intro_blog"

-if @lang_article.image_file
  -img_url = @lang_article.image_file.file.large.url 
  -@facebook_img =  @lang_article.image_file.file.large.medium.url
  
-elsif @article.image_file
  -img_url = @article.image_file.file.large.url 
  -@facebook_img =  @article.image_file.file.large.medium.url
  
  
-if @article.without_text_image_file
  -@facebook_img = @article.without_text_image_file.file.large.medium.url
  
  
  
-@twitter_title = @lang_article.twitter_title if @lang_article.twitter_title?

-if !@new_site    
  .blog_sidebar_top
    .blog_sidebar.left{:style => "float:left;"}=render :partial => "public/articles/sidebar"
      
  .blog_content_show
    .inner{:style => "width:100%;float:left"}
    
      .article_content
    
        .article_top{:style => "background-image:url('#{img_url}');", :class => ("with_img" if img_url)}
          -if !@article.gradient_cached  
            =#.gradient 
  
  
    
      
      
        -if !@article.title_cached
          %h1
            -if @lang_article.html_title?
              =raw @lang_article.html_title
            -else
              =@lang_article.title
            
        %p.date
          =("le " if @lang.id != 2).to_s+l(@article.published_at, :format => :human_date)
          ="-"
          =link_to "#comments" do
            %span.coms=i(:"comment-o")+" "+@article.comments.where(:enabled => true).count.to_s
      
        =render @article.blocks.find_by_lang_site_id(@lang.id)
        -if @article.article_author
          .center
            .author
              =@article.article_author.title if @article.article_author.title
              =@article.article_author.name
    
      -if @article.juridique
        .article_comments_container  
          #question_juridiques
            .article_comments
              %h3 Vos questions à notre avocate
              %br
              %center
                =link_to ic(:plus)+" Posez votre question", new_public_question_juridique_path(:article_id => @article.id), :remote => true, :class => "ask_button"
          
              %br
      
              #question_juridique_form
      
      

              =render @article.question_juridiques.enableds.before(Time.now.end_of_day).order("created_at DESC").all


        
    
      -elsif @article.commentable
        .article_comments_container  
          .article_comments
   
            #comments
              %h3=qit "comments-title", "Commentaires"
              =render :partial => "public/comments/comment", :collection => @article.comments.where(:enabled => true, :parent_id => nil).order("created_at DESC")

              #comment_form
                .form_place=render :partial => "public/comments/form"
  
    

      
  .blog_sidebar_bottom
    .blog_sidebar=render :partial => "public/articles/sidebar"




-else
  -@facebook_title = @facebook_title || @title
  - @twitter_title = @twitter_title || @title
  .blog_content_show
    .blog_content_header
      .center
        %p.date
          =("le " if @lang.id != 2).to_s+l(@article.published_at, :format => :human_date)
          %span.sep
            ="|"
          =link_to "#comments" do
            %span.coms=i(:"comment-o")+" "+@article.comments.where(:enabled => true).count.to_s
          
        %h1
          -if @lang_article.html_title?
            =raw @lang_article.html_title
          -else
            =@lang_article.title
    
    .article_top.with_ratio{:style => "background-image:url('#{img_url}');", :class => ("with_img" if img_url), :data => {:ratio => 0.30}}
    
    .socials_wrapper
      .inner
        .left_social_move
        
          =link_to "https://www.facebook.com/sharer/sharer.php?u=#{request.url}", :target => "_blank", :class => "round_social facebook" do
            =i(:"facebook")
          
          =link_to "https://twitter.com/intent/tweet?url=#{request.url}&via=onevoiceanimal&text="+CGI::escape(@twitter_title.to_s), :target => "_blank", :class => "round_social twitter" do
            =i(:"twitter")
    
          =link_to "#", :onclick => "copyToClipboard('#{request.url}')", :class => "round_social copy" do
            =i(:"share-alt")
          
          =link_to "javascript:window.print()", :class => "round_social print" do
            =i(:"print")
            
          
            
            
            
            
            
      .center
        .article_content
      
        
          .article_socials_links.socials_links
            =link_to "https://www.facebook.com/sharer/sharer.php?u=#{request.url}", :target => "_blank", :class => "round_social facebook" do
              =i(:"facebook")
            
            =link_to "https://twitter.com/intent/tweet?url=#{request.url}&via=onevoiceanimal&text="+CGI::escape(@twitter_title.to_s), :target => "_blank", :class => "round_social twitter" do
              =i(:"twitter")
            
            =link_to "#", :onclick => "copyToClipboard('#{request.url}')", :class => "round_social copy" do
              =i(:"share-alt")
              
            =link_to "javascript:window.print()", :class => "round_social print" do
              =i(:"print")
              
              
          .chapeau
            -if @lang_article.chapeau?
              =simple_format @lang_article.chapeau
            -else
              =simple_format @lang_article.description
        
          .hr_article
            =image_tag "/hr_blog.png"
        
      
          .render_block
            =render @article.blocks.find_by_lang_site_id(@lang.id)
            =#.bottom_space
          -if @article.article_author
        
            .author
              =@article.article_author.title if @article.article_author.title
              =@article.article_author.name
          .hr_article
            =image_tag "/hr_blog.png"
          
          .tags
            -@article.tags.each do |tag|
              =link_to "#"+tag.name, tag_public_articles_path(:tag_id => tag.slug)
          .petition_socials_links
            %span=qit "Partager sur"
            =link_to "https://www.facebook.com/sharer/sharer.php?u=#{request.url}", :target => "_blank", :class => "round_social facebook" do
              =i(:"facebook")

            =#text=CSS%20Social%20Media%20Sidebar&
            =link_to "https://twitter.com/intent/tweet?text=#{CGI.escape(@twitter_title.to_s)}&url=#{request.url}&via=onevoiceanimal", :target => "_blank", :class => "round_social twitter", :style => "margin-left:10px;" do
              =i(:"twitter")
  
    .dark_bottom_links.article_others
      %h3=qit "Dans la thématique"
      
      -Article.recents.where("articles.published_at <= ? ", Date.today ).before(Date.today).joins(:lang_articles).where("lang_articles.enabled = 1 and lang_articles.lang_site_id = ?", @lang.id).where(:category_id => @article.category_id).where("articles.id != ?", @article.id).limit(2).each do |article|
        -lang_article = article.lang_articles.where(:lang_site_id => @lang.id).first
        
        -if article.image_file
          -img_url = article.image_file.file.large.url
          
        =link_to article_path(:slug => lang_article.slug, :lang => @lang.slug), :class => "with_ratio square_link article_other", :data => {:ratio => 0.62}, :style => "background-image:url('#{img_url}');background-size:100%;background-size:cover;" do
          .inner
            .vertical_center=lang_article.title
      
    .center
      -if @article.juridique
        .article_comments_container  
          #question_juridiques
            .article_comments
              %h3 Vos questions à notre avocate
              %br
              %center
                =link_to ic(:plus)+" Posez votre question", new_public_question_juridique_path(:article_id => @article.id), :remote => true, :class => "ask_button"
        
              %br
    
              #question_juridique_form
    
    

              =render @article.question_juridiques.enableds.before(Time.now.end_of_day).order("created_at DESC").all


      
  
      -elsif @article.commentable
        .article_comments_container  
          .article_comments
 
            #comments
              %h3.comment_title
                =qit "comments-title", "Commentaires"
                %span.coms=i(:"comment-o")+" "+@article.comments.where(:enabled => true).count.to_s
              
              #comment_form
                .form_place=render :partial => "public/comments/form"
              
              
              .blog_comments_list
                =render :partial => "comments_list"

              
    
      
    


-if current_admin
  .admin_panel
    =link_to "Modifier cet article", edit_admin_article_path(:id => @article.id, :lang => @lang.slug), :class => "btn btn-primary"
    =link_to "Télécharger l'image de bandeau", @article.image_file.file.large.url, :class => "btn btn-primary" if @article.image_file

