diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-01-31 17:12:02 +0300 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-03-06 18:47:44 +0300 |
commit | 5967c17e80ec0e17a2bdc615e18d1cb0a668f68f (patch) | |
tree | 5a55652f078056ae865afe1f37c5758a62fe614d /app/views/projects/deploy_keys | |
parent | 2ee86441158076344a07f2715a148a5bdbe161b0 (diff) |
Introduced the deploy keys presenter
Diffstat (limited to 'app/views/projects/deploy_keys')
-rw-r--r-- | app/views/projects/deploy_keys/_deploy_key.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/deploy_keys/_form.html.haml | 4 | ||||
-rw-r--r-- | app/views/projects/deploy_keys/_index.html.haml | 20 |
3 files changed, 13 insertions, 13 deletions
diff --git a/app/views/projects/deploy_keys/_deploy_key.html.haml b/app/views/projects/deploy_keys/_deploy_key.html.haml index d1e3cb14022..337f8c38a93 100644 --- a/app/views/projects/deploy_keys/_deploy_key.html.haml +++ b/app/views/projects/deploy_keys/_deploy_key.html.haml @@ -18,7 +18,7 @@ %span.key-created-at created #{time_ago_with_tooltip(deploy_key.created_at)} .visible-xs-block.visible-sm-block - - if @available_keys.include?(deploy_key) + - if @deploy_keys.available_keys.include?(deploy_key) = link_to enable_namespace_project_deploy_key_path(@project.namespace, @project, deploy_key), class: "btn btn-sm prepend-left-10", method: :put do Enable - else diff --git a/app/views/projects/deploy_keys/_form.html.haml b/app/views/projects/deploy_keys/_form.html.haml index c91bb9c255a..1421da72418 100644 --- a/app/views/projects/deploy_keys/_form.html.haml +++ b/app/views/projects/deploy_keys/_form.html.haml @@ -1,5 +1,5 @@ -= form_for [@project.namespace.becomes(Namespace), @project, @key], url: namespace_project_deploy_keys_path, html: { class: "js-requires-input" } do |f| - = form_errors(@key) += form_for [@project.namespace.becomes(Namespace), @project, @deploy_keys.new_key], url: namespace_project_deploy_keys_path, html: { class: "js-requires-input" } do |f| + = form_errors(@deploy_keys.new_key) .form-group = f.label :title, class: "label-light" = f.text_field :title, class: 'form-control', autofocus: true, required: true diff --git a/app/views/projects/deploy_keys/_index.html.haml b/app/views/projects/deploy_keys/_index.html.haml index c41fb892862..91acad83bf3 100644 --- a/app/views/projects/deploy_keys/_index.html.haml +++ b/app/views/projects/deploy_keys/_index.html.haml @@ -7,31 +7,31 @@ .col-lg-9 %h5.prepend-top-0 Create a new deploy key for this project - = render "projects/deploy_keys/form" + = render @deploy_keys.form_partial_path .col-lg-9.col-lg-offset-3 %hr .col-lg-9.col-lg-offset-3.append-bottom-default.deploy-keys %h5.prepend-top-0 - Enabled deploy keys for this project (#{@enabled_keys.size}) - - if @enabled_keys.any? + Enabled deploy keys for this project (#{@deploy_keys.enabled_keys_size}) + - if @deploy_keys.any_keys_enabled? %ul.well-list - - @enabled_keys.each do |enabled_key| + - @deploy_keys.enabled_keys.each do |enabled_key| = render partial: 'projects/deploy_keys/deploy_key', locals: {deploy_key: enabled_key} - else .settings-message.text-center No deploy keys found. Create one with the form above or add existing one below. %h5.prepend-top-default - Deploy keys from projects you have access to (#{@available_project_keys.size}) - - if @available_project_keys.any? + Deploy keys from projects you have access to (#{@deploy_keys.available_project_keys_size}) + - if @deploy_keys.any_available_project_keys_enabled? %ul.well-list - - @available_project_keys.each do |available_key| + - @deploy_keys.available_project_keys.each do |available_key| = render partial: 'projects/deploy_keys/deploy_key', locals: {deploy_key: available_key} - else .settings-message.text-center No deploy keys from your projects could be found. Create one with the form above or add existing one below. - - if @available_public_keys.any? + - if @deploy_keys.any_available_public_keys_enabled? %h5.prepend-top-default - Public deploy keys available to any project (#{@available_public_keys.size}) + Public deploy keys available to any project (#{@deploy_keys.available_public_keys_size}) %ul.well-list - - @available_public_keys.each do |available_key| + - @deploy_keys.available_public_keys.each do |available_key| = render partial: 'projects/deploy_keys/deploy_key', locals: {deploy_key: available_key} |