Commit eaec2350c43c58c2081156219c4f388182a50c59
1 parent
5fa805a7
Exists in
spb-stable
and in
3 other branches
Style MR form page for twbs3
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
3 changed files
with
27 additions
and
22 deletions
Show diff stats
app/assets/stylesheets/sections/merge_requests.scss
| ... | ... | @@ -91,12 +91,8 @@ |
| 91 | 91 | .merge-request-angle { |
| 92 | 92 | text-align: center; |
| 93 | 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 | 98 | .merge-request-form-info { |
| ... | ... | @@ -109,7 +105,6 @@ |
| 109 | 105 | } |
| 110 | 106 | |
| 111 | 107 | .chosen-container .chosen-single { |
| 112 | - padding: 2px 0 2px 10px; | |
| 113 | 108 | span { |
| 114 | 109 | font-weight: bold; |
| 115 | 110 | color: #555; | ... | ... |
app/views/projects/issues/_form.html.haml
| ... | ... | @@ -19,7 +19,7 @@ |
| 19 | 19 | %p.hint Issues are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. |
| 20 | 20 | %hr |
| 21 | 21 | .form-group |
| 22 | - .issue_assignee | |
| 22 | + .issue-assignee | |
| 23 | 23 | = f.label :assignee_id, class: 'control-label' do |
| 24 | 24 | %i.icon-user |
| 25 | 25 | Assign to |
| ... | ... | @@ -28,7 +28,7 @@ |
| 28 | 28 | |
| 29 | 29 | = link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link' |
| 30 | 30 | .form-group |
| 31 | - .issue_milestone | |
| 31 | + .issue-milestone | |
| 32 | 32 | = f.label :milestone_id, class: 'control-label' do |
| 33 | 33 | %i.icon-time |
| 34 | 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 | 2 | -if @merge_request.errors.any? |
| 3 | 3 | .alert.alert-danger |
| 4 | 4 | %ul |
| ... | ... | @@ -16,7 +16,7 @@ |
| 16 | 16 | = f.select(:source_branch, @merge_request.source_project.repository.branch_names, { include_blank: "Select branch" }, {class: 'source_branch chosen span2'}) |
| 17 | 17 | .mr_source_commit.prepend-top-10 |
| 18 | 18 | .col-md-2 |
| 19 | - %h2.merge-request-angle.light | |
| 19 | + .merge-request-angle | |
| 20 | 20 | %i.icon-long-arrow-right |
| 21 | 21 | .col-md-5 |
| 22 | 22 | .clearfix |
| ... | ... | @@ -31,25 +31,31 @@ |
| 31 | 31 | %hr |
| 32 | 32 | .merge-request-form-info |
| 33 | 33 | .form-group |
| 34 | - = f.label :title do | |
| 34 | + = f.label :title, class: 'control-label' do | |
| 35 | 35 | %strong= "Title *" |
| 36 | 36 | .col-sm-10= f.text_field :title, class: "form-control pad js-gfm-input", maxlength: 255, rows: 5, required: true |
| 37 | 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 | 47 | %i.icon-user |
| 41 | 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 | + | |
| 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 | 56 | %i.icon-time |
| 46 | 57 | Milestone |
| 47 | 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 | 61 | .form-actions |
| ... | ... | @@ -83,3 +89,7 @@ |
| 83 | 89 | target_branch.on("change", function() { |
| 84 | 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 | + }); | ... | ... |