summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-09-22 21:01:03 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-09-22 21:01:03 +0300
commitf96b954b1c1dc48dae2a5436c65d1ab4effffa42 (patch)
tree756ea98fd0bd949713257370d055ac96e7b1e6a3
parentdb12e2dc8d70536af1a886162cb19705d458f560 (diff)
parenteb033aa60ec572da447871daf5f1f171439ae5e2 (diff)
downloadgitlab-ce-f96b954b1c1dc48dae2a5436c65d1ab4effffa42.tar.gz
Merge pull request #7804 from cirosantilli/factor-issue-mr-form-error
Factor issue and MR edit form error list.
-rw-r--r--app/views/projects/_issuable_form.html.haml7
-rw-r--r--app/views/projects/issues/_form.html.haml7
-rw-r--r--app/views/projects/merge_requests/_form.html.haml5
3 files changed, 7 insertions, 12 deletions
diff --git a/app/views/projects/_issuable_form.html.haml b/app/views/projects/_issuable_form.html.haml
index 824460e7fed..3f288814b51 100644
--- a/app/views/projects/_issuable_form.html.haml
+++ b/app/views/projects/_issuable_form.html.haml
@@ -1,3 +1,10 @@
+- if issuable.errors.any?
+ .row
+ .col-sm-10.col-sm-offset-2
+ .alert.alert-danger
+ - issuable.errors.full_messages.each do |msg|
+ %span= msg
+ %br
.form-group
= f.label :title, class: 'control-label' do
%strong= 'Title *'
diff --git a/app/views/projects/issues/_form.html.haml b/app/views/projects/issues/_form.html.haml
index d063f92e87f..a4a6b0005c7 100644
--- a/app/views/projects/issues/_form.html.haml
+++ b/app/views/projects/issues/_form.html.haml
@@ -9,13 +9,6 @@
= "Please review the <strong>#{link_to "guidelines for contribution", contribution_guide_url}</strong> to this repository.".html_safe
= form_for [@project, @issue], html: { class: 'form-horizontal issue-form' } do |f|
- -if @issue.errors.any?
- .row
- .col-sm-10.col-sm-offset-2
- .alert.alert-danger
- - @issue.errors.full_messages.each do |msg|
- %span= msg
- %br
= render 'projects/issuable_form', f: f, issuable: @issue
.form-group
= f.label :label_ids, class: 'control-label' do
diff --git a/app/views/projects/merge_requests/_form.html.haml b/app/views/projects/merge_requests/_form.html.haml
index a97547aabec..8ad47724fe7 100644
--- a/app/views/projects/merge_requests/_form.html.haml
+++ b/app/views/projects/merge_requests/_form.html.haml
@@ -9,11 +9,6 @@
%strong #{link_to "guidelines for contribution", contribution_guide_url}
to this repository.
- -if @merge_request.errors.any?
- .alert.alert-danger
- - @merge_request.errors.full_messages.each do |msg|
- %div= msg
-
.merge-request-form-info
= render 'projects/issuable_form', f: f, issuable: @merge_request
.form-group