articles
This commit is contained in:
parent
fd7f028064
commit
a49b163724
@ -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")+''
|
||||
|
@ -106,7 +106,7 @@
|
||||
|
||||
|
||||
=#render Event.recents.limit(2)
|
||||
dsfdfs
|
||||
|
||||
=yield :sidebar
|
||||
|
||||
.clear
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user