Show last commit for Blob#show

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2014-02-10 21:46:46 +02:00
parent 35fb7d5408
commit 9a3d665919
No known key found for this signature in database
GPG key ID: 627C5F589F467F17
5 changed files with 28 additions and 1 deletions

View file

@ -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;
}
}
}
}

View file

@ -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

View file

@ -204,4 +204,8 @@ class Repository
end
end
end
def last_commit_for_path(sha, path)
commits(sha, path, 1).last
end
end

View file

@ -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

View file

@ -1,5 +1,6 @@
%div.tree-ref-holder
= render 'shared/ref_switcher', destination: 'blob', path: @path
%div#tree-holder.tree-holder
= render 'blob', blob: @blob