summaryrefslogtreecommitdiff
path: root/app/views/admin/application_settings/_sourcegraph.html.haml
blob: 65b2a95bcc189baf30a3ffbd8c06e350d80bea9d (plain)
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
- return unless Gitlab::Sourcegraph.feature_available?
- expanded = integration_expanded?('sourcegraph_')

%section.settings.as-sourcegraph.no-animate#js-sourcegraph-settings{ class: ('expanded' if expanded) }
  .settings-header
    %h4
      = _('Sourcegraph')
    %button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' }
      = expanded ? _('Collapse') : _('Expand')
    %p
      - link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: 'https://sourcegraph.com/' }
      - link_end = "#{sprite_icon('external-link', size: 12, css_class: 'ml-1 vertical-align-center')}</a>".html_safe
      = s_('SourcegraphAdmin|Enable code intelligence powered by %{link_start}Sourcegraph%{link_end} on your GitLab instance\'s code views and merge requests.').html_safe % { link_start: link_start, link_end: link_end }
      %span
        = link_to s_('SourcegraphAdmin|Learn more.'), help_page_path('integration/sourcegraph.md'), target: '_blank', rel: 'noopener noreferrer'


  .settings-content
    = form_for @application_setting, url: general_admin_application_settings_path(anchor: 'js-sourcegraph-settings'), html: { class: 'fieldset-form', id: 'sourcegraph-settings' } do |f|
      = form_errors(@application_setting)

      %fieldset
        .form-group
          .form-check
            = f.check_box :sourcegraph_enabled, class: 'form-check-input'
            = f.label :sourcegraph_enabled, s_('SourcegraphAdmin|Enable Sourcegraph'), class: 'form-check-label'
        .form-group
          .form-check
            = f.check_box :sourcegraph_public_only, class: 'form-check-input'
            = f.label :sourcegraph_public_only, s_('SourcegraphAdmin|Block on private and internal projects'), class: 'form-check-label'
            .form-text.text-muted
              = s_('SourcegraphAdmin|Only public projects have code intelligence enabled and communicate with Sourcegraph.')
        .form-group
          = f.label :sourcegraph_url, s_('SourcegraphAdmin|Sourcegraph URL'), class: 'label-bold'
          = f.text_field :sourcegraph_url, class: 'form-control gl-form-input', placeholder: s_('SourcegraphAdmin|https://sourcegraph.example.com')
          .form-text.text-muted
            = s_('SourcegraphAdmin|Configure the URL to a Sourcegraph instance which can read your GitLab projects.')
      = f.submit s_('SourcegraphAdmin|Save changes'), class: 'gl-button btn btn-confirm'