Commit 07a9d44de7a54b2cd1bffd9fcc830f7b2a03b549

Authored by Ciro Santillli
Committed by Ciro Santilli
1 parent 9b52affe

Commit message textareas have 72 char mark line.

app/assets/stylesheets/generic/forms.scss
@@ -75,3 +75,26 @@ label { @@ -75,3 +75,26 @@ label {
75 width: 200px; 75 width: 200px;
76 } 76 }
77 } 77 }
  78 +
  79 +.commit-message-container {
  80 + background-color: $body-bg;
  81 + position: relative;
  82 + font-family: $monospace_font;
  83 + $left: 12px;
  84 + .max-width-marker {
  85 + color: rgba(0, 0, 0, 0.0);
  86 + font-family: inherit;
  87 + left: $left;
  88 + height: 100%;
  89 + border-right: 1px solid mix($input-border, white);
  90 + position: absolute;
  91 + z-index: 1;
  92 + }
  93 + > textarea {
  94 + background-color: rgba(0, 0, 0, 0.0);
  95 + font-family: inherit;
  96 + padding-left: $left;
  97 + position: relative;
  98 + z-index: 2;
  99 + }
  100 +}
app/assets/stylesheets/sections/tree.scss
@@ -151,3 +151,5 @@ @@ -151,3 +151,5 @@
151 } 151 }
152 } 152 }
153 } 153 }
  154 +
  155 +#modal-remove-blob > .modal-dialog { width: 850px; }
app/views/projects/blob/_remove.html.haml
@@ -14,7 +14,8 @@ @@ -14,7 +14,8 @@
14 = label_tag 'commit_message', class: "control-label" do 14 = label_tag 'commit_message', class: "control-label" do
15 Commit message 15 Commit message
16 .col-sm-10 16 .col-sm-10
17 - = text_area_tag 'commit_message', params[:commit_message], placeholder: "Removed this file because...", required: true, rows: 3, class: 'form-control' 17 + = render 'shared/commit_message_container', {textarea: text_area_tag('commit_message',
  18 + params[:commit_message], placeholder: "Removed this file because...", required: true, rows: 3, class: 'form-control')}
18 .form-group 19 .form-group
19 .col-sm-2 20 .col-sm-2
20 .col-sm-10 21 .col-sm-10
app/views/projects/edit_tree/show.html.haml
@@ -19,7 +19,8 @@ @@ -19,7 +19,8 @@
19 = label_tag 'commit_message', class: "control-label" do 19 = label_tag 'commit_message', class: "control-label" do
20 Commit message 20 Commit message
21 .col-sm-10 21 .col-sm-10
22 - = text_area_tag 'commit_message', '', placeholder: "Update #{@blob.name}", required: true, rows: 3, class: 'form-control' 22 + = render 'shared/commit_message_container', {textarea: text_area_tag('commit_message', '',
  23 + placeholder: "Update #{@blob.name}", required: true, rows: 3, class: 'form-control')}
23 .form-actions 24 .form-actions
24 = hidden_field_tag 'last_commit', @last_commit 25 = hidden_field_tag 'last_commit', @last_commit
25 = hidden_field_tag 'content', '', id: "file-content" 26 = hidden_field_tag 'content', '', id: "file-content"
app/views/projects/merge_requests/show/_mr_accept.html.haml
@@ -21,7 +21,6 @@ @@ -21,7 +21,6 @@
21 = link_to "click here", "#modal_merge_info", class: "how_to_merge_link vlink", title: "How To Merge", "data-toggle" => "modal" 21 = link_to "click here", "#modal_merge_info", class: "how_to_merge_link vlink", title: "How To Merge", "data-toggle" => "modal"
22 for instructions. 22 for instructions.
23 23
24 -  
25 .js-toggle-container 24 .js-toggle-container
26 %p 25 %p
27 If you want to modify merge commit message - 26 If you want to modify merge commit message -
@@ -31,7 +30,8 @@ @@ -31,7 +30,8 @@
31 .form-group 30 .form-group
32 = label_tag :merge_commit_message, "Commit message", class: 'control-label' 31 = label_tag :merge_commit_message, "Commit message", class: 'control-label'
33 .col-sm-10 32 .col-sm-10
34 - = text_area_tag :merge_commit_message, @merge_request.merge_commit_message, class: "form-control js-gfm-input", rows: 14, required: true 33 + = render 'shared/commit_message_container', {textarea: text_area_tag(:merge_commit_message,
  34 + @merge_request.merge_commit_message, class: "form-control js-gfm-input", rows: 14, required: true)}
35 %p.hint 35 %p.hint
36 The recommended maximum line length is 52 characters for the first line and 72 characters for all following lines. 36 The recommended maximum line length is 52 characters for the first line and 72 characters for all following lines.
37 37
app/views/projects/new_tree/show.html.haml
@@ -24,7 +24,8 @@ @@ -24,7 +24,8 @@
24 = label_tag 'commit_message', class: "control-label" do 24 = label_tag 'commit_message', class: "control-label" do
25 Commit message 25 Commit message
26 .col-sm-10 26 .col-sm-10
27 - = text_area_tag 'commit_message', params[:commit_message], placeholder: "Added new file", required: true, rows: 3, class: 'form-control' 27 + = render 'shared/commit_message_container', {textarea: text_area_tag('commit_message',
  28 + params[:commit_message], placeholder: "Added new file", required: true, rows: 3, class: 'form-control')}
28 29
29 .file-holder 30 .file-holder
30 .file-title 31 .file-title
app/views/shared/_commit_message_container.html.haml 0 → 100644
@@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
  1 +.commit-message-container
  2 + .max-width-marker
  3 + -# When the `ch` CSS length unit becomes widely supported `http://www.quirksmode.org/css/units-values` remove this workaround.
  4 + = 'a' * 72
  5 + = textarea