metamaps--metamaps/views/doorkeeper/applications/_form.js

37 lines
1.7 KiB
JavaScript
Raw Normal View History

2018-03-05 17:33:16 +00:00
{ form_for application, url: doorkeeper_submit_path(application), html: {className: 'form-horizontal', role: 'form'} do |f| }
2018-03-04 02:25:42 +00:00
{ if application.errors.any? }
2018-03-05 17:33:16 +00:00
<div className="alert alert-danger" data-alert><p>{ t('doorkeeper.applications.form.error') }</p></div>
2018-03-04 02:25:42 +00:00
{ end }
2018-03-05 17:33:16 +00:00
{ content_tag :div, className: "form-group#{' has-error' if application.errors[:name].present?}" do }
{ f.label :name, className: 'col-sm-2 control-label' }
<div className="col-sm-10">
{ f.text_field :name, className: 'form-control' }
2018-03-04 02:25:42 +00:00
{ doorkeeper_errors_for application, :name }
</div>
2018-03-04 02:25:42 +00:00
{ end }
2018-03-05 17:33:16 +00:00
{ content_tag :div, className: "form-group#{' has-error' if application.errors[:redirect_uri].present?}" do }
{ f.label :redirect_uri, className: 'col-sm-2 control-label' }
<div className="col-sm-10">
{ f.text_area :redirect_uri, className: 'form-control' }
2018-03-04 02:25:42 +00:00
{ doorkeeper_errors_for application, :redirect_uri }
2018-03-05 17:33:16 +00:00
<span className="help-block">
2018-03-04 02:25:42 +00:00
{ t('doorkeeper.applications.help.redirect_uri') }.
</span>
2018-03-04 02:25:42 +00:00
{ if Doorkeeper.configuration.native_redirect_uri }
2018-03-05 17:33:16 +00:00
<span className="help-block">
2018-03-04 02:25:42 +00:00
{ raw t('doorkeeper.applications.help.native_redirect_uri', native_redirect_uri: "<code>#{ Doorkeeper.configuration.native_redirect_uri }</code>") }
</span>
2018-03-04 02:25:42 +00:00
{ end }
</div>
2018-03-04 02:25:42 +00:00
{ end }
2018-03-05 17:33:16 +00:00
<div className="form-group">
<div className="col-sm-offset-2 col-sm-10">
{ f.submit t('doorkeeper.applications.buttons.submit'), className: "btn btn-primary" }
{ link_to t('doorkeeper.applications.buttons.cancel'), oauth_applications_path, :className => "button link-button red-button" }
</div>
</div>
2018-03-04 02:25:42 +00:00
{ end }