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
Jérome Perrin
gitlab-ce
Commits
696a7084
Commit
696a7084
authored
Oct 23, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move rendering CI status to helper
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
7b06c83c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
8 deletions
+10
-8
app/helpers/ci_status_helper.rb
app/helpers/ci_status_helper.rb
+7
-0
app/views/projects/commits/_commit.html.haml
app/views/projects/commits/_commit.html.haml
+1
-2
app/views/projects/merge_requests/_merge_request.html.haml
app/views/projects/merge_requests/_merge_request.html.haml
+1
-3
app/views/shared/projects/_project.html.haml
app/views/shared/projects/_project.html.haml
+1
-3
No files found.
app/helpers/ci_status_helper.rb
View file @
696a7084
...
@@ -42,4 +42,11 @@ module CiStatusHelper
...
@@ -42,4 +42,11 @@ module CiStatusHelper
icon
(
icon_name
)
icon
(
icon_name
)
end
end
def
render_ci_status
(
ci_commit
)
link_to
ci_status_path
(
ci_commit
),
class:
"c
#{
ci_status_color
(
ci_commit
)
}
"
,
title:
"Build status:
#{
ci_commit
.
status
}
"
,
data:
{
toggle:
'tooltip'
,
placement:
'left'
}
do
ci_status_icon
(
ci_commit
)
end
end
end
end
app/views/projects/commits/_commit.html.haml
View file @
696a7084
...
@@ -18,8 +18,7 @@
...
@@ -18,8 +18,7 @@
.pull-right
.pull-right
-
if
ci_commit
-
if
ci_commit
=
link_to
ci_status_path
(
ci_commit
),
class:
"c
#{
ci_status_color
(
ci_commit
)
}
"
do
=
render_ci_status
(
ci_commit
)
=
ci_status_icon
(
ci_commit
)
=
link_to
commit
.
short_id
,
namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
),
class:
"commit_short_id"
=
link_to
commit
.
short_id
,
namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
),
class:
"commit_short_id"
...
...
app/views/projects/merge_requests/_merge_request.html.haml
View file @
696a7084
...
@@ -8,9 +8,7 @@
...
@@ -8,9 +8,7 @@
=
link_to_label
(
label
,
project:
merge_request
.
project
)
=
link_to_label
(
label
,
project:
merge_request
.
project
)
.pull-right.light
.pull-right.light
-
if
ci_commit
-
if
ci_commit
=
link_to
ci_status_path
(
ci_commit
),
class:
"c
#{
ci_status_color
(
ci_commit
)
}
"
,
=
render_ci_status
(
ci_commit
)
title:
"Build status:
#{
ci_commit
.
status
}
"
,
data:
{
toggle:
'tooltip'
,
placement:
'left'
}
do
=
ci_status_icon
(
ci_commit
)
-
if
merge_request
.
merged?
-
if
merge_request
.
merged?
%span
%span
%i
.fa.fa-check
%i
.fa.fa-check
...
...
app/views/shared/projects/_project.html.haml
View file @
696a7084
...
@@ -21,9 +21,7 @@
...
@@ -21,9 +21,7 @@
.project-controls
.project-controls
-
if
ci
&&
!
project
.
empty_repo?
&&
project
.
commit
-
if
ci
&&
!
project
.
empty_repo?
&&
project
.
commit
-
if
ci_commit
=
project
.
ci_commit
(
project
.
commit
.
sha
)
-
if
ci_commit
=
project
.
ci_commit
(
project
.
commit
.
sha
)
=
link_to
ci_status_path
(
ci_commit
),
class:
"c
#{
ci_status_color
(
ci_commit
)
}
"
,
=
render_ci_status
(
ci_commit
)
title:
"Build status:
#{
ci_commit
.
status
}
"
,
data:
{
toggle:
'tooltip'
,
placement:
'left'
}
do
=
ci_status_icon
(
ci_commit
)
-
if
stars
-
if
stars
%span
%span
...
...
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