Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
23b6a98d
Commit
23b6a98d
authored
Dec 08, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Builds tab to the end
parent
6c94a442
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
30 deletions
+30
-30
app/assets/javascripts/merge_request_tabs.js.coffee
app/assets/javascripts/merge_request_tabs.js.coffee
+13
-13
app/views/projects/merge_requests/_new_submit.html.haml
app/views/projects/merge_requests/_new_submit.html.haml
+8
-8
app/views/projects/merge_requests/_show.html.haml
app/views/projects/merge_requests/_show.html.haml
+6
-6
config/routes.rb
config/routes.rb
+1
-1
lib/gitlab/markdown/merge_request_reference_filter.rb
lib/gitlab/markdown/merge_request_reference_filter.rb
+2
-2
No files found.
app/assets/javascripts/merge_request_tabs.js.coffee
View file @
23b6a98d
...
@@ -68,10 +68,10 @@ class @MergeRequestTabs
...
@@ -68,10 +68,10 @@ class @MergeRequestTabs
if
action
==
'commits'
if
action
==
'commits'
@
loadCommits
(
$target
.
attr
(
'href'
))
@
loadCommits
(
$target
.
attr
(
'href'
))
else
if
action
==
'builds'
@
loadBuilds
(
$target
.
attr
(
'href'
))
else
if
action
==
'diffs'
else
if
action
==
'diffs'
@
loadDiff
(
$target
.
attr
(
'href'
))
@
loadDiff
(
$target
.
attr
(
'href'
))
else
if
action
==
'builds'
@
loadBuilds
(
$target
.
attr
(
'href'
))
@
setCurrentAction
(
action
)
@
setCurrentAction
(
action
)
...
@@ -110,7 +110,7 @@ class @MergeRequestTabs
...
@@ -110,7 +110,7 @@ class @MergeRequestTabs
action
=
'notes'
if
action
==
'show'
action
=
'notes'
if
action
==
'show'
# Remove a trailing '/commits' or '/diffs'
# Remove a trailing '/commits' or '/diffs'
new_state
=
@
_location
.
pathname
.
replace
(
/\/(commits|
builds|diff
s)(\.html)?\/?$/
,
''
)
new_state
=
@
_location
.
pathname
.
replace
(
/\/(commits|
diffs|build
s)(\.html)?\/?$/
,
''
)
# Append the new action if we're on a tab other than 'notes'
# Append the new action if we're on a tab other than 'notes'
unless
action
==
'notes'
unless
action
==
'notes'
...
@@ -138,6 +138,16 @@ class @MergeRequestTabs
...
@@ -138,6 +138,16 @@ class @MergeRequestTabs
@
commitsLoaded
=
true
@
commitsLoaded
=
true
@
scrollToElement
(
"#commits"
)
@
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
)
->
loadBuilds
:
(
source
)
->
return
if
@
buildsLoaded
return
if
@
buildsLoaded
...
@@ -149,16 +159,6 @@ class @MergeRequestTabs
...
@@ -149,16 +159,6 @@ class @MergeRequestTabs
@
buildsLoaded
=
true
@
buildsLoaded
=
true
@
scrollToElement
(
"#builds"
)
@
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
# Show or hide the loading spinner
#
#
# status - Boolean, true to show, false to hide
# status - Boolean, true to show, false to hide
...
...
app/views/projects/merge_requests/_new_submit.html.haml
View file @
23b6a98d
...
@@ -23,22 +23,19 @@
...
@@ -23,22 +23,19 @@
=
link_to
url_for
(
params
),
data:
{
target:
'div#commits'
,
action:
'commits'
,
toggle:
'tab'
}
do
=
link_to
url_for
(
params
),
data:
{
target:
'div#commits'
,
action:
'commits'
,
toggle:
'tab'
}
do
Commits
Commits
%span
.badge
=
@commits
.
size
%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
%li
.diffs-tab.active
=
link_to
url_for
(
params
),
data:
{
target:
'div#diffs'
,
action:
'diffs'
,
toggle:
'tab'
}
do
=
link_to
url_for
(
params
),
data:
{
target:
'div#diffs'
,
action:
'diffs'
,
toggle:
'tab'
}
do
Changes
Changes
%span
.badge
=
@diffs
.
size
%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
.tab-content
#commits
.commits.tab-pane
#commits
.commits.tab-pane
=
render
"projects/merge_requests/show/commits"
=
render
"projects/merge_requests/show/commits"
-
if
@ci_commit
#builds
.builds.tab-pane
=
render
"projects/merge_requests/show/builds"
#diffs
.diffs.tab-pane.active
#diffs
.diffs.tab-pane.active
-
if
@diffs
.
present?
-
if
@diffs
.
present?
=
render
"projects/diffs/diffs"
,
diffs:
@diffs
,
project:
@project
=
render
"projects/diffs/diffs"
,
diffs:
@diffs
,
project:
@project
...
@@ -50,6 +47,9 @@
...
@@ -50,6 +47,9 @@
.alert.alert-danger
.alert.alert-danger
%h4
This comparison includes a huge diff.
%h4
This comparison includes a huge diff.
%p
To preserve performance the line changes are not shown.
%p
To preserve performance the line changes are not shown.
-
if
@ci_commit
#builds
.builds.tab-pane
=
render
"projects/merge_requests/show/builds"
:javascript
:javascript
$
(
'
.assign-to-me-link
'
).
on
(
'
click
'
,
function
(
e
){
$
(
'
.assign-to-me-link
'
).
on
(
'
click
'
,
function
(
e
){
...
...
app/views/projects/merge_requests/_show.html.haml
View file @
23b6a98d
...
@@ -50,25 +50,25 @@
...
@@ -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
=
link_to
commits_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'div#commits'
,
action:
'commits'
,
toggle:
'tab'
}
do
Commits
Commits
%span
.badge
=
@commits
.
size
%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
-
if
@ci_commit
%li
.builds-tab
%li
.builds-tab
=
link_to
builds_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'#builds'
,
action:
'builds'
,
toggle:
'tab'
}
do
=
link_to
builds_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
data:
{
target:
'#builds'
,
action:
'builds'
,
toggle:
'tab'
}
do
Builds
Builds
%span
.badge
=
@statuses
.
size
%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
.tab-content
#notes
.notes.tab-pane.voting_notes
#notes
.notes.tab-pane.voting_notes
=
render
"projects/merge_requests/discussion"
=
render
"projects/merge_requests/discussion"
#commits
.commits.tab-pane
#commits
.commits.tab-pane
-
# This tab is always loaded via AJAX
-
# This tab is always loaded via AJAX
#builds
.builds.tab-pane
-
# This tab is always loaded via AJAX
#diffs
.diffs.tab-pane
#diffs
.diffs.tab-pane
-
# This tab is always loaded via AJAX
-
# This tab is always loaded via AJAX
#builds
.builds.tab-pane
-
# This tab is always loaded via AJAX
.mr-loading-status
.mr-loading-status
=
spinner
=
spinner
...
...
config/routes.rb
View file @
23b6a98d
...
@@ -570,9 +570,9 @@ Rails.application.routes.draw do
...
@@ -570,9 +570,9 @@ Rails.application.routes.draw do
resources
:merge_requests
,
constraints:
{
id:
/\d+/
},
except:
[
:destroy
]
do
resources
:merge_requests
,
constraints:
{
id:
/\d+/
},
except:
[
:destroy
]
do
member
do
member
do
get
:commits
get
:diffs
get
:diffs
get
:builds
get
:builds
get
:commits
post
:merge
post
:merge
get
:merge_check
get
:merge_check
get
:ci_status
get
:ci_status
...
...
lib/gitlab/markdown/merge_request_reference_filter.rb
View file @
23b6a98d
...
@@ -28,10 +28,10 @@ module Gitlab
...
@@ -28,10 +28,10 @@ module Gitlab
case
path
case
path
when
'/diffs'
when
'/diffs'
extras
.
unshift
"diffs"
extras
.
unshift
"diffs"
when
'/builds'
extras
.
unshift
"builds"
when
'/commits'
when
'/commits'
extras
.
unshift
"commits"
extras
.
unshift
"commits"
when
'/builds'
extras
.
unshift
"builds"
end
end
extras
extras
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment