2012-09-27 20:59:42 +02:00
|
|
|
class DeployKeysController < ProjectResourceController
|
2012-01-17 23:46:13 +01:00
|
|
|
respond_to :html
|
2011-12-29 22:46:18 +01:00
|
|
|
|
|
|
|
# Authorize
|
|
|
|
before_filter :authorize_admin_project!
|
2011-12-29 20:44:16 +01:00
|
|
|
|
|
|
|
def index
|
2011-12-31 18:37:14 +01:00
|
|
|
@keys = @project.deploy_keys.all
|
2011-12-29 20:44:16 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def show
|
2011-12-31 18:37:14 +01:00
|
|
|
@key = @project.deploy_keys.find(params[:id])
|
2011-12-29 20:44:16 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def new
|
2011-12-31 18:37:14 +01:00
|
|
|
@key = @project.deploy_keys.new
|
2011-12-29 20:44:16 +01:00
|
|
|
|
|
|
|
respond_with(@key)
|
|
|
|
end
|
|
|
|
|
|
|
|
def create
|
2011-12-31 18:37:14 +01:00
|
|
|
@key = @project.deploy_keys.new(params[:key])
|
2012-01-18 00:00:40 +01:00
|
|
|
if @key.save
|
|
|
|
redirect_to project_deploy_keys_path(@project)
|
|
|
|
else
|
|
|
|
render "new"
|
|
|
|
end
|
2011-12-29 20:44:16 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def destroy
|
2011-12-31 18:37:14 +01:00
|
|
|
@key = @project.deploy_keys.find(params[:id])
|
2011-12-29 20:44:16 +01:00
|
|
|
@key.destroy
|
|
|
|
|
|
|
|
respond_to do |format|
|
2011-12-29 22:31:27 +01:00
|
|
|
format.html { redirect_to project_deploy_keys_url }
|
2012-08-11 00:07:50 +02:00
|
|
|
format.js { render nothing: true }
|
2011-12-29 20:44:16 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|