2018-03-19 16:11:12 +00:00
%p.profile-settings-content
2021-07-28 15:09:57 +00:00
- group_deploy_tokens_help_link_url = help_page_path('user/project/deploy_tokens/index.md')
- group_deploy_tokens_help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: group_deploy_tokens_help_link_url }
= s_('DeployTokens|Create a new deploy token for all projects in this group. %{link_start}What are deploy tokens?%{link_end}').html_safe % { link_start: group_deploy_tokens_help_link_start, link_end: '</a>'.html_safe }
2018-03-19 16:11:12 +00:00
2020-04-01 12:08:00 +00:00
= form_for token, url: create_deploy_token_path(group_or_project, anchor: 'js-deploy-tokens'), method: :post, remote: Feature.enabled?(:ajax_new_deploy_token, group_or_project) do |f|
2018-03-19 16:11:12 +00:00
.form-group
2018-07-19 22:11:31 +00:00
= f.label :name, class: 'label-bold'
2021-05-03 21:10:09 +00:00
= f.text_field :name, class: 'form-control gl-form-input', data: { qa_selector: 'deploy_token_name_field' }, required: true
2021-07-28 15:09:57 +00:00
.text-secondary= s_('DeployTokens|Enter a unique name for your deploy token.')
2018-03-19 16:11:12 +00:00
.form-group
2021-07-28 15:09:57 +00:00
= f.label :expires_at, _('Expiration date (optional)'), class: 'label-bold'
2021-05-03 21:10:09 +00:00
= f.text_field :expires_at, class: 'datepicker form-control', data: { qa_selector: 'deploy_token_expires_at_field' }, value: f.object.expires_at
2021-07-28 15:09:57 +00:00
.text-secondary= s_('DeployTokens|Enter an expiration date for your token. Defaults to never expire.')
2018-03-19 16:11:12 +00:00
2019-07-02 18:56:48 +00:00
.form-group
2021-02-03 09:09:07 +00:00
= f.label :username, _('Username (optional)'), class: 'label-bold'
2021-05-03 21:10:09 +00:00
= f.text_field :username, class: 'form-control'
2021-07-28 15:09:57 +00:00
.text-secondary
= html_escape(s_('DeployTokens|Enter a username for your token. Defaults to %{code_start}gitlab+deploy-token-{n}%{code_end}.')) % { code_start: '<code>'.html_safe, code_end: '</code>'.html_safe }
2019-07-02 18:56:48 +00:00
2018-03-19 16:11:12 +00:00
.form-group
2021-07-28 15:09:57 +00:00
= f.label :scopes, _('Scopes (select at least one)'), class: 'label-bold'
2018-07-18 13:05:30 +00:00
%fieldset.form-group.form-check
2021-05-03 21:10:09 +00:00
= f.check_box :read_repository, class: 'form-check-input', data: { qa_selector: 'deploy_token_read_repository_checkbox' }
2021-04-14 15:09:04 +00:00
= f.label :read_repository, 'read_repository', class: 'label-bold form-check-label'
2021-07-28 15:09:57 +00:00
.text-secondary
= s_('DeployTokens|Allows read-only access to the repository.')
2018-04-06 14:30:21 +00:00
2020-02-28 18:09:07 +00:00
- if container_registry_enabled?(group_or_project)
2018-07-18 13:05:30 +00:00
%fieldset.form-group.form-check
2021-05-03 21:10:09 +00:00
= f.check_box :read_registry, class: 'form-check-input', data: { qa_selector: 'deploy_token_read_registry_checkbox' }
2021-04-14 15:09:04 +00:00
= f.label :read_registry, 'read_registry', class: 'label-bold form-check-label'
2021-02-03 09:09:07 +00:00
.text-secondary= s_('DeployTokens|Allows read-only access to registry images.')
2018-03-19 16:11:12 +00:00
2020-04-14 00:09:57 +00:00
%fieldset.form-group.form-check
= f.check_box :write_registry, class: 'form-check-input'
2021-04-14 15:09:04 +00:00
= f.label :write_registry, 'write_registry', class: 'label-bold form-check-label'
2021-07-28 15:09:57 +00:00
.text-secondary= s_('DeployTokens|Allows read and write access to registry images.')
2020-04-14 00:09:57 +00:00
2020-09-08 15:08:41 +00:00
- if packages_registry_enabled?(group_or_project)
2020-05-14 03:07:52 +00:00
%fieldset.form-group.form-check
2021-07-09 18:09:51 +00:00
= f.check_box :read_package_registry, class: 'form-check-input', data: { qa_selector: 'deploy_token_read_package_registry_checkbox' }
2021-04-14 15:09:04 +00:00
= f.label :read_package_registry, 'read_package_registry', class: 'label-bold form-check-label'
2021-07-28 15:09:57 +00:00
.text-secondary= s_('DeployTokens|Allows read-only access to the package registry.')
2020-05-14 03:07:52 +00:00
%fieldset.form-group.form-check
2021-09-13 09:11:26 +00:00
= f.check_box :write_package_registry, class: 'form-check-input', data: { qa_selector: 'deploy_token_write_package_registry_checkbox' }
2021-04-14 15:09:04 +00:00
= f.label :write_package_registry, 'write_package_registry', class: 'label-bold form-check-label'
2021-07-28 15:09:57 +00:00
.text-secondary= s_('DeployTokens|Allows read and write access to the package registry.')
2020-05-14 03:07:52 +00:00
2020-09-23 21:09:28 +00:00
.gl-mt-3
2021-05-03 21:10:09 +00:00
= f.submit s_('DeployTokens|Create deploy token'), class: 'btn gl-button btn-confirm', data: { qa_selector: 'create_deploy_token_button' }