diff --git a/app/controllers/public/articles_controller.rb b/app/controllers/public/articles_controller.rb index 2f74ef2..60042a7 100644 --- a/app/controllers/public/articles_controller.rb +++ b/app/controllers/public/articles_controller.rb @@ -12,7 +12,7 @@ class Public::ArticlesController < ApplicationController @articles = Article.before(Date.today).recents - @articles = @articles.page(params[:page]).per(3) + @articles = @articles.page(params[:page]).per(12) @title = "Articles du blog" @@ -70,7 +70,7 @@ class Public::ArticlesController < ApplicationController def archives @month = Date.parse("#{params[:year]}/#{params[:month]}").beginning_of_month @articles = Article.recents.where("enabled = ? and published_at > ? and published_at < ?", true, @month, @month.end_of_month ).before(Date.today) - @articles = @articles.page(params[:page]).per(3) + @articles = @articles.page(params[:page]).per(12) @title = "Articles du blog" if [4,8].include?(@month.month) @index_title = 'Articles du mois d\''+l(@month, :format => "%B %Y")+'' diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml index 01ab10a..75f1d9a 100644 --- a/app/views/layouts/public.html.haml +++ b/app/views/layouts/public.html.haml @@ -106,7 +106,7 @@ =#render Event.recents.limit(2) - dsfdfs + =yield :sidebar .clear diff --git a/app/views/public/articles/_index.html.haml b/app/views/public/articles/_index.html.haml index 111446b..99e96e9 100644 --- a/app/views/public/articles/_index.html.haml +++ b/app/views/public/articles/_index.html.haml @@ -1,5 +1,19 @@ -if @articles.size > 0 - =render :partial => "public/articles/article", :collection => @articles, :as => "article" + + -articles = @articles + + -if articles + .articles + -articles.each do |article| + %a{:href => public_article_path(:id => article.slug)} + .article + .image=image_tag article.image_file.file.large.medium.url if article.image_file + + + .description + %h2=article.title + + .clear #articles_pagination= paginate @articles -else %p