File: new.html.haml

package info (click to toggle)
gitlab 17.6.5-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 629,368 kB
  • sloc: ruby: 1,915,304; javascript: 557,307; sql: 60,639; xml: 6,509; sh: 4,567; makefile: 1,239; python: 406
file content (53 lines) | stat: -rw-r--r-- 3,164 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
- title = _('Authenticate with GitHub')
- page_title title
- header_title _("New project"), new_project_path
- add_to_breadcrumbs s_('ProjectsNew|Import project'), new_project_path(anchor: 'import_project')

.gl-border-solid.gl-border-gray-100.gl-border-0.gl-border-b-1
  %h1.gl-text-size-h1.gl-my-0.gl-py-4.gl-flex.gl-items-center.gl-gap-3
    = sprite_icon('github', size: 24)
    %span= title

%p.gl-mt-5.gl-mb-0
  = import_github_authorize_message

- if !has_ci_cd_only_params?
  .gl-mt-5
    - if github_import_configured?
      = render Pajamas::ButtonComponent.new(variant: :confirm,
        href: status_import_github_path(namespace_id: params[:namespace_id]),
        icon: 'github') do
        = title
    - else
      = render Pajamas::AlertComponent.new(variant: :info, dismissible: false) do |c|
        - c.with_body do
          = import_configure_github_admin_message

  %hr

= form_tag personal_access_token_import_github_path, method: :post, class: 'gl-mt-3' do
  .form-group.gl-form-group
    %label.col-form-label{ for: 'personal_access_token' }= _('Personal access token')
    = hidden_field_tag(:namespace_id, params[:namespace_id])
    = password_field_tag :personal_access_token, '', class: 'form-control gl-form-input', placeholder: _('e.g. %{token}') % { token: '8d3f016698e...' }, data: { testid: 'personal-access-token-field' }
    %span.form-text.gl-text-subtle
      - code_pair = tag_pair(tag.code, :code_start, :code_end)
      - github_link_tag_pair = tag_pair(link_to('', 'https://github.com/settings/tokens', target: '_blank', rel: 'noopener noreferrer'), :link_start, :link_end)
      = safe_format(s_('GithubImport|Create and provide your GitHub %{link_start}personal access token%{link_end}.'), github_link_tag_pair)
      %br
      = safe_format(s_('GithubImport|Use a classic GitHub personal access token with the following scopes:'))
      %ul
        - if has_ci_cd_only_params?
          %li= safe_format(s_('GithubImporter|%{code_start}repo%{code_end}: Used to display a list of your public and private repositories that are available to connect to.'), code_pair)
        - else
          %li= safe_format(s_('GithubImporter|%{code_start}repo%{code_end}: Used to display a list of your public and private repositories that are available to import from.'), code_pair)
          %li= safe_format(s_('GithubImporter|%{code_start}read:org%{code_end} (optional): Used to import collaborators from GitHub repositories, or if your project has Git LFS files.'), code_pair)
      - docs_link = link_to('', help_page_path('user/project/import/github.md', anchor: 'use-a-github-personal-access-token'), target: '_blank', rel: 'noopener noreferrer')
      - docs_link_tag_pair = tag_pair(docs_link, :link_start, :link_end)
      = safe_format(s_('GithubImport|%{link_start}Learn more%{link_end}.'), docs_link_tag_pair)

  .form-actions.gl-flex.gl-justify-end
    = render Pajamas::ButtonComponent.new(href: new_project_path) do
      = _('Cancel')
    = render Pajamas::ButtonComponent.new(variant: :confirm, type: :submit, button_options: { class: 'gl-ml-3', data: { testid: 'authenticate-button' } }) do
      = _('Authenticate')