summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-10-03 13:34:25 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-10-03 13:34:25 +0300
commit4ebe718d69bc4a619f829ab54a81a6ed03cd56c1 (patch)
tree74e851919e1ffe9a8b4368c3e48d7d08a6ccf73b /app
parent0cc30145f441a16ce513bba942ea67ede4086a7f (diff)
parent3098e7a453c84ac4df1686b8bad6ef8004aca60d (diff)
downloadgitlab-ce-4ebe718d69bc4a619f829ab54a81a6ed03cd56c1.tar.gz
Merge branch 'factor-commit-msg-textarea' of https://github.com/cirosantilli/gitlabhq into cirosantilli-factor-commit-msg-textarea
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Conflicts: app/views/projects/blob/_remove.html.haml
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/merge_request.js.coffee2
-rw-r--r--app/controllers/projects/merge_requests_controller.rb2
-rw-r--r--app/views/projects/blob/_remove.html.haml9
-rw-r--r--app/views/projects/edit_tree/show.html.haml9
-rw-r--r--app/views/projects/merge_requests/show/_mr_accept.html.haml12
-rw-r--r--app/views/projects/new_tree/show.html.haml11
-rw-r--r--app/views/shared/_commit_message_container.html.haml17
7 files changed, 25 insertions, 37 deletions
diff --git a/app/assets/javascripts/merge_request.js.coffee b/app/assets/javascripts/merge_request.js.coffee
index 1c391c61bba..4c9f20ae6fa 100644
--- a/app/assets/javascripts/merge_request.js.coffee
+++ b/app/assets/javascripts/merge_request.js.coffee
@@ -15,7 +15,7 @@ class MergeRequest
modal = $('#modal_merge_info').modal(show: false)
- disableButtonIfEmptyField '#merge_commit_message', '.accept_merge_request'
+ disableButtonIfEmptyField '#commit_message', '.accept_merge_request'
# Local jQuery finder
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index 16bb3a5476e..e13773d6465 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -122,7 +122,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
if @merge_request.open? && @merge_request.can_be_merged?
@merge_request.should_remove_source_branch = params[:should_remove_source_branch]
- @merge_request.automerge!(current_user, params[:merge_commit_message])
+ @merge_request.automerge!(current_user, params[:commit_message])
@status = true
else
@status = false
diff --git a/app/views/projects/blob/_remove.html.haml b/app/views/projects/blob/_remove.html.haml
index 90659343d97..da84dc4b6cf 100644
--- a/app/views/projects/blob/_remove.html.haml
+++ b/app/views/projects/blob/_remove.html.haml
@@ -10,13 +10,8 @@
.modal-body
= form_tag project_blob_path(@project, @id), method: :delete, class: 'form-horizontal' do
- .form-group.commit_message-group
- = label_tag 'commit_message', class: "control-label" do
- Commit message
- .col-sm-10
- = render 'shared/commit_message_container', {textarea: text_area_tag('commit_message',
- params[:commit_message], placeholder: "Remove #{@blob.name}",
- required: true, rows: 3, class: 'form-control')}
+ = render 'shared/commit_message_container', params: params,
+ placeholder: 'Removed this file because...'
.form-group
.col-sm-2
.col-sm-10
diff --git a/app/views/projects/edit_tree/show.html.haml b/app/views/projects/edit_tree/show.html.haml
index 62798b51d82..aca7d874abf 100644
--- a/app/views/projects/edit_tree/show.html.haml
+++ b/app/views/projects/edit_tree/show.html.haml
@@ -21,13 +21,8 @@
.center
%h2
%i.icon-spinner.icon-spin
-
- .form-group.commit_message-group
- = label_tag 'commit_message', class: "control-label" do
- Commit message
- .col-sm-10
- = render 'shared/commit_message_container', {textarea: text_area_tag('commit_message', '',
- placeholder: "Update #{@blob.name}", required: true, rows: 3, class: 'form-control')}
+ = render 'shared/commit_message_container', params: params,
+ placeholder: "Update #{@blob.name}"
.form-actions
= hidden_field_tag 'last_commit', @last_commit
= hidden_field_tag 'content', '', id: "file-content"
diff --git a/app/views/projects/merge_requests/show/_mr_accept.html.haml b/app/views/projects/merge_requests/show/_mr_accept.html.haml
index 88cc8e17fa6..e2cf2b60234 100644
--- a/app/views/projects/merge_requests/show/_mr_accept.html.haml
+++ b/app/views/projects/merge_requests/show/_mr_accept.html.haml
@@ -22,15 +22,9 @@
%strong= link_to "modify merge commit message", "#", class: "modify-merge-commit-link js-toggle-button", title: "Modify merge commit message"
before accepting merge request
.js-toggle-content.hide
- .form-group
- = label_tag :merge_commit_message, "Commit message", class: 'control-label'
- .col-sm-10
- = render 'shared/commit_message_container', {textarea: text_area_tag(:merge_commit_message,
- @merge_request.merge_commit_message, class: "form-control js-gfm-input", rows: 14, required: true)}
- %p.hint
- Try to keep the first line under 52 characters
- and the others under 72.
-
+ = render 'shared/commit_message_container', params: params,
+ text: @merge_request.merge_commit_message,
+ rows: 14, hint: true
.accept-group
.pull-left
= f.submit "Accept Merge Request", class: "btn btn-create accept_merge_request"
diff --git a/app/views/projects/new_tree/show.html.haml b/app/views/projects/new_tree/show.html.haml
index 24d77344fd5..3df1c032ba1 100644
--- a/app/views/projects/new_tree/show.html.haml
+++ b/app/views/projects/new_tree/show.html.haml
@@ -19,15 +19,8 @@
Encoding
.col-sm-10
= select_tag :encoding, options_for_select([ "base64", "text" ], "text"), class: 'form-control'
-
- .form-group.commit_message-group
- = label_tag 'commit_message', class: "control-label" do
- Commit message
- .col-sm-10
- = render 'shared/commit_message_container', {textarea: text_area_tag('commit_message',
- params[:commit_message], placeholder: 'Add new file',
- required: true, rows: 3, class: 'form-control')}
-
+ = render 'shared/commit_message_container', params: params,
+ placeholder: 'Add new file'
.file-holder
.file-title
%i.icon-file
diff --git a/app/views/shared/_commit_message_container.html.haml b/app/views/shared/_commit_message_container.html.haml
index 4365947e701..5071ff640f1 100644
--- a/app/views/shared/_commit_message_container.html.haml
+++ b/app/views/shared/_commit_message_container.html.haml
@@ -1,3 +1,14 @@
-.commit-message-container
- .max-width-marker
- = textarea
+.form-group.commit_message-group
+ = label_tag 'commit_message', class: 'control-label' do
+ Commit message
+ .col-sm-10
+ .commit-message-container
+ .max-width-marker
+ = text_area_tag 'commit_message',
+ (params[:commit_message] || local_assigns[:text]),
+ class: 'form-control', placeholder: local_assigns[:placeholder],
+ required: true, rows: (local_assigns[:rows] || 3)
+ - if local_assigns[:hint]
+ %p.hint
+ Try to keep the first line under 52 characters
+ and the others under 72.