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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
4e002a71
Commit
4e002a71
authored
Apr 06, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'improve-mr-widget' into 'master'
Restyle merge request accept and ci widget Fixes #1138
parents
bc40efa1
8e7f80ee
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
133 additions
and
103 deletions
+133
-103
app/assets/javascripts/merge_request.js.coffee
app/assets/javascripts/merge_request.js.coffee
+15
-1
app/assets/stylesheets/gl_bootstrap.scss
app/assets/stylesheets/gl_bootstrap.scss
+1
-0
app/assets/stylesheets/sections/merge_requests.scss
app/assets/stylesheets/sections/merge_requests.scss
+20
-3
app/views/projects/merge_requests/_show.html.haml
app/views/projects/merge_requests/_show.html.haml
+1
-8
app/views/projects/merge_requests/show/_commits.html.haml
app/views/projects/merge_requests/show/_commits.html.haml
+0
-7
app/views/projects/merge_requests/show/_mr_accept.html.haml
app/views/projects/merge_requests/show/_mr_accept.html.haml
+17
-19
app/views/projects/merge_requests/show/_mr_box.html.haml
app/views/projects/merge_requests/show/_mr_box.html.haml
+0
-20
app/views/projects/merge_requests/show/_mr_ci.html.haml
app/views/projects/merge_requests/show/_mr_ci.html.haml
+17
-23
app/views/projects/merge_requests/show/_no_accept.html.haml
app/views/projects/merge_requests/show/_no_accept.html.haml
+13
-11
app/views/projects/merge_requests/show/_remove_source_branch.html.haml
...jects/merge_requests/show/_remove_source_branch.html.haml
+9
-11
app/views/projects/merge_requests/show/_state_widget.html.haml
...iews/projects/merge_requests/show/_state_widget.html.haml
+40
-0
No files found.
app/assets/javascripts/merge_request.js.coffee
View file @
4e002a71
...
@@ -88,7 +88,21 @@ class MergeRequest
...
@@ -88,7 +88,21 @@ class MergeRequest
showCiState
:
(
state
)
->
showCiState
:
(
state
)
->
$
(
'.ci_widget'
).
hide
()
$
(
'.ci_widget'
).
hide
()
$
(
'.ci_widget.ci-'
+
state
).
show
()
allowed_states
=
[
"failed"
,
"running"
,
"pending"
,
"success"
]
if
state
in
allowed_states
$
(
'.ci_widget.ci-'
+
state
).
show
()
else
$
(
'.ci_widget.ci-error'
).
show
()
switch
state
when
"success"
$
(
'.mr-state-widget'
).
addClass
(
"panel-success"
)
when
"failed"
$
(
'.mr-state-widget'
).
addClass
(
"panel-danger"
)
when
"running"
,
"pending"
$
(
'.mr-state-widget'
).
addClass
(
"panel-warning"
)
loadDiff
:
(
event
)
->
loadDiff
:
(
event
)
->
$
.
ajax
$
.
ajax
...
...
app/assets/stylesheets/gl_bootstrap.scss
View file @
4e002a71
...
@@ -45,6 +45,7 @@ $pagination-active-bg: $bg_style_color;
...
@@ -45,6 +45,7 @@ $pagination-active-bg: $bg_style_color;
@import
"bootstrap/list-group"
;
@import
"bootstrap/list-group"
;
@import
"bootstrap/wells"
;
@import
"bootstrap/wells"
;
@import
"bootstrap/close"
;
@import
"bootstrap/close"
;
@import
"bootstrap/panels"
;
// Components w/ JavaScript
// Components w/ JavaScript
@import
"bootstrap/modals"
;
@import
"bootstrap/modals"
;
...
...
app/assets/stylesheets/sections/merge_requests.scss
View file @
4e002a71
...
@@ -44,10 +44,9 @@
...
@@ -44,10 +44,9 @@
.label-branch
{
.label-branch
{
@include
border-radius
(
4px
);
@include
border-radius
(
4px
);
padding
:
3
px
4px
;
padding
:
2
px
4px
;
border
:
none
;
border
:
none
;
font-size
:
14px
;
background
:
#555
;
background
:
#474D57
;
color
:
#fff
;
color
:
#fff
;
font-family
:
$monospace_font
;
font-family
:
$monospace_font
;
font-weight
:
normal
;
font-weight
:
normal
;
...
@@ -95,3 +94,21 @@
...
@@ -95,3 +94,21 @@
.diff-file
.reopen-mr-link
{
.diff-file
.reopen-mr-link
{
display
:
none
;
display
:
none
;
}
}
.mr-state-widget
{
@include
border-radius
(
0px
);
.panel-heading
{
@include
border-radius
(
0px
);
}
.panel-body
{
h4
{
margin-top
:
0px
;
}
p
:last-child
{
margin-bottom
:
0
;
}
}
}
app/views/projects/merge_requests/_show.html.haml
View file @
4e002a71
...
@@ -2,14 +2,7 @@
...
@@ -2,14 +2,7 @@
=
render
"projects/merge_requests/show/mr_title"
=
render
"projects/merge_requests/show/mr_title"
=
render
"projects/merge_requests/show/how_to_merge"
=
render
"projects/merge_requests/show/how_to_merge"
=
render
"projects/merge_requests/show/mr_box"
=
render
"projects/merge_requests/show/mr_box"
-
if
@merge_request
.
open?
=
render
"projects/merge_requests/show/state_widget"
-
if
@merge_request
.
source_branch_exists?
&&
@merge_request
.
target_branch_exists?
=
render
"projects/merge_requests/show/mr_accept"
-
else
=
render
"projects/merge_requests/show/no_accept"
=
render
"projects/merge_requests/show/remove_source_branch"
-
if
@merge_request
.
source_project
.
gitlab_ci?
=
render
"projects/merge_requests/show/mr_ci"
=
render
"projects/merge_requests/show/commits"
=
render
"projects/merge_requests/show/commits"
-
if
@commits
.
present?
-
if
@commits
.
present?
...
...
app/views/projects/merge_requests/show/_commits.html.haml
View file @
4e002a71
...
@@ -28,10 +28,3 @@
...
@@ -28,10 +28,3 @@
-
@commits
.
each
do
|
commit
|
-
@commits
.
each
do
|
commit
|
=
render
"projects/commits/commit"
,
commit:
commit
,
project:
@merge_request
.
source_project
=
render
"projects/commits/commit"
,
commit:
commit
,
project:
@merge_request
.
source_project
-
else
.nothing-here-block
Nothing to merge from
%span
.label-branch
#{
@merge_request
.
source_branch
}
to
%span
.label-branch
#{
@merge_request
.
target_branch
}
%br
app/views/projects/merge_requests/show/_mr_accept.html.haml
View file @
4e002a71
-
unless
@allowed_to_merge
-
unless
@allowed_to_merge
-
if
@project
.
archived?
-
if
@project
.
archived?
.bs-callout.bs-callout-warning
%p
%strong
Archived projects cannot be committed to!
%strong
Archived projects cannot be committed to!
-
else
-
else
.bs-callout
.automerge_widget.cannot_be_merged.hide
.automerge_widget.cannot_be_merged.hide
%strong
This can't be merged automatically, even if it could be merged you don't have the permission to do so.
%strong
This can't be merged automatically, even if it could be merged you don't have the permission to do so.
.automerge_widget.can_be_merged.hide
.automerge_widget.can_be_merged.hide
%strong
This can be merged automatically but you don't have the permission to do so.
%strong
This can be merged automatically but you don't have the permission to do so.
-
if
@show_merge_controls
-
if
@show_merge_controls
.automerge_widget.can_be_merged.hide
.automerge_widget.can_be_merged.hide
.
bs-callout.bs-callout-success.
clearfix
.clearfix
=
form_for
[
:automerge
,
@project
,
@merge_request
],
remote:
true
,
method: :get
do
|
f
|
=
form_for
[
:automerge
,
@project
,
@merge_request
],
remote:
true
,
method: :get
do
|
f
|
%h4
%h4
You can accept this request automatically.
You can accept this request automatically.
%
p
%
div
If you still want to do it manually -
If you still want to do it manually -
%strong
%strong
=
link_to
"click here"
,
"#modal_merge_info"
,
class:
"how_to_merge_link vlink"
,
title:
"How To Merge"
,
"data-toggle"
=>
"modal"
=
link_to
"click here"
,
"#modal_merge_info"
,
class:
"how_to_merge_link vlink"
,
title:
"How To Merge"
,
"data-toggle"
=>
"modal"
...
@@ -47,31 +46,30 @@
...
@@ -47,31 +46,30 @@
.automerge_widget.no_satellite.hide
.automerge_widget.no_satellite.hide
.bs-callout.bs-callout-danger
%p
%span
%span
%strong
This repository does not have satellite. Ask an administrator to fix this issue
%strong
This repository does not have satellite. Ask an administrator to fix this issue
.automerge_widget.cannot_be_merged.hide
.automerge_widget.cannot_be_merged.hide
.bs-callout.bs-callout-disabled
%h4
%h4
This request can't be merged with GitLab.
This request can't be merged with GitLab.
%p
%span
You should do it manually with
You should do it manually with
%strong
%strong
=
link_to
"command line"
,
"#modal_merge_info"
,
class:
"how_to_merge_link"
,
title:
"How To Merge"
,
"data-toggle"
=>
"modal"
=
link_to
"command line"
,
"#modal_merge_info"
,
class:
"how_to_merge_link"
,
title:
"How To Merge"
,
"data-toggle"
=>
"modal"
.automerge_widget.unchecked
.automerge_widget.unchecked
.bs-callout.bs-callout-warning
%p
%strong
%strong
%i
.icon-spinner.icon-spin
%i
.icon-spinner.icon-spin
Checking for ability to automatically merge…
Checking for ability to automatically merge…
.automerge_widget.already_cannot_be_merged.hide
.automerge_widget.already_cannot_be_merged.hide
.bs-callout.bs-callout-info
%p
%strong
This merge request can not be merged. Try to reload the page.
%strong
This merge request can not be merged. Try to reload the page.
.merge-in-progress.hide
.merge-in-progress.hide
.bs-callout.bs-callout-success
%p
%i
.icon-spinner.icon-spin
%i
.icon-spinner.icon-spin
Merge is in progress. Please wait. Page will be automatically reloaded.
Merge is in progress. Please wait. Page will be automatically reloaded.
app/views/projects/merge_requests/show/_mr_box.html.haml
View file @
4e002a71
...
@@ -23,23 +23,3 @@
...
@@ -23,23 +23,3 @@
.context
.context
%cite
.cgray
%cite
.cgray
=
render
partial:
'projects/merge_requests/show/context'
,
locals:
{
merge_request:
@merge_request
}
=
render
partial:
'projects/merge_requests/show/context'
,
locals:
{
merge_request:
@merge_request
}
-
if
@merge_request
.
closed?
.alert.alert-info
%span
%i
.icon-remove
Closed by
#{
link_to_member
(
@project
,
@merge_request
.
closed_event
.
author
)
}
#{
time_ago_with_tooltip
(
@merge_request
.
closed_event
.
created_at
)
}
-
if
@merge_request
.
merged?
.alert.alert-info
%span
%i
.icon-ok
Merged by
#{
link_to_member
(
@project
,
@merge_request
.
merge_event
.
author
)
}
#{
time_ago_with_tooltip
(
@merge_request
.
merge_event
.
created_at
)
}
-
if
!
@closes_issues
.
empty?
&&
@merge_request
.
open?
.alert.alert-info.alert-info
%span
%i
.icon-ok
Accepting this merge request will close
#{
@closes_issues
.
size
==
1
?
'issue'
:
'issues'
}
=
succeed
'.'
do
!=
gfm
(
@closes_issues
.
map
{
|
i
|
"#
#{
i
.
iid
}
"
}.
to_sentence
)
app/views/projects/merge_requests/show/_mr_ci.html.haml
View file @
4e002a71
-
if
@commits
.
any?
-
if
@commits
.
any?
.ci_widget.ci-success
{
style:
"display:none"
}
.ci_widget.ci-success
{
style:
"display:none"
}
.alert.alert-success
%i
.icon-ok
%i
.icon-ok
%strong
CI build passed
%strong
CI build passed
for
#{
@merge_request
.
last_commit_short_sha
}
.
for
#{
@merge_request
.
last_commit_short_sha
}
.
=
link_to
"Build page"
,
ci_build_details_path
(
@merge_request
)
=
link_to
"Build page"
,
ci_build_details_path
(
@merge_request
)
.ci_widget.ci-failed
{
style:
"display:none"
}
.ci_widget.ci-failed
{
style:
"display:none"
}
.alert.alert-danger
%i
.icon-remove
%i
.icon-remove
%strong
CI build failed
%strong
CI build failed
for
#{
@merge_request
.
last_commit_short_sha
}
.
for
#{
@merge_request
.
last_commit_short_sha
}
.
=
link_to
"Build page"
,
ci_build_details_path
(
@merge_request
)
=
link_to
"Build page"
,
ci_build_details_path
(
@merge_request
)
-
[
:running
,
:pending
].
each
do
|
status
|
-
[
:running
,
:pending
].
each
do
|
status
|
.ci_widget
{
class:
"ci-#{status}"
,
style:
"display:none"
}
.ci_widget
{
class:
"ci-#{status}"
,
style:
"display:none"
}
.alert.alert-warning
%i
.icon-time
%i
.icon-time
%strong
CI build
#{
status
}
%strong
CI build
#{
status
}
for
#{
@merge_request
.
last_commit_short_sha
}
.
for
#{
@merge_request
.
last_commit_short_sha
}
.
=
link_to
"Build page"
,
ci_build_details_path
(
@merge_request
)
=
link_to
"Build page"
,
ci_build_details_path
(
@merge_request
)
.ci_widget
.ci_widget
.alert.alert-warning
%strong
%strong
%i
.icon-spinner
%i
.icon-spinner
Checking for CI status for
#{
@merge_request
.
last_commit_short_sha
}
Checking for CI status for
#{
@merge_request
.
last_commit_short_sha
}
.ci_widget.ci-error
{
style:
"display:none"
}
.ci_widget.ci-error
{
style:
"display:none"
}
.alert.alert-danger
%i
.icon-remove
%i
.icon-remove
%strong
Cannot connect to CI server. Please check your setting
%strong
Cannot connect to CI server. Please check your setting
app/views/projects/merge_requests/show/_no_accept.html.haml
View file @
4e002a71
.alert.alert-danger
%h4
%p
Can't be merged
This merge request can not be accepted because branch
%p
-
unless
@merge_request
.
source_branch_exists?
This merge request can not be accepted because branch
%span
.label.label-inverse
=
@merge_request
.
source_branch
-
unless
@merge_request
.
source_branch_exists?
does not exist in
%span
.label.label-inverse
=
@merge_request
.
source_branch
%span
.label.label-info
=
@merge_request
.
source_project_path
does not exist in
-
else
%span
.label.label-info
=
@merge_request
.
source_project_path
%span
.label.label-inverse
=
@merge_request
.
target_branch
-
else
does not exist in
%span
.label.label-inverse
=
@merge_request
.
target_branch
%span
.label.label-info
=
@merge_request
.
target_project_path
does not exist in
%span
.label.label-info
=
@merge_request
.
target_project_path
%br
%strong
Please close this merge request or change branches with existing one
%strong
Please close this merge request or change branches with existing one
app/views/projects/merge_requests/show/_remove_source_branch.html.haml
View file @
4e002a71
-
if
@source_branch
.
blank?
-
if
@source_branch
.
blank?
.bs-callout.bs-callout-info
Source branch has been removed
Source branch has been removed
-
elsif
@allowed_to_remove_source_branch
&&
@merge_request
.
merged?
-
elsif
@allowed_to_remove_source_branch
&&
@merge_request
.
merged?
.remove_source_branch_widget
.remove_source_branch_widget
.alert.alert-info
%p
Changes merged into
#{
@merge_request
.
target_branch
}
. You can remove source branch now
=
link_to
project_branch_path
(
@merge_request
.
source_project
,
@source_branch
),
remote:
true
,
method: :delete
,
class:
"btn btn-primary
remove_source_branch"
do
=
link_to
project_branch_path
(
@merge_request
.
source_project
,
@source_branch
),
remote:
true
,
method: :delete
,
class:
"btn btn-primary btn-small
remove_source_branch"
do
%i
.icon-remove
%i
.icon-remove
Remove Source Branch
Remove Source Branch
.remove_source_branch_widget.failed.hide
.remove_source_branch_widget.failed.hide
.alert.alert-error
Failed to remove source branch '
#{
@merge_request
.
source_branch
}
'
Failed to remove source branch '
#{
@merge_request
.
source_branch
}
'
.remove_source_branch_in_progress.hide
.remove_source_branch_in_progress.hide
.bs-callout.bs-callout-info
%i
.icon-refresh.icon-spin
%i
.icon-refresh.icon-spin
Removing source branch '
#{
@merge_request
.
source_branch
}
'. Please wait. Page will be automatically reloaded.
Removing source branch '
#{
@merge_request
.
source_branch
}
'. Please wait. Page will be automatically reloaded.
app/views/projects/merge_requests/show/_state_widget.html.haml
0 → 100644
View file @
4e002a71
.panel.mr-state-widget.panel-default
-
if
@merge_request
.
source_project
.
gitlab_ci?
&&
@commits
.
any?
.panel-heading
=
render
"projects/merge_requests/show/mr_ci"
.panel-body
-
if
@merge_request
.
open?
-
if
@merge_request
.
source_branch_exists?
&&
@merge_request
.
target_branch_exists?
=
render
"projects/merge_requests/show/mr_accept"
-
else
=
render
"projects/merge_requests/show/no_accept"
-
if
@merge_request
.
closed?
%h4
Closed by
#{
link_to_member
(
@project
,
@merge_request
.
closed_event
.
author
,
avatar:
false
)
}
#{
time_ago_with_tooltip
(
@merge_request
.
closed_event
.
created_at
)
}
%p
Changes was not merged into target branch
-
if
@merge_request
.
merged?
%h4
Merged by
#{
link_to_member
(
@project
,
@merge_request
.
merge_event
.
author
,
avatar:
false
)
}
#{
time_ago_with_tooltip
(
@merge_request
.
merge_event
.
created_at
)
}
=
render
"projects/merge_requests/show/remove_source_branch"
-
if
!
@closes_issues
.
empty?
&&
@merge_request
.
open?
.alert.alert-info.alert-info
%span
%i
.icon-ok
Accepting this merge request will close
#{
@closes_issues
.
size
==
1
?
'issue'
:
'issues'
}
=
succeed
'.'
do
!=
gfm
(
@closes_issues
.
map
{
|
i
|
"#
#{
i
.
iid
}
"
}.
to_sentence
)
-
unless
@commits
.
any?
%h4
Nothing to merge
%p
Nothing to merge from
%span
.label-branch
#{
@merge_request
.
source_branch
}
to
%span
.label-branch
#{
@merge_request
.
target_branch
}
%br
Try to use different branches or push new code.
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