new.html.haml 2.76 KB
Newer Older
1
%main{ :role => "main" }
2
  .modal-no-backdrop.modal-doorkeepr-auth
3 4 5
    .modal-content
      .modal-header
        %h3.page-title
6 7
          - link_to_client = link_to(@pre_auth.client.name, @pre_auth.redirect_uri, target: '_blank', rel: 'noopener noreferrer')
          = _("Authorize %{link_to_client} to use your account?")
8

9 10 11 12 13
      .modal-body
        - if current_user.admin?
          .text-warning
            %p
              = icon("exclamation-triangle fw")
14
              = _('You are an admin, which means granting access to <strong>%{client_name}</strong> will allow them to interact with GitLab as an admin as well. Proceed with caution.').html_safe % { client_name: @pre_auth.client.name }
15
        %p
16 17
          - link_to_client = link_to(@pre_auth.client.name, @pre_auth.redirect_uri, target: '_blank', rel: 'noopener noreferrer')
          = _("An application called %{link_to_client} is requesting access to your GitLab account.").html_safe % { link_to_client: link_to_client }
18 19 20

          - auth_app_owner = @pre_auth.client.application.owner
          - if auth_app_owner
21 22
            - link_to_owner = link_to(auth_app_owner.name, user_path(auth_app_owner))
            = _("This application was created by %{link_to_owner}.").html_safe % { link_to_owner: link_to_owner }
23

24
          = _("Please note that this application is not provided by GitLab and you should verify its authenticity before allowing access.")
25 26
        - if @pre_auth.scopes
          %p
27
            = _("This application will be able to:")
28 29
            %ul
              - @pre_auth.scopes.each do |scope|
30 31
                %li
                  %strong= t scope, scope: [:doorkeeper, :scopes]
32
                  .text-secondary= t scope, scope: [:doorkeeper, :scope_desc]
33 34 35 36 37 38 39 40
        .form-actions.text-right
          = form_tag oauth_authorization_path, method: :delete, class: 'inline'  do
            = hidden_field_tag :client_id, @pre_auth.client.uid
            = hidden_field_tag :redirect_uri, @pre_auth.redirect_uri
            = hidden_field_tag :state, @pre_auth.state
            = hidden_field_tag :response_type, @pre_auth.response_type
            = hidden_field_tag :scope, @pre_auth.scope
            = hidden_field_tag :nonce, @pre_auth.nonce
41
            = submit_tag _("Deny"), class: "btn btn-danger"
42 43 44 45 46 47 48
          = form_tag oauth_authorization_path, method: :post, class: 'inline' do
            = hidden_field_tag :client_id, @pre_auth.client.uid
            = hidden_field_tag :redirect_uri, @pre_auth.redirect_uri
            = hidden_field_tag :state, @pre_auth.state
            = hidden_field_tag :response_type, @pre_auth.response_type
            = hidden_field_tag :scope, @pre_auth.scope
            = hidden_field_tag :nonce, @pre_auth.nonce
49
            = submit_tag _("Authorize"), class: "btn btn-success prepend-left-10"