Skip to content

Commit

Permalink
Fixing activity render
Browse files Browse the repository at this point in the history
  • Loading branch information
jcnetdev committed Aug 20, 2008
1 parent 23289a3 commit 568bcbd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 30 deletions.
31 changes: 1 addition & 30 deletions app/helpers/projects_helper.rb
Original file line number Diff line number Diff line change
@@ -1,36 +1,7 @@
module ProjectsHelper

def activity_display(activity, options = {})

haml_tag :span, :class => "activity #{activity.target_type}".downcase do

puts activity.user_name
puts " "
puts activity.action_name
puts " "

puts activity.midsentence
puts " "


puts activity_target_link(activity)
puts " "
puts activity.endconnector

if activity.project_id
puts " "
puts link_to(activity.project_name.to_s+".", project_url(:id => activity.project_id))
else
puts "."
end

# display time
haml_tag :span, :class => "when" do
puts time_ago_in_words(activity.happened_at)
puts " ago"
end

end
partial "activities/activity", options.merge(:activity => activity)
end

def activity_target_link(activity)
Expand Down
17 changes: 17 additions & 0 deletions app/views/activities/_activity.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
- if local_assigns[:activity]
%span.activity{:class => activity.target_type.downcase}

= activity.user_name
= activity.action_name
= activity.midsentence
= activity_target_link(activity)
= activity.endconnector

- if activity.project_id
= activity.endconnector+link_to(activity.project_name.to_s+".", project_url(:id => activity.project_id))
- else
== #{activity.endconnector}.

%span.when
= time_ago_in_words(activity.happened_at)
ago

0 comments on commit 568bcbd

Please sign in to comment.