%main{ :role => "main" }
  .modal-no-backdrop
    .modal-content
      .modal-header
        %h3.page-title
          Authorize
          = link_to @pre_auth.client.name, @pre_auth.redirect_uri, target: '_blank', rel: 'noopener noreferrer'
          to use your account?

      .modal-body
        - if current_user.admin?
          .text-warning
            %p
              = icon("exclamation-triangle fw")
              You are an admin, which means granting access to
              %strong= @pre_auth.client.name
              will allow them to interact with GitLab as an admin as well. Proceed with caution.
        %p
          You are about to authorize
          = link_to @pre_auth.client.name, @pre_auth.redirect_uri, target: '_blank', rel: 'noopener noreferrer'
          to use your account.
          - if @pre_auth.scopes
            This application will be able to:
            %ul
              - @pre_auth.scopes.each do |scope|
                %li= t scope, scope: [:doorkeeper, :scopes]
        .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
            = submit_tag "Deny", class: "btn btn-danger"
          = 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
            = submit_tag "Authorize", class: "btn btn-success prepend-left-10"
