dsaboard
This commit is contained in:
parent
dbd69d1d0e
commit
1a03b17ab5
7 changed files with 120 additions and 51 deletions
|
@ -60,17 +60,21 @@ class ProjectsController < ApplicationController
|
|||
end
|
||||
|
||||
def show
|
||||
@date = Date.today - 7.days
|
||||
@date = case params[:view]
|
||||
when "week" then Date.today - 7.days
|
||||
else Date.today
|
||||
end
|
||||
|
||||
@heads = @project.repo.heads
|
||||
@commits = @heads.map do |h|
|
||||
@project.repo.log(h.name, nil, :since => @date)
|
||||
@project.repo.log(h.name, nil, :since => @date - 1.day)
|
||||
end.flatten.uniq { |c| c.id }
|
||||
|
||||
@commits.sort! do |x, y|
|
||||
y.committed_date <=> x.committed_date
|
||||
end
|
||||
|
||||
@messages = project.notes.last_week.limit(40).order("created_at DESC")
|
||||
@messages = project.notes.since(@date).limit(40).order("created_at DESC")
|
||||
end
|
||||
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue