Commit 7e9095eff2f68b7c732e0f3bac3f5ece3a1c46f4

Authored by Larissa Reis
1 parent 6ddf4a29

Fixes crash in tracker notification about product

  time_ago_as_sentence has been replaced in a refactor and *_description
  now takes the action tracker record as an argument. This just
  updates product related notifications to work after these changes.
app/helpers/action_tracker_helper.rb
@@ -67,19 +67,19 @@ module ActionTrackerHelper @@ -67,19 +67,19 @@ module ActionTrackerHelper
67 } 67 }
68 end 68 end
69 69
70 - def create_product_description 70 + def create_product_description ta
71 _('created the product %{title}') % { 71 _('created the product %{title}') % {
72 title: link_to(truncate(ta.get_name), ta.get_url), 72 title: link_to(truncate(ta.get_name), ta.get_url),
73 } 73 }
74 end 74 end
75 75
76 - def update_product_description 76 + def update_product_description ta
77 _('updated the product %{title}') % { 77 _('updated the product %{title}') % {
78 title: link_to(truncate(ta.get_name), ta.get_url), 78 title: link_to(truncate(ta.get_name), ta.get_url),
79 } 79 }
80 end 80 end
81 81
82 - def remove_product_description 82 + def remove_product_description ta
83 _('removed the product %{title}') % { 83 _('removed the product %{title}') % {
84 title: truncate(ta.get_name), 84 title: truncate(ta.get_name),
85 } 85 }
app/views/profile/_create_product.html.erb
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 </div> 3 </div>
4 <div class='profile-activity-description'> 4 <div class='profile-activity-description'>
5 <p class='profile-activity-text'><%= link_to activity.user.short_name(nil), activity.user.url %> <%= describe activity %></p> 5 <p class='profile-activity-text'><%= link_to activity.user.short_name(nil), activity.user.url %> <%= describe activity %></p>
6 - <p class='profile-activity-time'><%= time_ago_as_sentence activity.created_at %></p> 6 + <p class='profile-activity-time'><%= time_ago_in_words activity.created_at %></p>
7 7
8 <div class='profile-wall-actions'> 8 <div class='profile-wall-actions'>
9 <%= link_to_function(_('Remove'), 'remove_item_wall(this, \'%s\', \'%s\', \'%s\'); return false ;' % [".profile-activity-item", url_for(:profile => params[:profile], :action => :remove_activity, :activity_id => activity.id, :view => params[:view]), _('Are you sure you want to remove this activity and all its replies?')]) if logged_in? && current_person == @profile %> 9 <%= link_to_function(_('Remove'), 'remove_item_wall(this, \'%s\', \'%s\', \'%s\'); return false ;' % [".profile-activity-item", url_for(:profile => params[:profile], :action => :remove_activity, :activity_id => activity.id, :view => params[:view]), _('Are you sure you want to remove this activity and all its replies?')]) if logged_in? && current_person == @profile %>
app/views/profile/_favorite_enterprise.html.erb
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 <p class='profile-activity-text'> 5 <p class='profile-activity-text'>
6 <%= link_to activity.user.short_name(nil), activity.user.url %> <%= describe activity %> 6 <%= link_to activity.user.short_name(nil), activity.user.url %> <%= describe activity %>
7 </p> 7 </p>
8 - <p class='profile-activity-time'><%= time_ago_as_sentence activity.created_at %></p> 8 + <p class='profile-activity-time'><%= time_ago_in_words activity.created_at %></p>
9 9
10 <div class='profile-wall-actions'> 10 <div class='profile-wall-actions'>
11 <%= link_to_function(_('Remove'), 'remove_item_wall(this, \'%s\', \'%s\', \'%s\'); return false ;' % [".profile-activity-item", url_for(:profile => params[:profile], :action => :remove_activity, :activity_id => activity.id, :view => params[:view]), _('Are you sure you want to remove this activity and all its replies?')]) if logged_in? && current_person == @profile %> 11 <%= link_to_function(_('Remove'), 'remove_item_wall(this, \'%s\', \'%s\', \'%s\'); return false ;' % [".profile-activity-item", url_for(:profile => params[:profile], :action => :remove_activity, :activity_id => activity.id, :view => params[:view]), _('Are you sure you want to remove this activity and all its replies?')]) if logged_in? && current_person == @profile %>
app/views/profile/_remove_product.html.erb
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 </div> 2 </div>
3 <div class='profile-activity-description'> 3 <div class='profile-activity-description'>
4 <p class='profile-activity-text'><%= link_to activity.user.short_name(nil), activity.user.url %> <%= describe activity %></p> 4 <p class='profile-activity-text'><%= link_to activity.user.short_name(nil), activity.user.url %> <%= describe activity %></p>
5 - <p class='profile-activity-time'><%= time_ago_as_sentence activity.created_at %></p> 5 + <p class='profile-activity-time'><%= time_ago_in_words activity.created_at %></p>
6 6
7 <div class='profile-wall-actions'> 7 <div class='profile-wall-actions'>
8 <%= link_to_function(_('Remove'), 'remove_item_wall(this, \'%s\', \'%s\', \'%s\'); return false ;' % [".profile-activity-item", url_for(:profile => params[:profile], :action => :remove_activity, :activity_id => activity.id, :view => params[:view]), _('Are you sure you want to remove this activity and all its replies?')]) if logged_in? && current_person == @profile %> 8 <%= link_to_function(_('Remove'), 'remove_item_wall(this, \'%s\', \'%s\', \'%s\'); return false ;' % [".profile-activity-item", url_for(:profile => params[:profile], :action => :remove_activity, :activity_id => activity.id, :view => params[:view]), _('Are you sure you want to remove this activity and all its replies?')]) if logged_in? && current_person == @profile %>
app/views/profile/_update_product.html.erb
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 </div> 3 </div>
4 <div class='profile-activity-description'> 4 <div class='profile-activity-description'>
5 <p class='profile-activity-text'><%= link_to activity.user.short_name(nil), activity.user.url %> <%= describe activity %></p> 5 <p class='profile-activity-text'><%= link_to activity.user.short_name(nil), activity.user.url %> <%= describe activity %></p>
6 - <p class='profile-activity-time'><%= time_ago_as_sentence activity.created_at %></p> 6 + <p class='profile-activity-time'><%= time_ago_in_words activity.created_at %></p>
7 7
8 <div class='profile-wall-actions'> 8 <div class='profile-wall-actions'>
9 <%= link_to_function(_('Remove'), 'remove_item_wall(this, \'%s\', \'%s\', \'%s\'); return false ;' % [".profile-activity-item", url_for(:profile => params[:profile], :action => :remove_activity, :activity_id => activity.id, :view => params[:view]), _('Are you sure you want to remove this activity and all its replies?')]) if logged_in? && current_person == @profile %> 9 <%= link_to_function(_('Remove'), 'remove_item_wall(this, \'%s\', \'%s\', \'%s\'); return false ;' % [".profile-activity-item", url_for(:profile => params[:profile], :action => :remove_activity, :activity_id => activity.id, :view => params[:view]), _('Are you sure you want to remove this activity and all its replies?')]) if logged_in? && current_person == @profile %>