Commit 63969337 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'applications_form' into 'master'

Fix UI issues in Applications form

@douwe Thanks for reviewing this small fix.

---

Before:

![application_form_before](https://dev.gitlab.org/gitlab/gitlabhq/uploads/11fbee17ad6a4c9456cd7d6cba5ae429/application_form_before.png)

---

After:

![application_form_after](https://dev.gitlab.org/gitlab/gitlabhq/uploads/0c64214ccda6c77095f468fcb8c748f3/application_form_after.png)

See merge request !1859
parents b65f40b5 4cf7d8d9
= form_for application, url: doorkeeper_submit_path(application), html: {class: 'form-horizontal', role: 'form'} do |f| = form_for application, url: doorkeeper_submit_path(application), html: {class: 'form-horizontal', role: 'form'} do |f|
- if application.errors.any? - if application.errors.any?
.alert.alert-danger{"data-alert" => ""} .alert.alert-danger
%p Whoops! Check your form for possible errors %ul
= content_tag :div, class: "form-group#{' has-error' if application.errors[:name].present?}" do - application.errors.full_messages.each do |msg|
= f.label :name, class: 'col-sm-2 control-label' %li= msg
.form-group
= f.label :name, class: 'control-label'
.col-sm-10 .col-sm-10
= f.text_field :name, class: 'form-control' = f.text_field :name, class: 'form-control', required: true
= doorkeeper_errors_for application, :name
= content_tag :div, class: "form-group#{' has-error' if application.errors[:redirect_uri].present?}" do .form-group
= f.label :redirect_uri, class: 'col-sm-2 control-label' = f.label :redirect_uri, class: 'control-label'
.col-sm-10 .col-sm-10
= f.text_area :redirect_uri, class: 'form-control' = f.text_area :redirect_uri, class: 'form-control', required: true
= doorkeeper_errors_for application, :redirect_uri
%span.help-block %span.help-block
Use one line per URI Use one line per URI
- if Doorkeeper.configuration.native_redirect_uri - if Doorkeeper.configuration.native_redirect_uri
...@@ -19,6 +24,7 @@ ...@@ -19,6 +24,7 @@
Use Use
%code= Doorkeeper.configuration.native_redirect_uri %code= Doorkeeper.configuration.native_redirect_uri
for local tests for local tests
.form-actions .form-actions
= f.submit 'Submit', class: "btn btn-primary wide" = f.submit 'Submit', class: "btn btn-create"
= link_to "Cancel", applications_profile_path, class: "btn btn-default" = link_to "Cancel", applications_profile_path, class: "btn btn-cancel"
%h3.page-title New application - page_title "New Application"
%h3.page-title New Application
%hr
= render 'form', application: @application = render 'form', application: @application
\ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
= icon('gear fw') = icon('gear fw')
%span %span
Account Account
= nav_link(path: ['profiles#applications', 'applications#edit', 'applications#show', 'applications#new']) do = nav_link(path: ['profiles#applications', 'applications#edit', 'applications#show', 'applications#new', 'applications#create']) do
= link_to applications_profile_path, title: 'Applications', data: {placement: 'right'} do = link_to applications_profile_path, title: 'Applications', data: {placement: 'right'} do
= icon('cloud fw') = icon('cloud fw')
%span %span
......
...@@ -176,7 +176,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps ...@@ -176,7 +176,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
end end
step 'I should see application form' do step 'I should see application form' do
expect(page).to have_content "New application" expect(page).to have_content "New Application"
end end
step 'I fill application form out and submit' do step 'I fill application form out and submit' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment