This commit is contained in:
Nicolas Bally 2021-06-11 16:44:06 +02:00
parent d347383de2
commit be69e5911b
2 changed files with 9 additions and 0 deletions

View File

@ -24,6 +24,11 @@ class Forum::ForumTopicsController < ApplicationController
def index def index
@forum_topics = ForumTopic.where(:enabled => true).all @forum_topics = ForumTopic.where(:enabled => true).all
per_page = (params[:per_page] and params[:per_page] != "") ? params[:per_page] : 40
page = (params[:page] and params[:page] != "") ? params[:page] : 1
@forum_topics = @forum_topics.page(page).per(per_page)
end end
def show def show

View File

@ -12,6 +12,10 @@
-if moderator? -if moderator?
%th{:style => "width:50px;"} %th{:style => "width:50px;"}
=render @forum_topics =render @forum_topics
#pagination
= paginate @forum_topics, :remote => false
=link_to "Lancer un fil de discussion", new_forum_forum_topic_path, :class => "btn btn-primary", :style => "margin:1em 0em;float:right" =link_to "Lancer un fil de discussion", new_forum_forum_topic_path, :class => "btn btn-primary", :style => "margin:1em 0em;float:right"