debian-mirror-gitlab/app/views/shared/deploy_keys/_form.html.haml

35 lines
1.6 KiB
Text
Raw Normal View History

2017-09-10 17:25:29 +05:30
- form = local_assigns.fetch(:form)
- deploy_key = local_assigns.fetch(:deploy_key)
2018-03-17 18:26:18 +05:30
- deploy_keys_project = deploy_key.deploy_keys_project_for(@project)
2017-09-10 17:25:29 +05:30
= form_errors(deploy_key)
.form-group
2018-11-08 19:23:39 +05:30
= form.label :title, class: 'col-form-label col-sm-2'
2021-06-08 01:23:25 +05:30
.col-sm-10= form.text_field :title, class: 'form-control gl-form-input', data: { qa_selector: 'deploy_key_title_field' }, readonly: ('readonly' unless can?(current_user, :update_deploy_key, deploy_key))
2017-09-10 17:25:29 +05:30
.form-group
- if deploy_key.new_record?
2018-11-08 19:23:39 +05:30
= form.label :key, class: 'col-form-label col-sm-2'
2017-09-10 17:25:29 +05:30
.col-sm-10
%p.light
2021-09-30 23:02:18 +05:30
- link_start = "<a href='#{help_page_path('ssh/index')}' target='_blank' rel='noreferrer noopener'>".html_safe
2019-07-07 11:18:12 +05:30
- link_end = '</a>'
2021-03-11 19:13:27 +05:30
= _('Paste a public key here. %{link_start}How do I generate it?%{link_end}').html_safe % { link_start: link_start, link_end: link_end.html_safe }
2021-06-08 01:23:25 +05:30
= form.text_area :key, class: 'form-control gl-form-input thin_area', rows: 5, data: { qa_selector: 'deploy_key_field' }
2017-09-10 17:25:29 +05:30
- else
2018-11-08 19:23:39 +05:30
= form.label :fingerprint, class: 'col-form-label col-sm-2'
2017-09-10 17:25:29 +05:30
.col-sm-10
2021-03-11 19:13:27 +05:30
= form.text_field :fingerprint, class: 'form-control gl-form-input', readonly: 'readonly'
2017-09-10 17:25:29 +05:30
2018-03-17 18:26:18 +05:30
- if deploy_keys_project.present?
= form.fields_for :deploy_keys_projects, deploy_keys_project do |deploy_keys_project_form|
.form-group
2018-11-08 19:23:39 +05:30
.col-form-label.col-sm-2
2018-03-17 18:26:18 +05:30
.col-sm-10
= deploy_keys_project_form.label :can_push do
= deploy_keys_project_form.check_box :can_push
2021-03-11 19:13:27 +05:30
%strong= _('Grant write permissions to this key')
2020-06-23 00:09:42 +05:30
%p.light.gl-mb-0
2021-03-11 19:13:27 +05:30
= _('Allow this key to push to this repository')