Fixed: wrong commit committed_date.
This commit is contained in:
parent
6ba72db818
commit
113a91501f
|
@ -93,8 +93,9 @@ module GitHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def split_commits_by_date(commits)
|
def split_commits_by_date(commits)
|
||||||
commits.sort{|x, y| y.authored_date <=> x.authored_date}.inject({}) do |h, commit|
|
# See: https://github.com/gitlabhq/gitlabhq/blob/master/app/views/projects/commits/_commits.html.haml#L1
|
||||||
dt = commit.authored_date
|
commits.sort{|x, y| y.committed_date <=> x.committed_date}.inject({}) do |h, commit|
|
||||||
|
dt = commit.committed_date
|
||||||
h[dt.year] ||= {}
|
h[dt.year] ||= {}
|
||||||
h[dt.year][dt.month] ||= {}
|
h[dt.year][dt.month] ||= {}
|
||||||
h[dt.year][dt.month][dt.day] ||= []
|
h[dt.year][dt.month][dt.day] ||= []
|
||||||
|
|
|
@ -61,7 +61,7 @@ class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter
|
||||||
end
|
end
|
||||||
|
|
||||||
def content?
|
def content?
|
||||||
!content.blank?
|
content.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
def caption?
|
def caption?
|
||||||
|
@ -108,7 +108,7 @@ class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter
|
||||||
@content = (@content.present?) ? tmp + @content : tmp
|
@content = (@content.present?) ? tmp + @content : tmp
|
||||||
@caption = @caption[0..68] + '...'
|
@caption = @caption[0..68] + '...'
|
||||||
end
|
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
|
@content = simple_format(@content, {}, sanitize: true).html_safe if @content
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
- by_month.each_pair do |month, by_day|
|
- by_month.each_pair do |month, by_day|
|
||||||
- by_day.each_pair do |day, commits|
|
- by_day.each_pair do |day, commits|
|
||||||
.date-block
|
.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
|
.messages
|
||||||
- commits.each_with_index do |commit|
|
- commits.each_with_index do |commit|
|
||||||
- GitPresenters::CommitAsMessagePresenter.present(commit, project: @project) do |presenter|
|
- GitPresenters::CommitAsMessagePresenter.present(commit, project: @project) do |presenter|
|
||||||
|
|
Loading…
Reference in New Issue