debian-mirror-gitlab/app/views/projects/settings/access_tokens/index.html.haml

51 lines
2.6 KiB
Text
Raw Normal View History

2020-05-24 23:13:21 +05:30
- breadcrumb_title s_('AccessTokens|Access Tokens')
- page_title _('Project Access Tokens')
- type = _('project access token')
- type_plural = _('project access tokens')
- @content_class = 'limit-container-width' unless fluid_layout
2020-07-28 23:09:34 +05:30
.row.gl-mt-3
2022-03-02 08:16:31 +05:30
.col-lg-4
2020-06-23 00:09:42 +05:30
%h4.gl-mt-0
2020-05-24 23:13:21 +05:30
= page_title
%p
2021-06-08 01:23:25 +05:30
- link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('user/project/settings/project_access_tokens') }
2021-04-29 21:17:54 +05:30
- if current_user.can?(:create_resource_access_tokens, @project)
2021-06-08 01:23:25 +05:30
= _('Generate project access tokens scoped to this project for your applications that need access to the GitLab API.')
%p
= _('You can also use project access tokens with Git to authenticate over HTTP(S). %{link_start}Learn more.%{link_end}').html_safe % { link_start: link_start, link_end: '</a>'.html_safe }
2021-04-29 21:17:54 +05:30
- else
2021-06-08 01:23:25 +05:30
= _('Project access token creation is disabled in this group. You can still use and manage existing tokens. %{link_start}Learn more.%{link_end}').html_safe % { link_start: link_start, link_end: '</a>'.html_safe }
2021-04-29 21:17:54 +05:30
%p
- root_group = @project.group.root_ancestor
- if current_user.can?(:admin_group, root_group)
- group_settings_link = edit_group_path(root_group)
- link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: group_settings_link }
= _('You can enable project access token creation in %{link_start}group settings%{link_end}.').html_safe % { link_start: link_start, link_end: '</a>'.html_safe }
2020-05-24 23:13:21 +05:30
.col-lg-8
2022-03-02 08:16:31 +05:30
- if @new_resource_access_token
2020-05-24 23:13:21 +05:30
= render 'shared/access_tokens/created_container',
type: type,
2022-03-02 08:16:31 +05:30
new_token_value: @new_resource_access_token
2020-05-24 23:13:21 +05:30
2021-04-29 21:17:54 +05:30
- if current_user.can?(:create_resource_access_tokens, @project)
= render 'shared/access_tokens/form',
type: type,
path: project_settings_access_tokens_path(@project),
2022-03-02 08:16:31 +05:30
resource: @project,
token: @resource_access_token,
2021-04-29 21:17:54 +05:30
scopes: @scopes,
2021-09-30 23:02:18 +05:30
access_levels: ProjectMember.access_level_roles,
default_access_level: Gitlab::Access::MAINTAINER,
2022-03-02 08:16:31 +05:30
prefix: :resource_access_token,
2022-01-26 12:08:38 +05:30
help_path: help_page_path('user/project/settings/project_access_tokens', anchor: 'scopes-for-a-project-access-token')
2020-05-24 23:13:21 +05:30
= render 'shared/access_tokens/table',
2022-03-02 08:16:31 +05:30
active_tokens: @active_resource_access_tokens,
resource: @project,
2020-05-24 23:13:21 +05:30
type: type,
type_plural: type_plural,
revoke_route_helper: ->(token) { revoke_namespace_project_settings_access_token_path(id: token) },
no_active_tokens_message: _('This project has no active access tokens.')