Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-12-09 00:28:28 +0300
committerDouwe Maan <douwe@gitlab.com>2015-12-09 00:28:28 +0300
commit23b6a98de00b966728f6b5ed3747b0d2e078165f (patch)
tree0f61c95ff08c4f44b1ba2779d788766034e634c0 /app
parent6c94a44295eec5efff87102fecffc2ac03ee560d (diff)
Move Builds tab to the end
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/merge_request_tabs.js.coffee26
-rw-r--r--app/views/projects/merge_requests/_new_submit.html.haml16
-rw-r--r--app/views/projects/merge_requests/_show.html.haml12
3 files changed, 27 insertions, 27 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js.coffee b/app/assets/javascripts/merge_request_tabs.js.coffee
index 69a12fdd045..b0eeb1db536 100644
--- a/app/assets/javascripts/merge_request_tabs.js.coffee
+++ b/app/assets/javascripts/merge_request_tabs.js.coffee
@@ -68,10 +68,10 @@ class @MergeRequestTabs
if action == 'commits'
@loadCommits($target.attr('href'))
- else if action == 'builds'
- @loadBuilds($target.attr('href'))
else if action == 'diffs'
@loadDiff($target.attr('href'))
+ else if action == 'builds'
+ @loadBuilds($target.attr('href'))
@setCurrentAction(action)
@@ -110,7 +110,7 @@ class @MergeRequestTabs
action = 'notes' if action == 'show'
# Remove a trailing '/commits' or '/diffs'
- new_state = @_location.pathname.replace(/\/(commits|builds|diffs)(\.html)?\/?$/, '')
+ new_state = @_location.pathname.replace(/\/(commits|diffs|builds)(\.html)?\/?$/, '')
# Append the new action if we're on a tab other than 'notes'
unless action == 'notes'
@@ -138,6 +138,16 @@ class @MergeRequestTabs
@commitsLoaded = true
@scrollToElement("#commits")
+ loadDiff: (source) ->
+ return if @diffsLoaded
+
+ @_get
+ url: "#{source}.json" + @_location.search
+ success: (data) =>
+ document.getElementById('diffs').innerHTML = data.html
+ @diffsLoaded = true
+ @scrollToElement("#diffs")
+
loadBuilds: (source) ->
return if @buildsLoaded
@@ -149,16 +159,6 @@ class @MergeRequestTabs
@buildsLoaded = true
@scrollToElement("#builds")
- loadDiff: (source) ->
- return if @diffsLoaded
-
- @_get
- url: "#{source}.json" + @_location.search
- success: (data) =>
- document.getElementById('diffs').innerHTML = data.html
- @diffsLoaded = true
- @scrollToElement("#diffs")
-
# Show or hide the loading spinner
#
# status - Boolean, true to show, false to hide
diff --git a/app/views/projects/merge_requests/_new_submit.html.haml b/app/views/projects/merge_requests/_new_submit.html.haml
index 3f6e421fcd7..4172d5a4e88 100644
--- a/app/views/projects/merge_requests/_new_submit.html.haml
+++ b/app/views/projects/merge_requests/_new_submit.html.haml
@@ -23,22 +23,19 @@
= link_to url_for(params), data: {target: 'div#commits', action: 'commits', toggle: 'tab'} do
Commits
%span.badge= @commits.size
- - if @ci_commit
- %li.builds-tab.active
- = link_to url_for(params), data: {target: '#builds', action: 'builds', toggle: 'tab'} do
- Builds
- %span.badge= @statuses.size
%li.diffs-tab.active
= link_to url_for(params), data: {target: 'div#diffs', action: 'diffs', toggle: 'tab'} do
Changes
%span.badge= @diffs.size
+ - if @ci_commit
+ %li.builds-tab.active
+ = link_to url_for(params), data: {target: 'div#builds', action: 'builds', toggle: 'tab'} do
+ Builds
+ %span.badge= @statuses.size
.tab-content
#commits.commits.tab-pane
= render "projects/merge_requests/show/commits"
- - if @ci_commit
- #builds.builds.tab-pane
- = render "projects/merge_requests/show/builds"
#diffs.diffs.tab-pane.active
- if @diffs.present?
= render "projects/diffs/diffs", diffs: @diffs, project: @project
@@ -50,6 +47,9 @@
.alert.alert-danger
%h4 This comparison includes a huge diff.
%p To preserve performance the line changes are not shown.
+ - if @ci_commit
+ #builds.builds.tab-pane
+ = render "projects/merge_requests/show/builds"
:javascript
$('.assign-to-me-link').on('click', function(e){
diff --git a/app/views/projects/merge_requests/_show.html.haml b/app/views/projects/merge_requests/_show.html.haml
index 686a9a2c758..960d1561e73 100644
--- a/app/views/projects/merge_requests/_show.html.haml
+++ b/app/views/projects/merge_requests/_show.html.haml
@@ -50,25 +50,25 @@
= link_to commits_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: {target: 'div#commits', action: 'commits', toggle: 'tab'} do
Commits
%span.badge= @commits.size
+ %li.diffs-tab
+ = link_to diffs_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: {target: 'div#diffs', action: 'diffs', toggle: 'tab'} do
+ Changes
+ %span.badge= @merge_request.diffs.size
- if @ci_commit
%li.builds-tab
= link_to builds_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: {target: '#builds', action: 'builds', toggle: 'tab'} do
Builds
%span.badge= @statuses.size
- %li.diffs-tab
- = link_to diffs_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), data: {target: 'div#diffs', action: 'diffs', toggle: 'tab'} do
- Changes
- %span.badge= @merge_request.diffs.size
.tab-content
#notes.notes.tab-pane.voting_notes
= render "projects/merge_requests/discussion"
#commits.commits.tab-pane
- # This tab is always loaded via AJAX
- #builds.builds.tab-pane
- - # This tab is always loaded via AJAX
#diffs.diffs.tab-pane
- # This tab is always loaded via AJAX
+ #builds.builds.tab-pane
+ - # This tab is always loaded via AJAX
.mr-loading-status
= spinner