diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-05-27 22:39:11 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-05-27 22:39:11 -0400 |
commit | 5c52eaa9d266ec201cf6558eef9efa5c3d8f939e (patch) | |
tree | b2bc7118a7d9c77c4b12d004c59a82f0653d6284 /app/views/projects | |
parent | 13f2ab3e3dabae9fe5013fc6d32d246b534df991 (diff) | |
download | gitlab-ce-5c52eaa9d266ec201cf6558eef9efa5c3d8f939e.tar.gz |
Persist current merge request tab selection via URLrs-persist-tab-selection
Closes internal https://dev.gitlab.org/gitlab/gitlabhq/issues/2350
Diffstat (limited to 'app/views/projects')
-rw-r--r-- | app/views/projects/merge_requests/_new_submit.html.haml | 43 | ||||
-rw-r--r-- | app/views/projects/merge_requests/_show.html.haml | 35 |
2 files changed, 41 insertions, 37 deletions
diff --git a/app/views/projects/merge_requests/_new_submit.html.haml b/app/views/projects/merge_requests/_new_submit.html.haml index 24a9563dd4d..e83b7649928 100644 --- a/app/views/projects/merge_requests/_new_submit.html.haml +++ b/app/views/projects/merge_requests/_new_submit.html.haml @@ -19,30 +19,31 @@ .mr-compare.merge-request %ul.nav.nav-tabs.merge-request-tabs - %li.commits-tab{data: {action: 'commits', toggle: 'tab'}} - = link_to url_for(params) do - %i.fa.fa-history + %li.commits-tab + = link_to '#commits', data: {action: 'commits', toggle: 'tab'} do + = icon('history') Commits %span.badge= @commits.size - %li.diffs-tab{data: {action: 'diffs', toggle: 'tab'}} - = link_to url_for(params) do - %i.fa.fa-list-alt + %li.diffs-tab + = link_to '#diffs', data: {action: 'diffs', toggle: 'tab'} do + = icon('list-alt') Changes %span.badge= @diffs.size - .commits.tab-content - = render "projects/commits/commits", project: @project - .diffs.tab-content - - if @diffs.present? - = render "projects/diffs/diffs", diffs: @diffs, project: @project - - elsif @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE - .alert.alert-danger - %h4 This comparison includes more than #{MergeRequestDiff::COMMITS_SAFE_SIZE} commits. - %p To preserve performance the line changes are not shown. - - else - .alert.alert-danger - %h4 This comparison includes a huge diff. - %p To preserve performance the line changes are not shown. + .tab-content + #commits.commits.tab-pane + = render "projects/commits/commits", project: @project + #diffs.diffs.tab-pane + - if @diffs.present? + = render "projects/diffs/diffs", diffs: @diffs, project: @project + - elsif @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE + .alert.alert-danger + %h4 This comparison includes more than #{MergeRequestDiff::COMMITS_SAFE_SIZE} commits. + %p To preserve performance the line changes are not shown. + - else + .alert.alert-danger + %h4 This comparison includes a huge diff. + %p To preserve performance the line changes are not shown. :javascript $('.assign-to-me-link').on('click', function(e){ @@ -55,6 +56,8 @@ :javascript var merge_request merge_request = new MergeRequest({ - action: 'commits' + action: 'diffs', + diffs_loaded: true, + commits_loaded: true }); diff --git a/app/views/projects/merge_requests/_show.html.haml b/app/views/projects/merge_requests/_show.html.haml index c2f5cdacae7..0d894e360ea 100644 --- a/app/views/projects/merge_requests/_show.html.haml +++ b/app/views/projects/merge_requests/_show.html.haml @@ -25,7 +25,7 @@ %span.pull-right .btn-group %a.btn.dropdown-toggle{ data: {toggle: :dropdown} } - %i.fa.fa-download + = icon('download') Download as %span.caret %ul.dropdown-menu @@ -37,29 +37,30 @@ - if @commits.present? %ul.nav.nav-tabs.merge-request-tabs - %li.notes-tab{data: {action: 'notes', toggle: 'tab'}} - = link_to merge_request_path(@merge_request) do - %i.fa.fa-comments + %li.notes-tab + = link_to '#notes', data: {action: 'notes', toggle: 'tab'} do + = icon('comments') Discussion %span.badge= @merge_request.mr_and_commit_notes.user.count - %li.commits-tab{data: {action: 'commits', toggle: 'tab'}} - = link_to merge_request_path(@merge_request), title: 'Commits' do - %i.fa.fa-history + %li.commits-tab + = link_to '#commits', data: {action: 'commits', toggle: 'tab'} do + = icon('history') Commits %span.badge= @commits.size - %li.diffs-tab{data: {action: 'diffs', toggle: 'tab'}} - = link_to diffs_namespace_project_merge_request_path(@project.namespace, @project, @merge_request) do - %i.fa.fa-list-alt + %li.diffs-tab + = link_to '#diffs', data: {source: diffs_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), action: 'diffs', toggle: 'tab'} do + = icon('list-alt') Changes %span.badge= @merge_request.diffs.size - .notes.tab-content.voting_notes#notes{ class: (controller.action_name == 'show') ? "" : "hide" } - = render "projects/merge_requests/discussion" - .commits.tab-content - = render "projects/merge_requests/show/commits" - .diffs.tab-content - - if current_page?(action: 'diffs') - = render "projects/merge_requests/show/diffs" + .tab-content + #notes.notes.tab-pane.voting_notes + = render "projects/merge_requests/discussion" + #commits.commits.tab-pane + = render "projects/merge_requests/show/commits" + #diffs.diffs.tab-pane + - if current_page?(action: 'diffs') + = render "projects/merge_requests/show/diffs" .mr-loading-status = spinner |