# Class Admin::ProjectsController < AdminController

- app/controllers/admin/projects_controller.rb

Methods

D
  - destroy
E
  - edit
I
  - index
P
  - project
S
  - show
T
  - team_update
U
  - update

Instance Public methods
destroy() Link

Source: show

    # File app/controllers/admin/projects_controller.rb, line 37
    def destroy
      # Delete team first in order to prevent multiple gitolite calls
      @project.truncate_team

      @project.destroy

      redirect_to admin_projects_path, notice: 'Project was successfully deleted.'
    end

edit() Link

Source: show

    # File app/controllers/admin/projects_controller.rb, line 18
    def edit
    end

index() Link

Source: show

    # File app/controllers/admin/projects_controller.rb, line 4
    def index
      @projects = Project.scoped
      @projects = @projects.where(namespace_id: params[:namespace_id]) if params[:namespace_id].present?
      @projects = @projects.where(namespace_id: nil) if params[:namespace_id] == Namespace.global_id
      @projects = @projects.search(params[:name]) if params[:name].present?
      @projects = @projects.includes(:namespace).order("namespaces.path, projects.name ASC").page(params[:page]).per(20)
    end

show() Link

Source: show

    # File app/controllers/admin/projects_controller.rb, line 12
    def show
      @users = User.active
      @users = @users.not_in_project(@project) if @project.users.present?
      @users = @users.all
    end

team_update() Link

Source: show

    # File app/controllers/admin/projects_controller.rb, line 21
    def team_update
      @project.add_users_ids_to_team(params[:user_ids], params[:project_access])

      redirect_to [:admin, @project], notice: 'Project was successfully updated.'
    end

update() Link

Source: show

    # File app/controllers/admin/projects_controller.rb, line 27
    def update
      status = ProjectUpdateContext.new(project, current_user, params).execute(:admin)

      if status
        redirect_to [:admin, @project], notice: 'Project was successfully updated.'
      else
        render action: "edit"
      end
    end

Instance Protected methods
project() Link

Source: show

    # File app/controllers/admin/projects_controller.rb, line 48
    def project
      id = params[:project_id] || params[:id]

      @project = Project.find_with_namespace(id)
      @project || render_404
    end