Commit 3b01694507955c464791d64143a5533de1f2d341

Authored by Evandro Junior
1 parent 84b066e0
Exists in master

need design fix

controllers/email_article_plugin_myprofile_controller.rb
... ... @@ -4,26 +4,16 @@ 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   -
8   -# self.members
9   -
10   -
11 7  
12 8 def send_email
13 9  
14   - puts "ID ***************************"
15   - y params[:id]
16   - puts "END ID ***************************"
  10 +# puts "ID ***************************"
  11 +# y params[:id]
  12 +# puts "END ID ***************************"
17 13  
18 14 profile = Profile[params[:profile]]
19 15 article = Article.find(params[:id])
20   - session[:notice] = 'Tudo beleza'
21 16 EmailArticlePluginMyprofileController::Sender.deliver_mail(article)
22   -#
23   -# puts "########################params[:mailing]########################"
24   -# y params[:mailing]
25   -# raise
26   -#
27 17 end
28 18  
29 19  
... ... @@ -49,7 +39,6 @@ class EmailArticlePluginMyprofileController < MyProfileController
49 39 # end
50 40 subject "[Artigo] " + article.title
51 41 body article.body
52   -
53 42 end
54 43 end
55 44  
... ...
lib/email_article_plugin.rb
... ... @@ -12,7 +12,9 @@ class EmailArticlePlugin < Noosfero::Plugin
12 12 lambda {
13 13 link_to_remote(_("Email article to members"),
14 14 {:url => { :controller => 'email_article_plugin_myprofile', :action => "send_email", :id => @page},
15   - :method => :get
  15 + :method => :get,
  16 + :success => "alert('Emails enviados')",
  17 + :failure => "alert('Erro ao enviar email')"
16 18 # , :loading => "Enviando emails"
17 19 })
18 20 }
... ...