Commit 2f790001 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

project -> show refactor

parent 8786aff2
...@@ -64,21 +64,8 @@ class ProjectsController < ApplicationController ...@@ -64,21 +64,8 @@ class ProjectsController < ApplicationController
def show def show
return render "projects/empty" unless @project.repo_exists? return render "projects/empty" unless @project.repo_exists?
@date = case params[:view] limit = (params[:limit] || 40).to_i
when "week" then Date.today - 7.days @activities = @project.updates(limit)
when "day" then Date.today
else nil
end
if @date
@date = @date.at_beginning_of_day
@commits = @project.commits_since(@date)
@messages = project.notes.since(@date).order("created_at DESC")
else
@commits = @project.fresh_commits
@messages = project.notes.fresh.limit(10)
end
end end
# #
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
= image_tag gravatar_icon(update.author_email), :class => "left", :width => 40 = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40
%span.update-title %span.update-title
- if update.kind_of?(Grit::Commit) - if update.kind_of?(Grit::Commit)
%span.tag.commit= update.head.name %span.right.tag.commit= update.head.name
= dashboard_feed_title(update) = dashboard_feed_title(update)
%span.update-author %span.update-author
%strong= update.author_name %strong= update.author_name
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
%span> %span>
Activities Activities
.project-box.project-updates.ui-box.ui-box-small.ui-box-big .project-box.project-updates.ui-box.ui-box-small.ui-box-big
- @project.updates(20).each do |update| - @activities.each do |update|
= render "projects/feed", :update => update, :project => @project = render "projects/feed", :update => update, :project => @project
:javascript :javascript
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment