This instance will be upgraded to Heptapod 0.31.0 (final) on 2022-05-24 at 14:00 UTC+2 (a few minutes of down time)

Unverified Commit 9a3d6659 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Show last commit for Blob#show


Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 4c581ddf69ba
......@@ -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 @@ 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.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 @@ def submodule_url_for(ref, path)
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% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment