Commit f399a7146059ad30c417f79ed16c3b51e4f3f623
1 parent
042b68b9
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
right white spaces removed
Showing
5 changed files
with
16 additions
and
17 deletions
Show diff stats
app/views/content_viewer/_article_toolbar.rhtml
| @@ -37,7 +37,7 @@ | @@ -37,7 +37,7 @@ | ||
| 37 | <%= colorbox_button(:new, label_for_new_article(@page), profile.admin_url.merge(:controller => 'cms', :action => 'new', :parent_id => (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent)))) unless remove_content_button(:new) %> | 37 | <%= colorbox_button(:new, label_for_new_article(@page), profile.admin_url.merge(:controller => 'cms', :action => 'new', :parent_id => (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent)))) unless remove_content_button(:new) %> |
| 38 | <% end %> | 38 | <% end %> |
| 39 | 39 | ||
| 40 | - <% | 40 | + <% |
| 41 | @plugins.dispatch(:article_toolbar_extra_buttons).each do |plugin_button| %> | 41 | @plugins.dispatch(:article_toolbar_extra_buttons).each do |plugin_button| %> |
| 42 | <%= instance_eval(&plugin_button) %> | 42 | <%= instance_eval(&plugin_button) %> |
| 43 | <% end %> | 43 | <% end %> |
lib/noosfero/plugin.rb
| @@ -285,7 +285,7 @@ class Noosfero::Plugin | @@ -285,7 +285,7 @@ class Noosfero::Plugin | ||
| 285 | nil | 285 | nil |
| 286 | end | 286 | end |
| 287 | 287 | ||
| 288 | - | 288 | + |
| 289 | # -> Adds buttons to manage members page | 289 | # -> Adds buttons to manage members page |
| 290 | # returns = { :title => title, :icon => icon, :url => url } | 290 | # returns = { :title => title, :icon => icon, :url => url } |
| 291 | # title = name that will be displayed. | 291 | # title = name that will be displayed. |
| @@ -293,9 +293,9 @@ class Noosfero::Plugin | @@ -293,9 +293,9 @@ class Noosfero::Plugin | ||
| 293 | # url = url or route to which the button will redirect. | 293 | # url = url or route to which the button will redirect. |
| 294 | def article_toolbar_extra_buttons | 294 | def article_toolbar_extra_buttons |
| 295 | nil | 295 | nil |
| 296 | - end | ||
| 297 | - | ||
| 298 | - | 296 | + end |
| 297 | + | ||
| 298 | + | ||
| 299 | # This method will be called just before a comment is saved to the database. | 299 | # This method will be called just before a comment is saved to the database. |
| 300 | # | 300 | # |
| 301 | # It can modify the comment in several ways. In special, a plugin can call | 301 | # It can modify the comment in several ways. In special, a plugin can call |
| @@ -582,6 +582,6 @@ class Noosfero::Plugin | @@ -582,6 +582,6 @@ class Noosfero::Plugin | ||
| 582 | #content_expire too. | 582 | #content_expire too. |
| 583 | %w[edit delete spread locale suggest home new upload] | 583 | %w[edit delete spread locale suggest home new upload] |
| 584 | end | 584 | end |
| 585 | - | 585 | + |
| 586 | 586 | ||
| 587 | end | 587 | end |
plugins/email_article/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 |
plugins/email_article/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 |
plugins/email_article/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 |