diff --git a/app/assets/stylesheets/sections/merge_requests.scss b/app/assets/stylesheets/sections/merge_requests.scss index ec844cc00b090c662013f00ae07f7040b9a7a47d..a0f709070ac14b1471e11b3e591b19d38d9c5dba 100644 --- a/app/assets/stylesheets/sections/merge_requests.scss +++ b/app/assets/stylesheets/sections/merge_requests.scss @@ -20,16 +20,12 @@ } .merge-request .merge-request-tabs{ - border-bottom: 2px solid $border_primary; margin: 20px 0; li { a { padding: 15px 40px; font-size: 14px; - margin-bottom: -2px; - border-bottom: 2px solid $border_primary; - @include border-radius(0px); } } } diff --git a/app/assets/stylesheets/sections/notes.scss b/app/assets/stylesheets/sections/notes.scss index e1f9c0cb2589b3fc666735f440e5d5f9607a047a..74c500f88b3da8e7a21a4cda66e42807a462e267 100644 --- a/app/assets/stylesheets/sections/notes.scss +++ b/app/assets/stylesheets/sections/notes.scss @@ -155,19 +155,26 @@ ul.notes { } .add-diff-note { - background: image-url("diff_note_add.png") no-repeat left 0; - border: none; - height: 22px; - margin-left: -65px; + margin-top: -4px; + @include border-radius(40px); + background: #FFF; + padding: 4px; + font-size: 16px; + color: $link_color; + margin-left: -60px; position: absolute; - width: 22px; z-index: 10; + transition: all 0.2s ease; + // "hide" it by default opacity: 0.0; filter: alpha(opacity=0); &:hover { + font-size: 24px; + background: $bg_primary; + color: #FFF; @include show-add-diff-note; } } diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb index 901052edec6932d54e5f338718e74ba6a428aa4d..6d2244b87143c93b742f8819188718b6a3e48cc2 100644 --- a/app/helpers/notes_helper.rb +++ b/app/helpers/notes_helper.rb @@ -52,8 +52,11 @@ module NotesHelper discussion_id: discussion_id } - button_tag '', class: 'btn add-diff-note js-add-diff-note-button', - data: data, title: 'Add a comment to this line' + button_tag(class: 'btn add-diff-note js-add-diff-note-button', + data: data, + title: 'Add a comment to this line') do + content_tag :i, nil, class: 'fa fa-comment-o' + end end def link_to_reply_diff(note) diff --git a/app/views/projects/merge_requests/_show.html.haml b/app/views/projects/merge_requests/_show.html.haml index a05c78bc3e9dfb222e811fcd883935affec1b477..57ab6bdd5458e210b42d1800ac78c41fbcbc48a3 100644 --- a/app/views/projects/merge_requests/_show.html.haml +++ b/app/views/projects/merge_requests/_show.html.haml @@ -26,33 +26,6 @@ = render "projects/merge_requests/show/commits" = render "projects/merge_requests/show/participants" - - if @commits.present? - %ul.nav.nav-pills.merge-request-tabs - %li.notes-tab{data: {action: 'notes'}} - = link_to project_merge_request_path(@project, @merge_request) do - %i.fa.fa-comment - Discussion - %span.badge= @merge_request.mr_and_commit_notes.count - %li.diffs-tab{data: {action: 'diffs'}} - = link_to diffs_project_merge_request_path(@project, @merge_request) do - %i.fa.fa-list-alt - Changes - %span.badge= @merge_request.diffs.size - - - content_for :note_actions do - - if can?(current_user, :modify_merge_request, @merge_request) - - if @merge_request.open? - = link_to 'Close', project_merge_request_path(@project, @merge_request, merge_request: {state_event: :close }), method: :put, class: "btn btn-grouped btn-close close-mr-link js-note-target-close", title: "Close merge request" - - if @merge_request.closed? - = link_to 'Reopen', project_merge_request_path(@project, @merge_request, merge_request: {state_event: :reopen }), method: :put, class: "btn btn-grouped btn-reopen reopen-mr-link js-note-target-reopen", title: "Reopen merge request" - - .diffs.tab-content - - if current_page?(action: 'diffs') - = render "projects/merge_requests/show/diffs" - .notes.tab-content.voting_notes#notes{ class: (controller.action_name == 'show') ? "" : "hide" } - = render "projects/notes/notes_with_form" - .mr-loading-status - = spinner .col-sm-3 .issue-btn-group - if can?(current_user, :modify_merge_request, @merge_request) @@ -84,6 +57,35 @@ %cite.cgray = render partial: 'projects/merge_requests/show/context', locals: { merge_request: @merge_request } + - if @commits.present? + %ul.nav.nav-tabs.merge-request-tabs + %li.notes-tab{data: {action: 'notes'}} + = link_to project_merge_request_path(@project, @merge_request) do + %i.fa.fa-comment + Discussion + %span.badge= @merge_request.mr_and_commit_notes.count + %li.diffs-tab{data: {action: 'diffs'}} + = link_to diffs_project_merge_request_path(@project, @merge_request) do + %i.fa.fa-list-alt + Changes + %span.badge= @merge_request.diffs.size + + - content_for :note_actions do + - if can?(current_user, :modify_merge_request, @merge_request) + - if @merge_request.open? + = link_to 'Close', project_merge_request_path(@project, @merge_request, merge_request: {state_event: :close }), method: :put, class: "btn btn-grouped btn-close close-mr-link js-note-target-close", title: "Close merge request" + - if @merge_request.closed? + = link_to 'Reopen', project_merge_request_path(@project, @merge_request, merge_request: {state_event: :reopen }), method: :put, class: "btn btn-grouped btn-reopen reopen-mr-link js-note-target-reopen", title: "Reopen merge request" + + .diffs.tab-content + - if current_page?(action: 'diffs') + = render "projects/merge_requests/show/diffs" + .notes.tab-content.voting_notes#notes{ class: (controller.action_name == 'show') ? "" : "hide" } + .row + .col-sm-9 + = render "projects/notes/notes_with_form" + .mr-loading-status + = spinner :javascript