Commit 9a3d665919218ebe30fd1b10a70e75db16675bff
1 parent
35fb7d54
Exists in
spb-stable
and in
3 other branches
Show last commit for Blob#show
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
5 changed files
with
28 additions
and
1 deletions
Show diff stats
app/assets/stylesheets/sections/tree.scss
| ... | ... | @@ -133,3 +133,21 @@ |
| 133 | 133 | color: #777; |
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | + | |
| 137 | +.blob-commit-info { | |
| 138 | + list-style: none; | |
| 139 | + margin: 0; | |
| 140 | + padding: 0; | |
| 141 | + margin-bottom: 10px; | |
| 142 | + | |
| 143 | + .commit { | |
| 144 | + .commit-row-title { | |
| 145 | + font-size: 13px; | |
| 146 | + | |
| 147 | + .commit-row-message { | |
| 148 | + font-weight: normal; | |
| 149 | + color: #555; | |
| 150 | + } | |
| 151 | + } | |
| 152 | + } | |
| 153 | +} | ... | ... |
app/controllers/projects/refs_controller.rb
| ... | ... | @@ -34,7 +34,7 @@ class Projects::RefsController < Projects::ApplicationController |
| 34 | 34 | contents = tree.entries |
| 35 | 35 | @logs = contents.map do |content| |
| 36 | 36 | file = params[:path] ? File.join(params[:path], content.name) : content.name |
| 37 | - last_commit = @repo.commits(@commit.id, file, 1).last | |
| 37 | + last_commit = @repo.last_commit_for_path(@commit.id, file) | |
| 38 | 38 | { |
| 39 | 39 | file_name: content.name, |
| 40 | 40 | commit: last_commit | ... | ... |
app/models/repository.rb
app/views/projects/blob/_blob.html.haml
| ... | ... | @@ -15,6 +15,10 @@ |
| 15 | 15 | - else |
| 16 | 16 | = link_to title, '#' |
| 17 | 17 | |
| 18 | +%ul.blob-commit-info.bs-callout.bs-callout-info | |
| 19 | + - blob_commit = @repository.last_commit_for_path(@commit.id, @blob.path) | |
| 20 | + = render blob_commit, project: @project | |
| 21 | + | |
| 18 | 22 | %div#tree-content-holder.tree-content-holder |
| 19 | 23 | .file-holder |
| 20 | 24 | .file-title | ... | ... |