summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-06-16 11:50:13 +0000
committerDouwe Maan <douwe@gitlab.com>2015-06-16 11:50:13 +0000
commit63969337a9d9276ea67d31018e809a87c31c0945 (patch)
treef74a13967053d4933e5d94ecec4a3bf1861f7f99 /app/views
parentb65f40b5c02bb6ce53103dcdfc88ce1a0e4759f9 (diff)
parent4cf7d8d956acf5b3cbefa1f4b52d8c0db8d0b04c (diff)
downloadgitlab-ce-63969337a9d9276ea67d31018e809a87c31c0945.tar.gz
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
Diffstat (limited to 'app/views')
-rw-r--r--app/views/doorkeeper/applications/_form.html.haml30
-rw-r--r--app/views/doorkeeper/applications/new.html.haml7
-rw-r--r--app/views/layouts/nav/_profile.html.haml2
3 files changed, 25 insertions, 14 deletions
diff --git a/app/views/doorkeeper/applications/_form.html.haml b/app/views/doorkeeper/applications/_form.html.haml
index a5fec2fabdb..98a61ab211b 100644
--- a/app/views/doorkeeper/applications/_form.html.haml
+++ b/app/views/doorkeeper/applications/_form.html.haml
@@ -1,17 +1,22 @@
= form_for application, url: doorkeeper_submit_path(application), 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
- = f.label :name, class: 'col-sm-2 control-label'
+ .alert.alert-danger
+ %ul
+ - application.errors.full_messages.each do |msg|
+ %li= msg
+
+ .form-group
+ = f.label :name, class: '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
- = f.label :redirect_uri, class: 'col-sm-2 control-label'
+ = f.text_field :name, class: 'form-control', required: true
+
+ .form-group
+ = f.label :redirect_uri, class: 'control-label'
+
.col-sm-10
- = f.text_area :redirect_uri, class: 'form-control'
- = doorkeeper_errors_for application, :redirect_uri
+ = f.text_area :redirect_uri, class: 'form-control', required: true
+
%span.help-block
Use one line per URI
- if Doorkeeper.configuration.native_redirect_uri
@@ -19,6 +24,7 @@
Use
%code= Doorkeeper.configuration.native_redirect_uri
for local tests
+
.form-actions
- = f.submit 'Submit', class: "btn btn-primary wide"
- = link_to "Cancel", applications_profile_path, class: "btn btn-default"
+ = f.submit 'Submit', class: "btn btn-create"
+ = link_to "Cancel", applications_profile_path, class: "btn btn-cancel"
diff --git a/app/views/doorkeeper/applications/new.html.haml b/app/views/doorkeeper/applications/new.html.haml
index 655845e4af5..fd32a468b45 100644
--- a/app/views/doorkeeper/applications/new.html.haml
+++ b/app/views/doorkeeper/applications/new.html.haml
@@ -1,2 +1,7 @@
-%h3.page-title New application
+- page_title "New Application"
+
+%h3.page-title New Application
+
+%hr
+
= render 'form', application: @application \ No newline at end of file
diff --git a/app/views/layouts/nav/_profile.html.haml b/app/views/layouts/nav/_profile.html.haml
index 121665bd536..914e1b83d1f 100644
--- a/app/views/layouts/nav/_profile.html.haml
+++ b/app/views/layouts/nav/_profile.html.haml
@@ -9,7 +9,7 @@
= icon('gear fw')
%span
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
= icon('cloud fw')
%span