Commit eaec2350c43c58c2081156219c4f388182a50c59

Authored by Dmitriy Zaporozhets
1 parent 5fa805a7

Style MR form page for twbs3

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
app/assets/stylesheets/sections/merge_requests.scss
@@ -91,12 +91,8 @@ @@ -91,12 +91,8 @@
91 .merge-request-angle { 91 .merge-request-angle {
92 text-align: center; 92 text-align: center;
93 margin: 0 auto; 93 margin: 0 auto;
94 - background: #eee;  
95 - border-radius: 100px;  
96 - width: 60px;  
97 - line-height: 60px;  
98 - color: #777;  
99 - text-shadow: 0 1px 2px #FFF; 94 + font-size: 2em;
  95 + line-height: 1.1;
100 } 96 }
101 97
102 .merge-request-form-info { 98 .merge-request-form-info {
@@ -109,7 +105,6 @@ @@ -109,7 +105,6 @@
109 } 105 }
110 106
111 .chosen-container .chosen-single { 107 .chosen-container .chosen-single {
112 - padding: 2px 0 2px 10px;  
113 span { 108 span {
114 font-weight: bold; 109 font-weight: bold;
115 color: #555; 110 color: #555;
app/views/projects/issues/_form.html.haml
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
19 %p.hint Issues are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. 19 %p.hint Issues are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}.
20 %hr 20 %hr
21 .form-group 21 .form-group
22 - .issue_assignee 22 + .issue-assignee
23 = f.label :assignee_id, class: 'control-label' do 23 = f.label :assignee_id, class: 'control-label' do
24 %i.icon-user 24 %i.icon-user
25 Assign to 25 Assign to
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
28 &nbsp; 28 &nbsp;
29 = link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link' 29 = link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link'
30 .form-group 30 .form-group
31 - .issue_milestone 31 + .issue-milestone
32 = f.label :milestone_id, class: 'control-label' do 32 = f.label :milestone_id, class: 'control-label' do
33 %i.icon-time 33 %i.icon-time
34 Milestone 34 Milestone
app/views/projects/merge_requests/_form.html.haml
1 -= form_for [@project, @merge_request], html: { class: "#{controller.action_name}-merge-request form-horizontal" } do |f| 1 += form_for [@project, @merge_request], html: { class: "merge-request-form form-horizontal" } do |f|
2 -if @merge_request.errors.any? 2 -if @merge_request.errors.any?
3 .alert.alert-danger 3 .alert.alert-danger
4 %ul 4 %ul
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 = f.select(:source_branch, @merge_request.source_project.repository.branch_names, { include_blank: "Select branch" }, {class: 'source_branch chosen span2'}) 16 = f.select(:source_branch, @merge_request.source_project.repository.branch_names, { include_blank: "Select branch" }, {class: 'source_branch chosen span2'})
17 .mr_source_commit.prepend-top-10 17 .mr_source_commit.prepend-top-10
18 .col-md-2 18 .col-md-2
19 - %h2.merge-request-angle.light 19 + .merge-request-angle
20 %i.icon-long-arrow-right 20 %i.icon-long-arrow-right
21 .col-md-5 21 .col-md-5
22 .clearfix 22 .clearfix
@@ -31,25 +31,31 @@ @@ -31,25 +31,31 @@
31 %hr 31 %hr
32 .merge-request-form-info 32 .merge-request-form-info
33 .form-group 33 .form-group
34 - = f.label :title do 34 + = f.label :title, class: 'control-label' do
35 %strong= "Title *" 35 %strong= "Title *"
36 .col-sm-10= f.text_field :title, class: "form-control pad js-gfm-input", maxlength: 255, rows: 5, required: true 36 .col-sm-10= f.text_field :title, class: "form-control pad js-gfm-input", maxlength: 255, rows: 5, required: true
37 .form-group 37 .form-group
38 - .left  
39 - = f.label :assignee_id do 38 + = f.label :description, "Description", class: 'control-label'
  39 + .col-sm-10
  40 + = f.text_area :description, class: "form-control js-gfm-input", rows: 14
  41 + %p.hint Description is parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}.
  42 +
  43 + %hr
  44 + .form-group
  45 + .merge-request-assignee
  46 + = f.label :assignee_id, class: 'control-label' do
40 %i.icon-user 47 %i.icon-user
41 Assign to 48 Assign to
42 - .col-sm-10= f.select(:assignee_id, assignee_options(@merge_request), { include_blank: "Select user" }, {class: 'chosen span3'})  
43 - .left  
44 - = f.label :milestone_id do 49 + .col-sm-10
  50 + = f.select(:assignee_id, assignee_options(@merge_request), { include_blank: "Select a user" }, {class: 'chosen'})
  51 + &nbsp;
  52 + = link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link'
  53 + .form-group
  54 + .merge-request-milestone
  55 + = f.label :milestone_id, class: 'control-label' do
45 %i.icon-time 56 %i.icon-time
46 Milestone 57 Milestone
47 .col-sm-10= f.select(:milestone_id, milestone_options(@merge_request), { include_blank: "Select milestone" }, {class: 'chosen'}) 58 .col-sm-10= f.select(:milestone_id, milestone_options(@merge_request), { include_blank: "Select milestone" }, {class: 'chosen'})
48 - .form-group  
49 - = f.label :description, "Description"  
50 - .col-sm-10  
51 - = f.text_area :description, class: "form-control js-gfm-input", rows: 14  
52 - %p.hint Description is parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}.  
53 59
54 60
55 .form-actions 61 .form-actions
@@ -83,3 +89,7 @@ @@ -83,3 +89,7 @@
83 target_branch.on("change", function() { 89 target_branch.on("change", function() {
84 $.get("#{branch_to_project_merge_requests_path(@source_project)}", {target_project_id: target_project.val(),ref: $(this).val() }); 90 $.get("#{branch_to_project_merge_requests_path(@source_project)}", {target_project_id: target_project.val(),ref: $(this).val() });
85 }); 91 });
  92 + $('.assign-to-me-link').on('click', function(e){
  93 + $('#merge_request_assignee_id').val("#{current_user.id}").trigger("chosen:updated");
  94 + e.preventDefault();
  95 + });