diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-06-23 20:47:22 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-06-23 20:47:22 +0400 |
commit | 2ed7cbfba4ff3c6a4cf3e72515a0375544998de0 (patch) | |
tree | ae6d7530745c80633cd993c99f7820e1452f3e1b /app/views/projects/deploy_keys | |
parent | 95791316f4037273af7b747ce1851d5f4e46933f (diff) |
Move projects controllers/views in Projects module
Diffstat (limited to 'app/views/projects/deploy_keys')
-rw-r--r-- | app/views/projects/deploy_keys/_deploy_key.html.haml | 25 | ||||
-rw-r--r-- | app/views/projects/deploy_keys/_form.html.haml | 23 | ||||
-rw-r--r-- | app/views/projects/deploy_keys/index.html.haml | 30 | ||||
-rw-r--r-- | app/views/projects/deploy_keys/new.html.haml | 4 | ||||
-rw-r--r-- | app/views/projects/deploy_keys/show.html.haml | 13 |
5 files changed, 95 insertions, 0 deletions
diff --git a/app/views/projects/deploy_keys/_deploy_key.html.haml b/app/views/projects/deploy_keys/_deploy_key.html.haml new file mode 100644 index 00000000000..45f80ecd556 --- /dev/null +++ b/app/views/projects/deploy_keys/_deploy_key.html.haml @@ -0,0 +1,25 @@ +%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 + %i.icon-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 + %i.icon-off + Disable + - else + = link_to 'Remove', project_deploy_key_path(@project, deploy_key), 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 + %i.icon-key + %strong= deploy_key.title + + %p.light.prepend-top-10 + - deploy_key.projects.map(&:name_with_namespace).each do |project_name| + %span.label= project_name + %small.pull-right + Created #{time_ago_in_words(deploy_key.created_at)} ago + diff --git a/app/views/projects/deploy_keys/_form.html.haml b/app/views/projects/deploy_keys/_form.html.haml new file mode 100644 index 00000000000..71bf309dd8b --- /dev/null +++ b/app/views/projects/deploy_keys/_form.html.haml @@ -0,0 +1,23 @@ +%div + = form_for [@project, @key], url: project_deploy_keys_path do |f| + -if @key.errors.any? + .alert.alert-error + %ul + - @key.errors.full_messages.each do |msg| + %li= msg + + .clearfix + = f.label :title + .input= f.text_field :title + .clearfix + = f.label :key + .input + = f.text_area :key, class: [:xxlarge, :thin_area] + %p.hint + Paste a machine public key here. Read more about how generate it + = link_to "here", help_ssh_path + + .actions + = f.submit 'Create', class: "btn-create btn" + = link_to "Cancel", project_deploy_keys_path(@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 new file mode 100644 index 00000000000..a1fa3475a84 --- /dev/null +++ b/app/views/projects/deploy_keys/index.html.haml @@ -0,0 +1,30 @@ +%p.slead + Deploy keys allow read-only access to repository. They can be used for CI, staging or production servers + +%p + You can create a deploy key or add existing one + = link_to new_project_deploy_key_path(@project), class: "btn btn-primary pull-right", title: "New Deploy Key" do + %i.icon-plus + New Deploy Key + +%hr.clearfix + +.row + .span5.enabled-keys + %h5.cgreen + Enabled deploy keys + %small for this project + %ul.bordered-list + = render @enabled_keys + - if @enabled_keys.blank? + .light-well + %p.nothing_here_message Create #{link_to 'new deploy key', new_project_deploy_key_path(@project)} or add existing one + .span5.available-keys + %h5 + Available deploy keys + %small from projects you are able to manage + %ul.bordered-list + = render @available_keys + - if @available_keys.blank? + .light-well + %p.nothing_here_message All deploy keys created in projects you own will be displayed here diff --git a/app/views/projects/deploy_keys/new.html.haml b/app/views/projects/deploy_keys/new.html.haml new file mode 100644 index 00000000000..b0e2a8b2949 --- /dev/null +++ b/app/views/projects/deploy_keys/new.html.haml @@ -0,0 +1,4 @@ +%h3.page_title New Deploy key +%hr + += render 'form' diff --git a/app/views/projects/deploy_keys/show.html.haml b/app/views/projects/deploy_keys/show.html.haml new file mode 100644 index 00000000000..26fd7428b7e --- /dev/null +++ b/app/views/projects/deploy_keys/show.html.haml @@ -0,0 +1,13 @@ +%h3.page_title + Deploy key: + = @key.title + %small + created at + = @key.created_at.stamp("Aug 21, 2011") +.back_link + = link_to project_deploy_keys_path(@project) do + ← To keys list +%hr +%pre= @key.key +.pull-right + = link_to 'Remove', project_deploy_key_path(@project, @key), confirm: 'Are you sure?', method: :delete, class: "btn-remove btn delete-key" |