edit.rhtml 3.48 KB
<h1><%= _('Profile settings for %s') % profile.name %></h1>

<%= error_messages_for :profile %>

<% labelled_form_for :profile_data, @profile, :html => { :id => 'profile-data', :multipart => true } do |f| %>

  <% if user.has_permission?('manage_environment_templates', profile.environment) %>
    <div id="profile-is-template">
      <%= labelled_check_box(_('This profile is a template'), 'profile_data[is_template]', true, @profile.is_template) %>
    </div>
  <% end %>

  <%= render :partial => partial_for_class(@profile.class), :locals => { :f => f } %>

  <% unless @profile.person? && @environment.active_person_fields.include?('image') %>
  <div id="profile_change_picture">
    <h2><%= _('Change picture') %></h2>
    <% f.fields_for :image_builder, @profile.image do |i| %>
      <%= file_field_or_thumbnail(_('Image:'), @profile.image, i) %><%= _("Max size: %s (.jpg, .gif, .png)")% Image.max_size.to_humanreadable %>
    <% end %>
  </div>
  <% end %>

  <h2><%= _('Privacy options') %></h2>

  <% if profile.person? %>
    <div>
      <%= radio_button 'profile_data', 'public_profile', 'true' %>
      <%= content_tag('label', _('Public'), :for => 'profile_data_public_profile_true') %>
      &mdash; show my contents to all internet users
    </div>
    <div>
      <%= radio_button 'profile_data', 'public_profile', 'false' %>
      <%= content_tag('label', _('Private'), :for => 'profile_data_public_profile_false') %>
      &mdash; show my contents only to friends
    </div>
  <% else %>
  <table>
    <tr>
      <th style='text-align: right;'>
        <%= _('This profile is:') %>
      </th>
      <th>
        <%= radio_button 'profile_data', 'public_profile', 'true' %>
        <label for="profile_data_public_profile_true"><u><%= _('Public') %></u></label>
      </th>
      <th style='padding: 2px 10px 2px 2px;'>
        <%= radio_button 'profile_data', 'public_profile', 'false' %>
        <label for="profile_data_public_profile_false"><u><%= _('Private') %></u></label>
      </th>
    </tr>
    <tr>
      <td> <%= _('Activate Intranet access (restricted area only for members)') %> </td><td><%= _('Yes') %></td><td><%= _('Yes') %></td>
    </tr>
    <tr>
      <td> <%= _('Include this group directory of groups') %> </td><td><%= _('Yes') %></td><td><%= _('Yes') %></td>
    </tr>
    <tr>
      <td> <%= _('Show content of this group to all internet users') %> </td><td><%= _('Yes') %></td><td><%= _('No') %></td>
    </tr>
    <tr>
      <td> <%= _('Show content of this group to members') %> </td><td><%= _('Yes') %></td><td><%= _('Yes') %></td>
    </tr>
  </table>
  <% end %>

  <h2><%= _('Translations') %></h2>
  <%= labelled_check_box(
    _('Automaticaly redirect the visitor to the article translated to his/her language'),
    'profile_data[redirect_l10n]', true, @profile.redirect_l10n
  )%>

  <%=
    @plugins.dispatch(:profile_editor_extras).each do |content|
      content.respond_to?(:call) ? content.call : content
    end.join("\n")
  %>

  <%= select_categories(:profile_data, _('Select the categories of your interest'), 2) %>

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

  <% if user && user.has_permission?('destroy_profile', profile) %>
    <% button_bar(:id => 'delete-profile') do %>
      <%= button(:remove, _('Delete profile'), {:action => :destroy_profile}) %>
    <% end %>
  <% end %>


<% end %>

<%# = generate_form :info, @info, {...} %>