repository_controller.rb 666 Bytes
Newer Older
1
2
3
module Projects
  module Settings
    class RepositoryController < Projects::ApplicationController
4
5
6
7
      include RepositoryHelper

      before_action :authorize_admin_project!

8
      def show
9
10
11
        @deploy_keys = DeployKeysPresenter
          .new(@project, current_user: @current_user)

12
        define_protected_branches
13
14
15
16
      end

      private

17
18
      def define_protected_branches
        load_protected_branches
19
        @protected_branch = @project.protected_branches.new
Jose Ivan Vargas's avatar
Jose Ivan Vargas committed
20
        load_gon_index
21
      end
22
23
24
25

      def load_protected_branches
        @protected_branches = @project.protected_branches.order(:name).page(params[:page])
      end
26
27
28
    end
  end
end