Commit 4d9c1b3f7b266854745129b202a6a29294ec2336
1 parent
159de064
Exists in
master
and in
29 other branches
rails3: fix action_tracker
- Change from returning to tap; - Change from lambda to proc; - Fix broken links.
Showing
6 changed files
with
12 additions
and
12 deletions
Show diff stats
app/views/profile/_join_community.html.erb
app/views/profile/_leave_scrap_to_self.html.erb
app/views/profile/_new_friendship.html.erb
app/views/profile/_reply_scrap_on_self.rhtml
config/initializers/action_tracker.rb
... | ... | @@ -2,30 +2,30 @@ require 'noosfero/i18n' |
2 | 2 | |
3 | 3 | # ActionTracker plugin stuff |
4 | 4 | |
5 | -@reply_scrap_description = lambda { _('sent a message to %{receiver}: <br /> "%{message}"') % { :receiver => "{{link_to(ta.get_receiver_name, ta.get_receiver_url)}}", :message => "{{auto_link_urls(ta.get_content)}}" } } | |
5 | +@reply_scrap_description = proc { _('sent a message to %{receiver}: <br /> "%{message}"') % { :receiver => "{{link_to(ta.get_receiver_name, ta.get_receiver_url)}}", :message => "{{auto_link_urls(ta.get_content)}}" } } | |
6 | 6 | |
7 | 7 | ActionTrackerConfig.verbs = { |
8 | 8 | |
9 | 9 | :create_article => { |
10 | - :description => lambda { _('published an article: %{title}') % { :title => '{{link_to(truncate(ta.get_name), ta.get_url)}}' } } | |
10 | + :description => proc { _('published an article: %{title}') % { :title => '{{link_to(truncate(ta.get_name), ta.get_url)}}' } } | |
11 | 11 | }, |
12 | 12 | |
13 | 13 | :new_friendship => { |
14 | - :description => lambda { n_('has made 1 new friend:<br />%{name}', 'has made %{num} new friends:<br />%{name}', get_friend_name.size) % { :num => get_friend_name.size, :name => '{{ta.collect_group_with_index(:friend_name){ |n,i| link_to(image_tag(ta.get_friend_profile_custom_icon[i] || default_or_themed_icon("/images/icons-app/person-icon.png")), ta.get_friend_url[i], :title => n)}.join}}' } }, | |
14 | + :description => proc { n_('has made 1 new friend:<br />%{name}', 'has made %{num} new friends:<br />%{name}', get_friend_name.size) % { :num => get_friend_name.size, :name => '{{ta.collect_group_with_index(:friend_name){ |n,i| link_to(image_tag(ta.get_friend_profile_custom_icon[i] || default_or_themed_icon("/images/icons-app/person-icon.png")), ta.get_friend_url[i], :title => n)}.join}}' } }, | |
15 | 15 | :type => :groupable |
16 | 16 | }, |
17 | 17 | |
18 | 18 | :join_community => { |
19 | - :description => lambda { n_('has joined 1 community:<br />%{name}', 'has joined %{num} communities:<br />%{name}', get_resource_name.size) % { :num => get_resource_name.size, :name => '{{ta.collect_group_with_index(:resource_name){ |n,i| link_to(image_tag(ta.get_resource_profile_custom_icon[i] || default_or_themed_icon("/images/icons-app/community-icon.png")), ta.get_resource_url[i], :title => n)}.join}}' } }, | |
19 | + :description => proc { n_('has joined 1 community:<br />%{name}', 'has joined %{num} communities:<br />%{name}', get_resource_name.size) % { :num => get_resource_name.size, :name => '{{ta.collect_group_with_index(:resource_name){ |n,i| link_to(image_tag(ta.get_resource_profile_custom_icon[i] || default_or_themed_icon("/images/icons-app/community-icon.png")), ta.get_resource_url[i], :title => n)}.join}}' } }, | |
20 | 20 | :type => :groupable |
21 | 21 | }, |
22 | 22 | |
23 | 23 | :add_member_in_community => { |
24 | - :description => lambda { _('has joined the community.') }, | |
24 | + :description => proc { _('has joined the community.') }, | |
25 | 25 | }, |
26 | 26 | |
27 | 27 | :upload_image => { |
28 | - :description => lambda do | |
28 | + :description => proc do | |
29 | 29 | total = get_view_url.size |
30 | 30 | n_('uploaded 1 image', 'uploaded %d images', total) % total + |
31 | 31 | '<br />{{'+ |
... | ... | @@ -55,7 +55,7 @@ ActionTrackerConfig.verbs = { |
55 | 55 | }, |
56 | 56 | |
57 | 57 | :leave_scrap_to_self => { |
58 | - :description => lambda { _('wrote: <br /> "%{text}"') % { :text => "{{auto_link_urls(ta.get_content)}}" } } | |
58 | + :description => proc { _('wrote: <br /> "%{text}"') % { :text => "{{auto_link_urls(ta.get_content)}}" } } | |
59 | 59 | }, |
60 | 60 | |
61 | 61 | :reply_scrap_on_self => { | ... | ... |
vendor/plugins/action_tracker/lib/action_tracker.rb