Commit 04705f4addcf4159df609353f407f119c7628350
1 parent
3bac6b6b
Exists in
master
adding membro_conselho field
Showing
4 changed files
with
14 additions
and
4 deletions
Show diff stats
lib/ext/entities.rb
| ... | ... | @@ -5,7 +5,7 @@ module Noosfero |
| 5 | 5 | module Entities |
| 6 | 6 | |
| 7 | 7 | class Person < Profile |
| 8 | - expose :orientacao_sexual, :identidade_genero, :transgenero, :etnia | |
| 8 | + expose :orientacao_sexual, :identidade_genero, :transgenero, :etnia, :membro_conselho | |
| 9 | 9 | |
| 10 | 10 | expose :points do |person, options| |
| 11 | 11 | person.points if person.respond_to?(:points) | ... | ... |
lib/ext/environment.rb
| ... | ... | @@ -10,6 +10,7 @@ class Environment |
| 10 | 10 | orig_custom_person_fields.merge!({'transgenero' => {"active"=>"true", "required"=>"false", "signup"=>"true"}}) |
| 11 | 11 | orig_custom_person_fields.merge!({'etnia' => {"active"=>"true", "required"=>"false", "signup"=>"true"}}) |
| 12 | 12 | orig_custom_person_fields.merge!({'city' => {"active"=>"true", "required"=>"false", "signup"=>"true"}}) |
| 13 | + orig_custom_person_fields.merge!({'membro_conselho' => {"active"=>"true", "required"=>"false", "signup"=>"true"}}) | |
| 13 | 14 | orig_custom_person_fields |
| 14 | 15 | end |
| 15 | 16 | ... | ... |
lib/ext/person.rb
| ... | ... | @@ -2,9 +2,9 @@ require_dependency 'person' |
| 2 | 2 | |
| 3 | 3 | class Person |
| 4 | 4 | |
| 5 | - settings_items :orientacao_sexual, :identidade_genero, :transgenero, :tipo, :etnia | |
| 5 | + settings_items :orientacao_sexual, :identidade_genero, :transgenero, :tipo, :etnia, :membro_conselho | |
| 6 | 6 | |
| 7 | - attr_accessible :orientacao_sexual, :identidade_genero, :transgenero, :tipo, :etnia | |
| 7 | + attr_accessible :orientacao_sexual, :identidade_genero, :transgenero, :tipo, :etnia, :membro_conselho | |
| 8 | 8 | |
| 9 | 9 | def is_profile_complete? |
| 10 | 10 | #FIXME: this check is hardcoded to satisfy a temporary issue. |
| ... | ... | @@ -14,7 +14,7 @@ class Person |
| 14 | 14 | self.data[:etnia].blank? or |
| 15 | 15 | self.data[:orientacao_sexual].blank? or |
| 16 | 16 | self.data[:state].blank? or |
| 17 | - self.data[:city].blank?) | |
| 17 | + self.data[:city].blank? or self.data[:membro_conselho].blank?) | |
| 18 | 18 | end |
| 19 | 19 | |
| 20 | 20 | def conference_comments | ... | ... |
lib/ext/user.rb
| ... | ... | @@ -50,4 +50,13 @@ class User |
| 50 | 50 | def category_ids= categories |
| 51 | 51 | self.person_data[:category_ids] = categories |
| 52 | 52 | end |
| 53 | + | |
| 54 | + def membro_conselho | |
| 55 | + self.person.membro_conselho unless self.person.nil? | |
| 56 | + end | |
| 57 | + | |
| 58 | + def membro_conselho= value | |
| 59 | + self.person_data[:membro_conselho] = value | |
| 60 | + end | |
| 61 | + | |
| 53 | 62 | end | ... | ... |