提交 a4ff1277 编写于 作者: D Dmitriy Zaporozhets

Merge branch 'rs-application-form-messages' into 'master'

Make the "New Application" form's error messages visible

Prior, if you submit the form without values the error text and the form fields were white-on-white:

![Screen_Shot_2015-04-01_at_8.25.56_PM](https://dev.gitlab.org/gitlab/gitlabhq/uploads/17eb44e65fc9c5ddd4a529e3927cd9b6/Screen_Shot_2015-04-01_at_8.25.56_PM.png)

After:

![Screen_Shot_2015-04-06_at_10.13.07_PM](https://dev.gitlab.org/gitlab/gitlabhq/uploads/be53d6971ec1c34f415e75a0307b6577/Screen_Shot_2015-04-06_at_10.13.07_PM.png)

See merge request !1752
= form_for [:admin, @application], url: @url, html: {class: 'form-horizontal', role: 'form'} do |f|
- if application.errors.any?
.alert.alert-danger{"data-alert" => ""}
%p Whoops! Check your form for possible errors
= content_tag :div, class: "form-group#{' has-error' if application.errors[:name].present?}" do
.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
= f.label :name, class: 'col-sm-2 control-label'
.col-sm-10
= f.text_field :name, class: 'form-control'
= doorkeeper_errors_for application, :name
= content_tag :div, class: "form-group#{' has-error' if application.errors[:redirect_uri].present?}" do
= content_tag :div, class: 'form-group' do
= f.label :redirect_uri, class: 'col-sm-2 control-label'
.col-sm-10
= f.text_area :redirect_uri, class: 'form-control'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册