summaryrefslogtreecommitdiff
path: root/app/controllers/ci/charts_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/ci/charts_controller.rb')
-rw-r--r--app/controllers/ci/charts_controller.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/app/controllers/ci/charts_controller.rb b/app/controllers/ci/charts_controller.rb
new file mode 100644
index 00000000000..aa875e70987
--- /dev/null
+++ b/app/controllers/ci/charts_controller.rb
@@ -0,0 +1,24 @@
+module Ci
+ class ChartsController < Ci::ApplicationController
+ before_action :authenticate_user!
+ before_action :project
+ before_action :authorize_access_project!
+ before_action :authorize_manage_project!
+
+ 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