Commit ecb3bad564f832af9d17498877df893ee7bcebad
1 parent
47a47961
Exists in
master
right white spaces removed
Showing
3 changed files
with
10 additions
and
11 deletions
Show diff stats
controllers/email_article_plugin_myprofile_controller.rb
@@ -4,19 +4,19 @@ class EmailArticlePluginMyprofileController < MyProfileController | @@ -4,19 +4,19 @@ class EmailArticlePluginMyprofileController < MyProfileController | ||
4 | # before_filter :check_access_to_profile, :except => [:join, :join_not_logged, :index, :add] | 4 | # before_filter :check_access_to_profile, :except => [:join, :join_not_logged, :index, :add] |
5 | # before_filter :store_location, :only => [:join, :join_not_logged, :report_abuse, :send_mail] | 5 | # before_filter :store_location, :only => [:join, :join_not_logged, :report_abuse, :send_mail] |
6 | # before_filter :login_required, :only => [:add, :join, :join_not_logged, :leave, :unblock, :leave_scrap, :remove_scrap, :remove_activity, :view_more_activities, :view_more_network_activities, :report_abuse, :register_report, :leave_comment_on_activity, :send_mail] | 6 | # before_filter :login_required, :only => [:add, :join, :join_not_logged, :leave, :unblock, :leave_scrap, :remove_scrap, :remove_activity, :view_more_activities, :view_more_network_activities, :report_abuse, :register_report, :leave_comment_on_activity, :send_mail] |
7 | - | 7 | + |
8 | def send_email | 8 | def send_email |
9 | article = Article.find(params[:id]) | 9 | article = Article.find(params[:id]) |
10 | EmailArticlePluginMyprofileController::Sender.deliver_mail(article) | 10 | EmailArticlePluginMyprofileController::Sender.deliver_mail(article) |
11 | render :text=>'ok' | 11 | render :text=>'ok' |
12 | end | 12 | end |
13 | - | 13 | + |
14 | class Sender < ActionMailer::Base | 14 | class Sender < ActionMailer::Base |
15 | def mail(article) | 15 | def mail(article) |
16 | members = article.profile.members | 16 | members = article.profile.members |
17 | emails = [] | 17 | emails = [] |
18 | members.each{ |m| | 18 | members.each{ |m| |
19 | - emails.push(m.user.email) | 19 | + emails.push(m.user.email) |
20 | } | 20 | } |
21 | content_type 'text/html' | 21 | content_type 'text/html' |
22 | recipients emails | 22 | recipients emails |
@@ -25,6 +25,5 @@ class EmailArticlePluginMyprofileController < MyProfileController | @@ -25,6 +25,5 @@ class EmailArticlePluginMyprofileController < MyProfileController | ||
25 | subject "[Artigo] " + article.title | 25 | subject "[Artigo] " + article.title |
26 | body article.body | 26 | body article.body |
27 | end | 27 | end |
28 | - end | ||
29 | -end | ||
30 | - | 28 | + end |
29 | +end | ||
31 | \ No newline at end of file | 30 | \ No newline at end of file |
lib/email_article_plugin.rb
@@ -12,9 +12,9 @@ class EmailArticlePlugin < Noosfero::Plugin | @@ -12,9 +12,9 @@ class EmailArticlePlugin < Noosfero::Plugin | ||
12 | label = _("Send article to members") | 12 | label = _("Send article to members") |
13 | htmlclass = _("button with-text icon-menu-mail") | 13 | htmlclass = _("button with-text icon-menu-mail") |
14 | title = _("Email article to all community members") | 14 | title = _("Email article to all community members") |
15 | - lambda { | 15 | + lambda { |
16 | link_to_remote( | 16 | link_to_remote( |
17 | - label, | 17 | + label, |
18 | { | 18 | { |
19 | :url => { :controller => 'email_article_plugin_myprofile', :action => "send_email", :id => @page}, | 19 | :url => { :controller => 'email_article_plugin_myprofile', :action => "send_email", :id => @page}, |
20 | :method => :get, | 20 | :method => :get, |
@@ -22,12 +22,12 @@ class EmailArticlePlugin < Noosfero::Plugin | @@ -22,12 +22,12 @@ class EmailArticlePlugin < Noosfero::Plugin | ||
22 | :failure => "alert('Erro ao enviar email')", | 22 | :failure => "alert('Erro ao enviar email')", |
23 | :confirm => _("Are you sure you want to email this article to the all community members?"), | 23 | :confirm => _("Are you sure you want to email this article to the all community members?"), |
24 | }, | 24 | }, |
25 | - :class => htmlclass, | 25 | + :class => htmlclass, |
26 | :title => title | 26 | :title => title |
27 | ) | 27 | ) |
28 | } | 28 | } |
29 | end | 29 | end |
30 | - | 30 | + |
31 | def stylesheet? | 31 | def stylesheet? |
32 | true | 32 | true |
33 | end | 33 | end |
test/unit/email_article_plugin_test.rb
@@ -17,5 +17,5 @@ class EmailArticlePluginTest < ActiveSupport::TestCase | @@ -17,5 +17,5 @@ class EmailArticlePluginTest < ActiveSupport::TestCase | ||
17 | should 'have description' do | 17 | should 'have description' do |
18 | assert_equal _("A plugin that lists the most accessed, most commented, most liked and most disliked contents."), EmailArticlePlugin.plugin_description | 18 | assert_equal _("A plugin that lists the most accessed, most commented, most liked and most disliked contents."), EmailArticlePlugin.plugin_description |
19 | end | 19 | end |
20 | - | 20 | + |
21 | end | 21 | end |