diff options
author | Gabriel Gizotti <gabriel@gizotti.com> | 2016-11-29 07:10:59 +1000 |
---|---|---|
committer | Gabriel Gizotti <gabriel@gizotti.com> | 2016-12-16 19:13:17 +1000 |
commit | 9e321043c72322ae12aba230b49f9da326e66e56 (patch) | |
tree | 57393714cd7bf73b9fce884ac6704c48a4ddcf01 | |
parent | 4181528569a81004d4e64f3e9726fc653a322cc7 (diff) | |
download | gitlab-ce-9e321043c72322ae12aba230b49f9da326e66e56.tar.gz |
extract duplicate logic into a variable on _commit_message_container
-rw-r--r-- | app/views/shared/_commit_message_container.html.haml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/views/shared/_commit_message_container.html.haml b/app/views/shared/_commit_message_container.html.haml index 803cbb47e55..2b2da446d09 100644 --- a/app/views/shared/_commit_message_container.html.haml +++ b/app/views/shared/_commit_message_container.html.haml @@ -1,5 +1,6 @@ .form-group.commit_message-group - nonce = SecureRandom.hex + - descriptions = local_assigns.slice(:message_with_description, :message_without_description) = label_tag "commit_message-#{nonce}", class: 'control-label' do Commit message .col-sm-10 @@ -8,14 +9,14 @@ = text_area_tag 'commit_message', (params[:commit_message] || local_assigns[:text] || local_assigns[:placeholder]), class: 'form-control js-commit-message', placeholder: local_assigns[:placeholder], - data: local_assigns.slice(:message_with_description, :message_without_description), + data: descriptions, required: true, rows: (local_assigns[:rows] || 3), id: "commit_message-#{nonce}" - if local_assigns[:hint] %p.hint Try to keep the first line under 52 characters and the others under 72. - -if local_assigns.slice(:message_with_description, :message_without_description).present? + - if descriptions.present? %p.hint.with-description-hint = link_to "#", class: "with-description-link" do Include description in commit message |