jipe_app/app/views/public/articles/index.html.haml
2017-08-14 10:53:30 +02:00

84 lines
2.9 KiB
Plaintext

-@menu_shadow = true
-@title = qit "SEO titre blog", "Articles du blog"
=render :partial => "public/articles/intro_blog"
%h2.home_title
à la
%span une
.blog_index.left
.row
.columns.span_7
-if @articles[0]
=render :partial => "article", :object => @articles[0], :as => :article
.columns.span_5
-if @articles[1]
=render :partial => "article_x2", :object => @articles[1], :as => :article
-if @articles[2]
=render :partial => "article_x2", :object => @articles[2], :as => :article
.clear
%br
%br
=raw "</div>"
-@category = Category.order(:position).first
.blog_category
.main_container
%h3=qit "blog-index-categories-titre", "Catégories"
-Category.order(:position).each do |category|
-count = category.articles.recents.joins(:lang_articles).where("lang_articles.enabled = 1 and lang_articles.lang_site_id = ?", @lang.id).count
-if count > 0
=#raw(" <span>#{count}</span>")
=link_to raw(category.lang(I18n.locale.to_s).name), category_public_article_path(:lang => @lang.slug,:slug => category.lang(I18n.locale.to_s).slug), :class => ("active" if @category and category.id == @category.id), :data => {:id => category.id}
=raw "<div class='main_container' >"
.animate_index
-Category.order(:position).each do |category|
-count = category.articles.recents.joins(:lang_articles).where("lang_articles.enabled = 1 and lang_articles.lang_site_id = ?", @lang.id).count
-if count > 0
.index_category#index_category{:id => category.id, :style => ("display:none;" if @category and category.id != @category.id)}
.more_articles_link
=link_to raw(qit("blog Tous les articles", "Tous les articles")+raw(" <span>#{count}</span> >")), category_public_article_path(:slug => category.lang(I18n.locale.to_s).slug, :lang => @lang.slug), :title => "Articles de la catégorie \""+category.name.to_s+'"'
%h3
=link_to category.lang(I18n.locale.to_s).name, category_public_article_path(:slug => category.lang(I18n.locale.to_s).slug), :title => "Articles de la catégorie \""+category.name.to_s+'"'
-articles = category.articles.recents.joins(:lang_articles).where("lang_articles.enabled = 1 and lang_articles.lang_site_id = ?", @lang.id).limit(4)
.blog_index.right
.row
.columns.span_5
-if articles[1]
=render :partial => "article_x2", :object => articles[1], :as => :article
-if articles[2]
=render :partial => "article_x2", :object => articles[2], :as => :article
.columns.span_7
-if articles[0]
=render :partial => "article", :object => articles[0], :as => :article
.clear
.blog_sidebar_bottom
.blog_sidebar=render :partial => "public/articles/sidebar"