charts_controller.rb 634 Bytes
Newer Older
1 2
module Ci
  class ChartsController < Ci::ApplicationController
Valery Sizov's avatar
Valery Sizov committed
3 4 5 6
    before_action :authenticate_user!
    before_action :project
    before_action :authorize_access_project!
    before_action :authorize_manage_project!
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

    layout 'ci/project'

    def show
      @charts = {}
      @charts[:week] = Ci::Charts::WeekChart.new(@project)
      @charts[:month] = Ci::Charts::MonthChart.new(@project)
      @charts[:year] = Ci::Charts::YearChart.new(@project)
      @charts[:build_times] = Ci::Charts::BuildTime.new(@project)
    end

    protected

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