Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Privacy
Imprint
Contact
Login methods
Sign in
Toggle navigation
Menu
Open sidebar
projects.thm.de
GitLab
Commits
9a3d6659
Unverified
Commit
9a3d6659
authored
Feb 10, 2014
by
Dmitriy Zaporozhets
Browse files
Show last commit for Blob#show
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
35fb7d54
Changes
5
Hide whitespace changes
Inline
Side-by-side
app/assets/stylesheets/sections/tree.scss
View file @
9a3d6659
...
...
@@ -133,3 +133,21 @@
color
:
#777
;
}
}
.blob-commit-info
{
list-style
:
none
;
margin
:
0
;
padding
:
0
;
margin-bottom
:
10px
;
.commit
{
.commit-row-title
{
font-size
:
13px
;
.commit-row-message
{
font-weight
:
normal
;
color
:
#555
;
}
}
}
}
app/controllers/projects/refs_controller.rb
View file @
9a3d6659
...
...
@@ -34,7 +34,7 @@ def logs_tree
contents
=
tree
.
entries
@logs
=
contents
.
map
do
|
content
|
file
=
params
[
:path
]
?
File
.
join
(
params
[
:path
],
content
.
name
)
:
content
.
name
last_commit
=
@repo
.
commit
s
(
@commit
.
id
,
file
,
1
).
last
last_commit
=
@repo
.
last_
commit
_for_path
(
@commit
.
id
,
file
)
{
file_name:
content
.
name
,
commit:
last_commit
...
...
app/models/repository.rb
View file @
9a3d6659
...
...
@@ -204,4 +204,8 @@ def submodule_url_for(ref, path)
end
end
end
def
last_commit_for_path
(
sha
,
path
)
commits
(
sha
,
path
,
1
).
last
end
end
app/views/projects/blob/_blob.html.haml
View file @
9a3d6659
...
...
@@ -15,6 +15,10 @@
-
else
=
link_to
title
,
'#'
%ul
.blob-commit-info.bs-callout.bs-callout-info
-
blob_commit
=
@repository
.
last_commit_for_path
(
@commit
.
id
,
@blob
.
path
)
=
render
blob_commit
,
project:
@project
%div
#tree-content-holder
.tree-content-holder
.file-holder
.file-title
...
...
app/views/projects/blob/show.html.haml
View file @
9a3d6659
%div
.tree-ref-holder
=
render
'shared/ref_switcher'
,
destination:
'blob'
,
path:
@path
%div
#tree-holder
.tree-holder
=
render
'blob'
,
blob:
@blob
...
...
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