#OAuth2.modal.fade(ng-controller="OAuth2", tabindex="-1")
  .modal-dialog
    form.modal-content(ng-submit="authorize()")
      .modal-header
        button(type="button"
               class="close"
               data-dismiss="modal"
               aria-label="Close")
          span(aria-hidden="true") &times;
        .modal-title
          h3 OAuth 2.0 Authorization
      .modal-body
        .alert.alert-info
          p <b>You may need to authorize the API console to perform certain actions</b>
          p Your information will not be collected or stored.
          p You can choose which scopes you want to enable below. Authorizing with no scopes selected may work for some endpoints.
        .form-group(ng-repeat="(scope, description) in oauthDefinition.scopes")
          label.checkbox-inline 
            input(type="checkbox" ng-model="addedScopes[scope]")
            span {{ scope }}
          p.small {{ description }}
        .form-group
          .btn.btn-default(ng-click="clearScopes()") Clear All
      .modal-footer
        .text-left
          .alert.alert-success(ng-if="alert.success") {{ alert.success }}
          .alert.alert-warning(ng-if="alert.warning") {{ alert.warning }}
          .alert.alert-danger(ng-if="alert.danger") {{ alert.danger }}
        button.btn.btn-success(ng-if="!alert.success" type="submit")
          span(ng-if="!loading") Authorize
          i.fa.fa-spin.fa-refresh(ng-if="loading")
