Noosfero/noosfero

View on GitHub
app/views/profile_editor/privacy.html.erb

Summary

Maintainability
Test Coverage
<h1><%= _('%s\'s Privacy options').html_safe % profile.name %></h1>

<%= labelled_form_for :profile_data, :html => { :id => 'profile-data' } do |f| %>
  <%= content_tag('h2', _('Visibility')) %>

  <% if profile.organization? %>
    <%= labelled_check_box _("Secret &mdash; hide the group and all its contents for non members and other people can't join this community unless they are invited to.").html_safe, 'profile_data[secret]', true, profile.secret, :class => "profile-secret-box" %>
  <% end %>

  <%= content_tag('h2', _('Profile Access')) %>
  <%= content_tag( 'small', _('Who will be able to see your profile?')) %>
  <%= access_slider_field_tag('access', 'profile_data[access]', @profile, @profile.default_slider_value, @profile.access_levels) %>

  <%= content_tag('h2', _('Wall access')) %>
  <%= content_tag( 'small', _('Who will be able to see your wall?')) %>
  <%= access_slider_field_tag('wall-access', 'profile_data[wall_access]', @profile, @profile.default_slider_value('wall'), @profile.wall_access_levels) %>

  <%= content_tag('h2', _('Followers')) %>
  <div>
    <%= labelled_check_box _("Allow other users to follow me"), 'profile_data[allow_followers]', true, @profile.allow_followers?, :class => "person-can-be-followed" %>
  </div>

  <% if @profile.person? %>
    <%= render :partial => 'people_privacy' %>
   <% else %>
    <%= render :partial => 'organization_privacy' %>
   <% end %>

  <%= button_bar do %>
    <%= button(:back, _('Back to control panel'), controller: 'profile_editor') %>
    <%= submit_button('save', _('Save')) %>
  <% end %>
<% end %>

<%= javascript_include_tag 'profile_editor_privacy' %>