Commit 1fe29568d853971cd91fc65025d618cb6b43b05b
1 parent
175e64b7
Exists in
master
avoid juventud specific definition impact units tests
Showing
2 changed files
with
30 additions
and
17 deletions
Show diff stats
lib/ext/entities.rb
... | ... | @@ -5,7 +5,20 @@ module Noosfero |
5 | 5 | module Entities |
6 | 6 | |
7 | 7 | class Person < Profile |
8 | - expose :orientacao_sexual, :identidade_genero, :transgenero, :etnia, :points, :level, :gamification_plugin_level_percent | |
8 | + expose :orientacao_sexual, :identidade_genero, :transgenero, :etnia | |
9 | + | |
10 | + expose :points do |person, options| | |
11 | + person.points if person.respond_to?(:points) | |
12 | + end | |
13 | + | |
14 | + expose :level do |person, options| | |
15 | + person.level if person.respond_to?(:level) | |
16 | + end | |
17 | + | |
18 | + expose :gamification_plugin_level_percent do |person, options| | |
19 | + person.gamification_plugin_level_percent if person.respond_to?(:gamification_plugin_level_percent) | |
20 | + end | |
21 | + | |
9 | 22 | end |
10 | 23 | |
11 | 24 | end | ... | ... |
lib/juventude_plugin.rb
1 | 1 | class JuventudePlugin < Noosfero::Plugin |
2 | 2 | |
3 | - def self.plugin_name | |
4 | - _('Juventude custom plugin') | |
5 | - end | |
6 | - | |
7 | - def self.plugin_description | |
8 | - _("Provide a plugin to juventude environment.") | |
9 | - end | |
10 | - | |
11 | - def self.api_mount_points | |
12 | - [JuventudePlugin::API] | |
13 | - end | |
14 | - | |
15 | - def control_panel_buttons | |
16 | - {:title => _('Generate Report'), :icon => 'report', :url => {:controller => 'juventude_plugin_myprofile', :action => :send_report}, :html_options => {:class => 'admin-report'}} if context.send(:current_person).is_admin? | |
17 | - | |
18 | - end | |
3 | +# def self.plugin_name | |
4 | +# _('Juventude custom plugin') | |
5 | +# end | |
6 | +# | |
7 | +# def self.plugin_description | |
8 | +# _("Provide a plugin to juventude environment.") | |
9 | +# end | |
10 | +# | |
11 | +# def self.api_mount_points | |
12 | +# [JuventudePlugin::API] | |
13 | +# end | |
14 | +# | |
15 | +# def control_panel_buttons | |
16 | +# {:title => _('Generate Report'), :icon => 'report', :url => {:controller => 'juventude_plugin_myprofile', :action => :send_report}, :html_options => {:class => 'admin-report'}} if context.send(:current_person).is_admin? | |
17 | +# | |
18 | +# end | |
19 | 19 | |
20 | 20 | end | ... | ... |