events_controller.rb 449 Bytes
Newer Older
1 2 3 4
module Ci
  class EventsController < Ci::ApplicationController
    EVENTS_PER_PAGE = 50

Valery Sizov's avatar
Valery Sizov committed
5 6 7
    before_action :authenticate_user!
    before_action :project
    before_action :authorize_manage_project!
8 9 10 11 12 13 14 15 16 17 18 19 20 21

    layout 'ci/project'

    def index
      @events = project.events.order("created_at DESC").page(params[:page]).per(EVENTS_PER_PAGE)
    end

    private

    def project
      @project ||= Ci::Project.find(params[:project_id])
    end
  end
end