weathermen/soundstorm

View on GitHub
app/views/doorkeeper/applications/_form.html.haml

Summary

Maintainability
Test Coverage
= form_for application, url: doorkeeper_submit_path(application), html: { role: 'form' } do |f|
  - if application.errors.any?
    .alert.alert-danger{"data-alert" => ""}
      %p= t('doorkeeper.applications.form.error')
  .form-group.row
    = f.label :name, class: 'col-sm-2 col-form-label font-weight-bold'
    .col-sm-10
      = f.text_field :name, class: "form-control #{ 'is-invalid' if application.errors[:name].present? }", required: true
      = doorkeeper_errors_for application, :name
  .form-group.row
    = f.label :redirect_uri, class: 'col-sm-2 col-form-label font-weight-bold'
    .col-sm-10
      = f.text_area :redirect_uri, class: "form-control #{ 'is-invalid' if application.errors[:redirect_uri].present? }"
      = doorkeeper_errors_for application, :redirect_uri
      %span.form-text.text-secondary
        = t('doorkeeper.applications.help.redirect_uri')
      - if Doorkeeper.configuration.native_redirect_uri
        %span.form-text.text-secondary
          = raw t('doorkeeper.applications.help.native_redirect_uri', native_redirect_uri: content_tag(:code, class: 'bg-light') { Doorkeeper.configuration.native_redirect_uri })
  .form-group.row
    = f.label :confidential, class: 'col-sm-2 form-check-label font-weight-bold'
    .col-sm-10
      = f.check_box :confidential, class: "checkbox #{ 'is-invalid' if application.errors[:confidential].present? }"
      = doorkeeper_errors_for application, :confidential
      %span.form-text.text-secondary
        = t('doorkeeper.applications.help.confidential')
  .form-group.row
    = f.label :scopes, class: 'col-sm-2 col-form-label font-weight-bold'
    .col-sm-10
      = f.text_field :scopes, class: "form-control #{ 'has-error' if application.errors[:scopes].present? }"
      = doorkeeper_errors_for application, :scopes
      %span.form-text.text-secondary
        = t('doorkeeper.applications.help.scopes')
  .form-group
    .col-sm-offset-2.col-sm-10
      = f.submit t('doorkeeper.applications.buttons.submit'), class: 'btn btn-primary'
      = link_to t('doorkeeper.applications.buttons.cancel'), oauth_applications_path, class: 'btn btn-secondary'