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
Tatuya Kamada
gitlab-ce
Commits
9a3d6659
Commit
9a3d6659
authored
Feb 10, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Showing
5 changed files
with
28 additions
and
1 deletion
+28
-1
app/assets/stylesheets/sections/tree.scss
app/assets/stylesheets/sections/tree.scss
+18
-0
app/controllers/projects/refs_controller.rb
app/controllers/projects/refs_controller.rb
+1
-1
app/models/repository.rb
app/models/repository.rb
+4
-0
app/views/projects/blob/_blob.html.haml
app/views/projects/blob/_blob.html.haml
+4
-0
app/views/projects/blob/show.html.haml
app/views/projects/blob/show.html.haml
+1
-0
No files found.
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 @@ class Projects::RefsController < Projects::ApplicationController
contents
=
tree
.
entries
@logs
=
contents
.
map
do
|
content
|
file
=
params
[
:path
]
?
File
.
join
(
params
[
:path
],
content
.
name
)
:
content
.
name
last_commit
=
@repo
.
commits
(
@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 @@ class Repository
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