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
c5a13781
Commit
c5a13781
authored
May 16, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use same last commit widget on project homepage and tree view
parent
67312fce
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
13 additions
and
83 deletions
+13
-83
app/assets/stylesheets/pages/projects.scss
app/assets/stylesheets/pages/projects.scss
+0
-30
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+1
-1
app/views/projects/_files.html.haml
app/views/projects/_files.html.haml
+9
-1
app/views/projects/_last_commit.html.haml
app/views/projects/_last_commit.html.haml
+0
-12
app/views/projects/show.html.haml
app/views/projects/show.html.haml
+0
-5
app/views/projects/tree/show.html.haml
app/views/projects/tree/show.html.haml
+1
-10
features/steps/shared/project.rb
features/steps/shared/project.rb
+2
-2
spec/views/projects/_last_commit.html.haml_spec.rb
spec/views/projects/_last_commit.html.haml_spec.rb
+0
-22
No files found.
app/assets/stylesheets/pages/projects.scss
View file @
c5a13781
...
...
@@ -639,36 +639,6 @@ pre.light-well {
}
}
.project-last-commit
{
background-color
:
$gray-light
;
border
:
1px
solid
$border-color
;
border-radius
:
$border-radius-base
;
padding
:
12px
;
@media
(
min-width
:
$screen-sm-min
)
{
margin-top
:
$gl-padding
;
}
.ci-status
{
margin-right
:
$gl-padding
;
}
.commit-row-message
{
color
:
$gl-text-color
;
}
.commit-sha
{
margin-right
:
5px
;
font-weight
:
600
;
}
.commit-author-link
{
.commit-author-name
{
font-weight
:
600
;
}
}
}
.project-show-readme
{
.row-content-block
{
background-color
:
inherit
;
...
...
app/helpers/commits_helper.rb
View file @
c5a13781
...
...
@@ -91,7 +91,7 @@ module CommitsHelper
end
def
link_to_browse_code
(
project
,
commit
)
return
unless
current_controller?
(
:
projects
,
:
commits
)
return
unless
current_controller?
(
:commits
)
if
@path
.
blank?
return
link_to
(
...
...
app/views/projects/_files.html.haml
View file @
c5a13781
-
commit
=
local_assigns
.
fetch
(
:commit
)
{
@repository
.
commit
}
-
ref
=
local_assigns
.
fetch
(
:ref
)
{
current_ref
}
-
project
=
local_assigns
.
fetch
(
:project
)
{
@project
}
#tree-holder
.tree-holder.clearfix
.nav-block
=
render
'projects/tree/tree_header'
,
tree:
@tree
=
render
'projects/tree/tree_content'
,
tree:
@tree
-
if
commit
.info-well.hidden-xs.project-last-commit.append-bottom-default
.well-segment
%ul
.blob-commit-info
=
render
'projects/commits/commit'
,
commit:
commit
,
ref:
ref
,
project:
project
=
render
'projects/tree/tree_content'
,
tree:
@tree
app/views/projects/_last_commit.html.haml
deleted
100644 → 0
View file @
67312fce
-
ref
=
local_assigns
.
fetch
(
:ref
)
-
status
=
commit
.
status
(
ref
)
-
if
status
=
link_to
pipelines_namespace_project_commit_path
(
commit
.
project
.
namespace
,
commit
.
project
,
commit
),
class:
"ci-status ci-
#{
status
}
"
do
=
ci_icon_for_status
(
status
)
=
ci_text_for_status
(
status
)
=
link_to
commit
.
short_id
,
namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
),
class:
"commit-sha"
=
link_to_gfm
commit
.
title
,
namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
),
class:
"commit-row-message"
·
#{
time_ago_with_tooltip
(
commit
.
committed_date
)
}
by
=
commit_author_link
(
commit
,
avatar:
true
,
size:
24
)
app/views/projects/show.html.haml
View file @
c5a13781
...
...
@@ -73,11 +73,6 @@
=
link_to
add_special_file_path
(
@project
,
file_name:
'.gitlab-ci.yml'
,
commit_message:
'Set up auto deploy'
,
branch_name:
'auto-deploy'
,
context:
'autodeploy'
)
do
Set up auto deploy
-
if
@repository
.
commit
%div
{
class:
container_class
}
.project-last-commit
=
render
'projects/last_commit'
,
commit:
@repository
.
commit
,
ref:
current_ref
,
project:
@project
%div
{
class:
container_class
}
-
if
@project
.
archived?
.text-warning.center.prepend-top-20
...
...
app/views/projects/tree/show.html.haml
View file @
c5a13781
...
...
@@ -7,13 +7,4 @@
=
render
'projects/last_push'
%div
{
class:
container_class
}
#tree-holder
.tree-holder.clearfix
.nav-block
=
render
'projects/tree/tree_header'
,
tree:
@tree
.info-well.hidden-xs.append-bottom-default
.well-segment
%ul
.blob-commit-info
=
render
'projects/commits/commit'
,
commit:
@commit
,
project:
@project
,
ref:
@ref
=
render
'projects/tree/tree_content'
,
tree:
@tree
=
render
'projects/files'
,
commit:
@commit
,
project:
@project
,
ref:
@ref
features/steps/shared/project.rb
View file @
c5a13781
...
...
@@ -256,9 +256,9 @@ module SharedProject
end
step
'I should see last commit with CI status'
do
page
.
within
".
project-last-commit
"
do
page
.
within
".
blob-commit-info
"
do
expect
(
page
).
to
have_content
(
project
.
commit
.
sha
[
0
..
6
])
expect
(
page
).
to
have_
content
(
"
skipped"
)
expect
(
page
).
to
have_
link
(
"Commit:
skipped"
)
end
end
...
...
spec/views/projects/_last_commit.html.haml_spec.rb
deleted
100644 → 0
View file @
67312fce
require
'spec_helper'
describe
'projects/_last_commit'
,
:view
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
context
'when there is a pipeline present for the commit'
do
context
'when pipeline is blocked'
do
let!
(
:pipeline
)
do
create
(
:ci_pipeline
,
:blocked
,
project:
project
,
sha:
project
.
commit
.
id
)
end
it
'shows correct pipeline badge'
do
render
'projects/last_commit'
,
commit:
project
.
commit
,
project:
project
,
ref: :master
expect
(
rendered
).
to
have_text
"blocked
#{
project
.
commit
.
short_id
}
"
end
end
end
end
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