diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index da0c3af..af7a453 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -65,8 +65,6 @@ class ApplicationController < ActionController::Base helper :language include DesignHelper - - # Be sure to include AuthenticationSystem in Application Controller instead include AuthenticatedSystem include PermissionCheck diff --git a/app/helpers/action_tracker_helper.rb b/app/helpers/action_tracker_helper.rb index e6f8a66..7d13a5b 100644 --- a/app/helpers/action_tracker_helper.rb +++ b/app/helpers/action_tracker_helper.rb @@ -67,19 +67,19 @@ module ActionTrackerHelper } end - def create_product_description + def create_product_description ta _('created the product %{title}') % { title: link_to(truncate(ta.get_name), ta.get_url), } end - def update_product_description + def update_product_description ta _('updated the product %{title}') % { title: link_to(truncate(ta.get_name), ta.get_url), } end - def remove_product_description + def remove_product_description ta _('removed the product %{title}') % { title: truncate(ta.get_name), } diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index 11acb50..a1e60e8 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -1,5 +1,11 @@ +require_relative '../helpers/application_helper' + class ApplicationMailer < ActionMailer::Base + include AuthenticatedSystem + + helper ApplicationHelper + attr_accessor :environment def default_url_options options = nil diff --git a/app/models/person_notifier.rb b/app/models/person_notifier.rb index d286f6c..ba75c89 100644 --- a/app/models/person_notifier.rb +++ b/app/models/person_notifier.rb @@ -77,9 +77,8 @@ class PersonNotifier end - class Mailer < ActionMailer::Base + class Mailer < ApplicationMailer - helper ApplicationHelper helper ActionTrackerHelper def session @@ -88,8 +87,8 @@ class PersonNotifier def content_summary(person, notifications, tasks) if person.environment - ActionMailer::Base.asset_host = person.environment.top_url - ActionMailer::Base.default_url_options[:host] = person.environment.default_hostname + ApplicationMailer.asset_host = person.environment.top_url + ApplicationMailer.default_url_options[:host] = person.environment.default_hostname end @current_theme = 'default' diff --git a/app/models/profile_list_block.rb b/app/models/profile_list_block.rb index ab101d1..fc8ea89 100644 --- a/app/models/profile_list_block.rb +++ b/app/models/profile_list_block.rb @@ -16,7 +16,7 @@ class ProfileListBlock < Block def profile_list result = nil - public_profiles = profiles.public.includes([:image,:domains,:preferred_domain,:environment]) + public_profiles = profiles.is_public.includes([:image,:domains,:preferred_domain,:environment]) if !prioritize_profiles_with_image result = public_profiles.all(:limit => get_limit, :order => 'profiles.updated_at DESC').sort_by{ rand } elsif profiles.visible.with_image.count >= get_limit @@ -28,7 +28,7 @@ result = public_profiles.all(:limit => get_limit, :order => 'profiles.updated_at end def profile_count - profiles.public.length + profiles.is_public.length end # the title of the block. Probably will be overriden in subclasses. diff --git a/app/views/person_notifier/mailer/_create_product.html.erb b/app/views/person_notifier/mailer/_create_product.html.erb new file mode 120000 index 0000000..e1169fd --- /dev/null +++ b/app/views/person_notifier/mailer/_create_product.html.erb @@ -0,0 +1 @@ +../../profile/_create_product.html.erb \ No newline at end of file diff --git a/app/views/person_notifier/mailer/_favorite_enterprise.html.erb b/app/views/person_notifier/mailer/_favorite_enterprise.html.erb new file mode 120000 index 0000000..601ec31 --- /dev/null +++ b/app/views/person_notifier/mailer/_favorite_enterprise.html.erb @@ -0,0 +1 @@ +../../profile/_favorite_enterprise.html.erb \ No newline at end of file diff --git a/app/views/person_notifier/mailer/_remove_product.html.erb b/app/views/person_notifier/mailer/_remove_product.html.erb new file mode 120000 index 0000000..49ea419 --- /dev/null +++ b/app/views/person_notifier/mailer/_remove_product.html.erb @@ -0,0 +1 @@ +../../profile/_remove_product.html.erb \ No newline at end of file diff --git a/app/views/person_notifier/mailer/_update_product.html.erb b/app/views/person_notifier/mailer/_update_product.html.erb new file mode 120000 index 0000000..81d9f5e --- /dev/null +++ b/app/views/person_notifier/mailer/_update_product.html.erb @@ -0,0 +1 @@ +../../profile/_update_product.html.erb \ No newline at end of file diff --git a/app/views/profile/_create_product.html.erb b/app/views/profile/_create_product.html.erb index d7021d3..094309f 100644 --- a/app/views/profile/_create_product.html.erb +++ b/app/views/profile/_create_product.html.erb @@ -3,7 +3,7 @@
<%= link_to activity.user.short_name(nil), activity.user.url %> <%= describe activity %>
-<%= time_ago_as_sentence activity.created_at %>
+<%= time_ago_in_words activity.created_at %>
<%= link_to activity.user.short_name(nil), activity.user.url %> <%= describe activity %>
-<%= time_ago_as_sentence activity.created_at %>
+<%= time_ago_in_words activity.created_at %>
<%= link_to activity.user.short_name(nil), activity.user.url %> <%= describe activity %>
-<%= time_ago_as_sentence activity.created_at %>
+<%= time_ago_in_words activity.created_at %>
<%= link_to activity.user.short_name(nil), activity.user.url %> <%= describe activity %>
-<%= time_ago_as_sentence activity.created_at %>
+<%= time_ago_in_words activity.created_at %>