summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-04-08 11:14:08 +0000
committerDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-04-08 11:14:08 +0000
commita4ff12772893ec0596f13b8b8103de2824b84072 (patch)
tree80a38ac8be00b01877b2ccb522a860e347977b19
parent4902dca9661ebcaaaecd7deff967225b657423b5 (diff)
parentb9069f31b98a7b6b2c1ad512c6becd1b6e70ea6c (diff)
downloadgitlab-ce-a4ff12772893ec0596f13b8b8103de2824b84072.tar.gz
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
-rw-r--r--app/views/admin/applications/_form.html.haml10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/views/admin/applications/_form.html.haml b/app/views/admin/applications/_form.html.haml
index b77d188a38d..fa4e6335c73 100644
--- a/app/views/admin/applications/_form.html.haml
+++ b/app/views/admin/applications/_form.html.haml
@@ -1,13 +1,15 @@
= 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"} &times;
+ - 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'