diff options
-rw-r--r-- | app/assets/stylesheets/sections/tree.scss | 18 | ||||
-rw-r--r-- | app/controllers/projects/refs_controller.rb | 2 | ||||
-rw-r--r-- | app/models/repository.rb | 4 | ||||
-rw-r--r-- | app/views/projects/blob/_blob.html.haml | 4 | ||||
-rw-r--r-- | app/views/projects/blob/show.html.haml | 1 |
5 files changed, 28 insertions, 1 deletions
diff --git a/app/assets/stylesheets/sections/tree.scss b/app/assets/stylesheets/sections/tree.scss index dfdcbb59b6b..f72c6607181 100644 --- a/app/assets/stylesheets/sections/tree.scss +++ b/app/assets/stylesheets/sections/tree.scss @@ -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; + } + } + } +} diff --git a/app/controllers/projects/refs_controller.rb b/app/controllers/projects/refs_controller.rb index 16621c0371e..7b8026cff9f 100644 --- a/app/controllers/projects/refs_controller.rb +++ b/app/controllers/projects/refs_controller.rb @@ -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 diff --git a/app/models/repository.rb b/app/models/repository.rb index 527dff519bd..2c2bf242b94 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -204,4 +204,8 @@ class Repository end end end + + def last_commit_for_path(sha, path) + commits(sha, path, 1).last + end end diff --git a/app/views/projects/blob/_blob.html.haml b/app/views/projects/blob/_blob.html.haml index 32ea967105a..e59d970bf46 100644 --- a/app/views/projects/blob/_blob.html.haml +++ b/app/views/projects/blob/_blob.html.haml @@ -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 diff --git a/app/views/projects/blob/show.html.haml b/app/views/projects/blob/show.html.haml index 56220e520f3..69167654c39 100644 --- a/app/views/projects/blob/show.html.haml +++ b/app/views/projects/blob/show.html.haml @@ -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 |