_form.html.haml 1.11 KB
Newer Older
Valery Sizov's avatar
Valery Sizov committed
1 2
= form_for [:admin, @application], url: @url, html: {class: 'form-horizontal', role: 'form'} do |f|
  - if application.errors.any?
3 4 5 6 7
    .alert.alert-danger
      %button{ type: "button", class: "close", "data-dismiss" => "alert"} ×
      - application.errors.full_messages.each do |msg|
        %p= msg
  = content_tag :div, class: 'form-group' do
Valery Sizov's avatar
Valery Sizov committed
8 9 10 11
    = f.label :name, class: 'col-sm-2 control-label'
    .col-sm-10
      = f.text_field :name, class: 'form-control'
      = doorkeeper_errors_for application, :name
12
  = content_tag :div, class: 'form-group' do
Valery Sizov's avatar
Valery Sizov committed
13 14 15 16 17 18 19 20 21 22 23 24 25 26
    = f.label :redirect_uri, class: 'col-sm-2 control-label'
    .col-sm-10
      = f.text_area :redirect_uri, class: 'form-control'
      = doorkeeper_errors_for application, :redirect_uri
      %span.help-block
        Use one line per URI
      - if Doorkeeper.configuration.native_redirect_uri
        %span.help-block
          Use
          %code= Doorkeeper.configuration.native_redirect_uri
          for local tests
  .form-actions
    = f.submit 'Submit', class: "btn btn-primary wide"
    = link_to "Cancel", admin_applications_path, class: "btn btn-default"