summaryrefslogtreecommitdiff
path: root/app/views/projects/deploy_keys
diff options
context:
space:
mode:
authorVinnie Okada <vokada@mrvinn.com>2015-01-24 11:02:58 -0700
committerVinnie Okada <vokada@mrvinn.com>2015-02-14 11:09:23 -0700
commit76aad9b76ed756ca9ba2cbcdb399c815e542b3ae (patch)
tree7226e0ce64796abbf4848582baed8d173ddecd14 /app/views/projects/deploy_keys
parent5725b6daad2f403f13112cfcafa5b45ac126c0ca (diff)
downloadgitlab-ce-76aad9b76ed756ca9ba2cbcdb399c815e542b3ae.tar.gz
Upgrade to Rails 4.1.9
Make the following changes to deal with new behavior in Rails 4.1.2: * Use nested resources to avoid slashes in arguments to path helpers.
Diffstat (limited to 'app/views/projects/deploy_keys')
-rw-r--r--app/views/projects/deploy_keys/_deploy_key.html.haml9
-rw-r--r--app/views/projects/deploy_keys/_form.html.haml4
-rw-r--r--app/views/projects/deploy_keys/index.html.haml4
-rw-r--r--app/views/projects/deploy_keys/show.html.haml4
4 files changed, 11 insertions, 10 deletions
diff --git a/app/views/projects/deploy_keys/_deploy_key.html.haml b/app/views/projects/deploy_keys/_deploy_key.html.haml
index a0345dbd9c3..52da85cbdfa 100644
--- a/app/views/projects/deploy_keys/_deploy_key.html.haml
+++ b/app/views/projects/deploy_keys/_deploy_key.html.haml
@@ -1,19 +1,20 @@
%li
.pull-right
- if @available_keys.include?(deploy_key)
- = link_to enable_project_deploy_key_path(@project, deploy_key), class: 'btn btn-small', method: :put do
+ = link_to enable_namespace_project_deploy_key_path(@project.namespace, @project, deploy_key), class: 'btn btn-small', method: :put do
%i.fa.fa-plus
Enable
- else
- if deploy_key.projects.count > 1
- = link_to disable_project_deploy_key_path(@project, deploy_key), class: 'btn btn-small', method: :put do
+ = link_to disable_namespace_project_deploy_key_path(@project.namespace, @project, deploy_key), class: 'btn btn-small', method: :put do
%i.fa.fa-power-off
Disable
- else
- = link_to 'Remove', project_deploy_key_path(@project, deploy_key), data: { confirm: 'You are going to remove deploy key. Are you sure?'}, method: :delete, class: "btn btn-remove delete-key btn-small pull-right"
+ = link_to 'Remove', namespace_project_deploy_key_path(@project.namespace, @project, deploy_key), data: { confirm: 'You are going to remove deploy key. Are you sure?'}, method: :delete, class: "btn btn-remove delete-key btn-small pull-right"
- = link_to project_deploy_key_path(deploy_key.projects.include?(@project) ? @project : deploy_key.projects.first, deploy_key) do
+ = key_project = deploy_key.projects.include?(@project) ? @project : deploy_key.projects.first
+ = link_to namespace_project_deploy_key_path(key_project.namespace, key_project, deploy_key) do
%i.fa.fa-key
%strong= deploy_key.title
diff --git a/app/views/projects/deploy_keys/_form.html.haml b/app/views/projects/deploy_keys/_form.html.haml
index 162ef05b367..91675b3738e 100644
--- a/app/views/projects/deploy_keys/_form.html.haml
+++ b/app/views/projects/deploy_keys/_form.html.haml
@@ -1,5 +1,5 @@
%div
- = form_for [@project, @key], url: project_deploy_keys_path, html: { class: 'deploy-key-form form-horizontal' } do |f|
+ = form_for [@project.namespace.becomes(Namespace), @project, @key], url: namespace_project_deploy_keys_path, html: { class: 'deploy-key-form form-horizontal' } do |f|
-if @key.errors.any?
.alert.alert-danger
%ul
@@ -19,5 +19,5 @@
.form-actions
= f.submit 'Create', class: "btn-create btn"
- = link_to "Cancel", project_deploy_keys_path(@project), class: "btn btn-cancel"
+ = link_to "Cancel", namespace_project_deploy_keys_path(@project.namespace, @project), class: "btn btn-cancel"
diff --git a/app/views/projects/deploy_keys/index.html.haml b/app/views/projects/deploy_keys/index.html.haml
index 6f475e0b395..c02a18146eb 100644
--- a/app/views/projects/deploy_keys/index.html.haml
+++ b/app/views/projects/deploy_keys/index.html.haml
@@ -1,7 +1,7 @@
%h3.page-title
Deploy keys allow read-only access to the repository
- = link_to new_project_deploy_key_path(@project), class: "btn btn-new pull-right", title: "New Deploy Key" do
+ = link_to new_namespace_project_deploy_key_path(@project.namespace, @project), class: "btn btn-new pull-right", title: "New Deploy Key" do
%i.fa.fa-plus
New Deploy Key
@@ -20,7 +20,7 @@
= render @enabled_keys
- if @enabled_keys.blank?
.light-well
- .nothing-here-block Create a #{link_to 'new deploy key', new_project_deploy_key_path(@project)} or add an existing one
+ .nothing-here-block Create a #{link_to 'new deploy key', new_namespace_project_deploy_key_path(@project.namespace, @project)} or add an existing one
.col-md-6.available-keys
%h5
%strong Deploy keys
diff --git a/app/views/projects/deploy_keys/show.html.haml b/app/views/projects/deploy_keys/show.html.haml
index c66e6bc69c3..405b5bcd0d3 100644
--- a/app/views/projects/deploy_keys/show.html.haml
+++ b/app/views/projects/deploy_keys/show.html.haml
@@ -5,9 +5,9 @@
created on
= @key.created_at.stamp("Aug 21, 2011")
.back-link
- = link_to project_deploy_keys_path(@project) do
+ = link_to namespace_project_deploy_keys_path(@project.namespace, @project) do
&larr; To keys list
%hr
%pre= @key.key
.pull-right
- = link_to 'Remove', project_deploy_key_path(@project, @key), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn-remove btn delete-key"
+ = link_to 'Remove', namespace_project_deploy_key_path(@project.namespace, @project, @key), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn-remove btn delete-key"