2012-09-02 16:50:07 +02:00
|
|
|
class ModerationsController < ApplicationController
|
|
|
|
def index
|
2016-07-05 17:02:14 +02:00
|
|
|
@title = t('.moderationlogtitle')
|
2012-09-07 16:18:15 +02:00
|
|
|
|
2013-10-18 23:05:00 +02:00
|
|
|
@pages = (Moderation.count / 50).ceil
|
2016-07-31 19:36:28 +02:00
|
|
|
@page = params[:page].to_i
|
|
|
|
if @page == 0
|
2012-09-02 16:50:07 +02:00
|
|
|
@page = 1
|
2016-07-31 19:36:28 +02:00
|
|
|
elsif @page < 0 || @page > (2 ** 32) || @page > @pages
|
|
|
|
raise ActionController::RoutingError.new("page out of bounds")
|
2012-09-02 16:50:07 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
@moderations = Moderation.order("id desc").limit(50).offset((@page - 1) *
|
2013-12-24 04:20:06 +01:00
|
|
|
50)
|
2012-09-02 16:50:07 +02:00
|
|
|
end
|
|
|
|
end
|