Fixed: wrong commit committed_date.

This commit is contained in:
Vokhmin Alexey V 2014-07-01 00:21:35 +04:00
parent 6ba72db818
commit 113a91501f
3 changed files with 6 additions and 5 deletions

View File

@ -93,8 +93,9 @@ module GitHelper
end
def split_commits_by_date(commits)
commits.sort{|x, y| y.authored_date <=> x.authored_date}.inject({}) do |h, commit|
dt = commit.authored_date
# See: https://github.com/gitlabhq/gitlabhq/blob/master/app/views/projects/commits/_commits.html.haml#L1
commits.sort{|x, y| y.committed_date <=> x.committed_date}.inject({}) do |h, commit|
dt = commit.committed_date
h[dt.year] ||= {}
h[dt.year][dt.month] ||= {}
h[dt.year][dt.month][dt.day] ||= []

View File

@ -61,7 +61,7 @@ class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter
end
def content?
!content.blank?
content.present?
end
def caption?
@ -108,7 +108,7 @@ class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter
@content = (@content.present?) ? tmp + @content : tmp
@caption = @caption[0..68] + '...'
end
# @content = @content.gsub("\n", "<br />").html_safe if @content
# @content = @content.gsub("\n", "<br />").html_safe if @content
@content = simple_format(@content, {}, sanitize: true).html_safe if @content
end
end

View File

@ -9,7 +9,7 @@
- by_month.each_pair do |month, by_day|
- by_day.each_pair do |day, commits|
.date-block
.date= raw l(commits.first.authored_date, format: :date_block_format)
.date= raw l(commits.first.committed_date, format: :date_block_format)
.messages
- commits.each_with_index do |commit|
- GitPresenters::CommitAsMessagePresenter.present(commit, project: @project) do |presenter|