Commit d9da79bc6f3937f7599a4734a128481cf1897028
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Merge branch 'I257-option_to_hide_community' into stable
Showing
4 changed files
with
6 additions
and
1 deletions
Show diff stats
app/controllers/my_profile/profile_editor_controller.rb
| @@ -21,6 +21,7 @@ class ProfileEditorController < MyProfileController | @@ -21,6 +21,7 @@ class ProfileEditorController < MyProfileController | ||
| 21 | Profile.transaction do | 21 | Profile.transaction do |
| 22 | Image.transaction do | 22 | Image.transaction do |
| 23 | begin | 23 | begin |
| 24 | + params[:profile_data][:visible] = params[:profile_data][:visible] == '0' | ||
| 24 | @plugins.dispatch(:profile_editor_transaction_extras) | 25 | @plugins.dispatch(:profile_editor_transaction_extras) |
| 25 | @profile_data.update_attributes!(params[:profile_data]) | 26 | @profile_data.update_attributes!(params[:profile_data]) |
| 26 | redirect_to :action => 'index', :profile => profile.identifier | 27 | redirect_to :action => 'index', :profile => profile.identifier |
app/models/community.rb
| 1 | class Community < Organization | 1 | class Community < Organization |
| 2 | 2 | ||
| 3 | - attr_accessible :accessor_id, :accessor_type, :role_id, :resource_id, :resource_type, :address_reference, :district, :tag_list, :language | 3 | + attr_accessible :accessor_id, :accessor_type, :role_id, :resource_id, :resource_type, :address_reference, :district, :tag_list, :language, :visible |
| 4 | after_destroy :check_invite_member_for_destroy | 4 | after_destroy :check_invite_member_for_destroy |
| 5 | 5 | ||
| 6 | def self.type_name | 6 | def self.type_name |
app/views/profile_editor/edit.html.erb
| @@ -32,6 +32,9 @@ | @@ -32,6 +32,9 @@ | ||
| 32 | <%= labelled_radio_button _('Private — show my contents only to friends'), 'profile_data[public_profile]', false, !@profile.public_profile? %> | 32 | <%= labelled_radio_button _('Private — show my contents only to friends'), 'profile_data[public_profile]', false, !@profile.public_profile? %> |
| 33 | </div> | 33 | </div> |
| 34 | <% else %> | 34 | <% else %> |
| 35 | + <div style="border-bottom: 1px solid #e0e0e0; padding-bottom: 7px; margin-bottom: 7px;"> | ||
| 36 | + <%= labelled_check_box _('Hidden — this group will be visible only by members'), 'profile_data[visible]', false, !@profile.visible %> | ||
| 37 | + </div> | ||
| 35 | <div> | 38 | <div> |
| 36 | <%= labelled_radio_button _('Public — show content of this group to all internet users'), 'profile_data[public_profile]', true, @profile.public_profile? %> | 39 | <%= labelled_radio_button _('Public — show content of this group to all internet users'), 'profile_data[public_profile]', true, @profile.public_profile? %> |
| 37 | </div> | 40 | </div> |
script/updatepo/data/pt.upo
| @@ -83,3 +83,4 @@ msgid "Most Recent"# msgstr "Mais Recentes" | @@ -83,3 +83,4 @@ msgid "Most Recent"# msgstr "Mais Recentes" | ||
| 83 | msgid "Order"# msgstr "Ordenação" | 83 | msgid "Order"# msgstr "Ordenação" |
| 84 | msgid "For community admins or specific users"# msgstr "Para administradores da comunidade ou usuários específicos" | 84 | msgid "For community admins or specific users"# msgstr "Para administradores da comunidade ou usuários específicos" |
| 85 | msgid "For all community members"# msgstr "Para todos os usuários da comunidade" | 85 | msgid "For all community members"# msgstr "Para todos os usuários da comunidade" |
| 86 | +msgid "Hidden — this group will be visible only by members"# msgstr "Oculto — este grupo será visível apenas por membros" |