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 | 4 | # before_filter :check_access_to_profile, :except => [:join, :join_not_logged, :index, :add] |
5 | 5 | # before_filter :store_location, :only => [:join, :join_not_logged, :report_abuse, :send_mail] |
6 | 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 | 8 | def send_email |
9 | 9 | article = Article.find(params[:id]) |
10 | 10 | EmailArticlePluginMyprofileController::Sender.deliver_mail(article) |
11 | 11 | render :text=>'ok' |
12 | 12 | end |
13 | - | |
13 | + | |
14 | 14 | class Sender < ActionMailer::Base |
15 | 15 | def mail(article) |
16 | 16 | members = article.profile.members |
17 | 17 | emails = [] |
18 | 18 | members.each{ |m| |
19 | - emails.push(m.user.email) | |
19 | + emails.push(m.user.email) | |
20 | 20 | } |
21 | 21 | content_type 'text/html' |
22 | 22 | recipients emails |
... | ... | @@ -25,6 +25,5 @@ class EmailArticlePluginMyprofileController < MyProfileController |
25 | 25 | subject "[Artigo] " + article.title |
26 | 26 | body article.body |
27 | 27 | end |
28 | - end | |
29 | -end | |
30 | - | |
28 | + end | |
29 | +end | |
31 | 30 | \ No newline at end of file | ... | ... |
lib/email_article_plugin.rb
... | ... | @@ -12,9 +12,9 @@ class EmailArticlePlugin < Noosfero::Plugin |
12 | 12 | label = _("Send article to members") |
13 | 13 | htmlclass = _("button with-text icon-menu-mail") |
14 | 14 | title = _("Email article to all community members") |
15 | - lambda { | |
15 | + lambda { | |
16 | 16 | link_to_remote( |
17 | - label, | |
17 | + label, | |
18 | 18 | { |
19 | 19 | :url => { :controller => 'email_article_plugin_myprofile', :action => "send_email", :id => @page}, |
20 | 20 | :method => :get, |
... | ... | @@ -22,12 +22,12 @@ class EmailArticlePlugin < Noosfero::Plugin |
22 | 22 | :failure => "alert('Erro ao enviar email')", |
23 | 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 | 26 | :title => title |
27 | 27 | ) |
28 | 28 | } |
29 | 29 | end |
30 | - | |
30 | + | |
31 | 31 | def stylesheet? |
32 | 32 | true |
33 | 33 | end | ... | ... |
test/unit/email_article_plugin_test.rb
... | ... | @@ -17,5 +17,5 @@ class EmailArticlePluginTest < ActiveSupport::TestCase |
17 | 17 | should 'have description' do |
18 | 18 | assert_equal _("A plugin that lists the most accessed, most commented, most liked and most disliked contents."), EmailArticlePlugin.plugin_description |
19 | 19 | end |
20 | - | |
20 | + | |
21 | 21 | end | ... | ... |