diff --git a/app/helpers/profile_helper.rb b/app/helpers/profile_helper.rb index 014968d..16b1d34 100644 --- a/app/helpers/profile_helper.rb +++ b/app/helpers/profile_helper.rb @@ -51,9 +51,10 @@ module ProfileHelper def display_custom_fields(profile) fields = [] profile.custom_fields.each { |custom_field_key,custom_field_data| - fields << display_custom_field(custom_field_data[:title], profile, custom_field_key) + if !profile.fields_privacy.blank? && profile.fields_privacy.include?(custom_field_key) + fields << display_custom_field(custom_field_data[:title], profile, custom_field_key) if profile.fields_privacy[custom_field_key] == 'public' + end } - fields.reject!(&:blank?) fields.size >= 1 ? content_tag('tr', content_tag('th', _('Custom Fields'), { :colspan => 2 })) + fields.join.html_safe : '' end diff --git a/app/views/profile_editor/_person_form.html.erb b/app/views/profile_editor/_person_form.html.erb index 39f66a9..a503623 100644 --- a/app/views/profile_editor/_person_form.html.erb +++ b/app/views/profile_editor/_person_form.html.erb @@ -114,24 +114,50 @@ <% template_custom_fields.each { |key,value| %> -