From 4d9c1b3f7b266854745129b202a6a29294ec2336 Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Mon, 27 Jan 2014 17:39:19 -0300 Subject: [PATCH] rails3: fix action_tracker --- app/views/profile/_join_community.html.erb | 2 +- app/views/profile/_leave_scrap_to_self.html.erb | 2 +- app/views/profile/_new_friendship.html.erb | 2 +- app/views/profile/_reply_scrap_on_self.rhtml | 2 +- config/initializers/action_tracker.rb | 14 +++++++------- vendor/plugins/action_tracker/lib/action_tracker.rb | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/views/profile/_join_community.html.erb b/app/views/profile/_join_community.html.erb index 208830a..66f026e 120000 --- a/app/views/profile/_join_community.html.erb +++ b/app/views/profile/_join_community.html.erb @@ -1 +1 @@ -_add_member_in_community.rhtml \ No newline at end of file +_add_member_in_community.html.erb \ No newline at end of file diff --git a/app/views/profile/_leave_scrap_to_self.html.erb b/app/views/profile/_leave_scrap_to_self.html.erb index 56c0e42..6f9bf42 120000 --- a/app/views/profile/_leave_scrap_to_self.html.erb +++ b/app/views/profile/_leave_scrap_to_self.html.erb @@ -1 +1 @@ -_leave_scrap.rhtml \ No newline at end of file +_leave_scrap.html.erb \ No newline at end of file diff --git a/app/views/profile/_new_friendship.html.erb b/app/views/profile/_new_friendship.html.erb index 208830a..66f026e 120000 --- a/app/views/profile/_new_friendship.html.erb +++ b/app/views/profile/_new_friendship.html.erb @@ -1 +1 @@ -_add_member_in_community.rhtml \ No newline at end of file +_add_member_in_community.html.erb \ No newline at end of file diff --git a/app/views/profile/_reply_scrap_on_self.rhtml b/app/views/profile/_reply_scrap_on_self.rhtml index 56c0e42..6f9bf42 120000 --- a/app/views/profile/_reply_scrap_on_self.rhtml +++ b/app/views/profile/_reply_scrap_on_self.rhtml @@ -1 +1 @@ -_leave_scrap.rhtml \ No newline at end of file +_leave_scrap.html.erb \ No newline at end of file diff --git a/config/initializers/action_tracker.rb b/config/initializers/action_tracker.rb index 5fd4037..c35809d 100644 --- a/config/initializers/action_tracker.rb +++ b/config/initializers/action_tracker.rb @@ -2,30 +2,30 @@ require 'noosfero/i18n' # ActionTracker plugin stuff -@reply_scrap_description = lambda { _('sent a message to %{receiver}:
"%{message}"') % { :receiver => "{{link_to(ta.get_receiver_name, ta.get_receiver_url)}}", :message => "{{auto_link_urls(ta.get_content)}}" } } +@reply_scrap_description = proc { _('sent a message to %{receiver}:
"%{message}"') % { :receiver => "{{link_to(ta.get_receiver_name, ta.get_receiver_url)}}", :message => "{{auto_link_urls(ta.get_content)}}" } } ActionTrackerConfig.verbs = { :create_article => { - :description => lambda { _('published an article: %{title}') % { :title => '{{link_to(truncate(ta.get_name), ta.get_url)}}' } } + :description => proc { _('published an article: %{title}') % { :title => '{{link_to(truncate(ta.get_name), ta.get_url)}}' } } }, :new_friendship => { - :description => lambda { n_('has made 1 new friend:
%{name}', 'has made %{num} new friends:
%{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}}' } }, + :description => proc { n_('has made 1 new friend:
%{name}', 'has made %{num} new friends:
%{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}}' } }, :type => :groupable }, :join_community => { - :description => lambda { n_('has joined 1 community:
%{name}', 'has joined %{num} communities:
%{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}}' } }, + :description => proc { n_('has joined 1 community:
%{name}', 'has joined %{num} communities:
%{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}}' } }, :type => :groupable }, :add_member_in_community => { - :description => lambda { _('has joined the community.') }, + :description => proc { _('has joined the community.') }, }, :upload_image => { - :description => lambda do + :description => proc do total = get_view_url.size n_('uploaded 1 image', 'uploaded %d images', total) % total + '
{{'+ @@ -55,7 +55,7 @@ ActionTrackerConfig.verbs = { }, :leave_scrap_to_self => { - :description => lambda { _('wrote:
"%{text}"') % { :text => "{{auto_link_urls(ta.get_content)}}" } } + :description => proc { _('wrote:
"%{text}"') % { :text => "{{auto_link_urls(ta.get_content)}}" } } }, :reply_scrap_on_self => { diff --git a/vendor/plugins/action_tracker/lib/action_tracker.rb b/vendor/plugins/action_tracker/lib/action_tracker.rb index b22f6f0..24ce96a 100644 --- a/vendor/plugins/action_tracker/lib/action_tracker.rb +++ b/vendor/plugins/action_tracker/lib/action_tracker.rb @@ -124,7 +124,7 @@ module ActionTracker module ViewHelper def describe(ta) - returning "" do |result| + "".tap do |result| if ta.is_a?(ActionTracker::Record) result << ta.description.gsub(/\{\{(.*?)\}\}/) { eval $1 } else -- libgit2 0.21.2