提交 1af84f8c 编写于 作者: D Dmitriy Zaporozhets

Merge branch 'feature/blob_last_commit' into 'master'

Feature: show last commit for Blob#show

Fixes #970
......@@ -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;
}
}
}
}
......@@ -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
......
......@@ -204,4 +204,8 @@ class Repository
end
end
end
def last_commit_for_path(sha, path)
commits(sha, path, 1).last
end
end
......@@ -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
......
%div.tree-ref-holder
= render 'shared/ref_switcher', destination: 'blob', path: @path
%div#tree-holder.tree-holder
= render 'blob', blob: @blob
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册