edit_software_community.html.erb 3.64 KB

<%= render :partial => 'first_edit_software_community_extras', :locals => {:class_step_one => "another-step", :class_step_two => "current-step"} if @first_edit %>

<h1><%= _('Configure Software Community') %></h1>

<div class='step-explanation'>
  <spam>
    <%= _('Set the basic settings of the software associated community') %>
  </spam>
</div>

<%= javascript_include_tag 'deactivate_profile' %>
<%= error_messages_for :profile_data %>

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

  <% if environment.admins.include?(user) %>
    <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 => 'software_community', :locals => { :f => f } %>

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

  <% if profile.person? %>
    <div>
      <%= labelled_radio_button _('Public &mdash; show my contents to all internet users'), 'profile_data[public_profile]', true, @profile.public_profile? %>
    </div>
    <div>
      <%= labelled_radio_button _('Private &mdash; show my contents only to friends'), 'profile_data[public_profile]', false, !@profile.public_profile? %>
    </div>
  <% else %>
    <div>
      <%= labelled_radio_button _('Public &mdash; show content of this group to all internet users'), 'profile_data[public_profile]', true, @profile.public_profile? %>
    </div>
    <div>
      <%= labelled_radio_button _('Private &mdash; show content of this group only to members'), 'profile_data[public_profile]', false, !@profile.public_profile? %>
    </div>
  <% end %>

  <% if environment.enabled?('allow_change_of_redirection_after_login') %>
    <h2><%= _('Page to redirect after login') %></h2>
    <%=  select 'profile_data', 'redirection_after_login', Environment.login_redirection_options.map{|key,value|[value,key]}, { :selected => @profile.preferred_login_redirection} %>
  <% 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
  )%>

  <h2><%= _('Suggestions') %></h2>
  <%= labelled_check_box(
    _('Send me relationship suggestions by email'),
    'profile_data[email_suggestions]', true, @profile.email_suggestions
  )%>

  <%=
    @plugins.dispatch(:profile_editor_extras).map do |content|
      content.kind_of?(Proc) ? self.instance_exec(&content) : content
    end.join("\n")
  %>

  <%= select_categories(:profile_data, _('Software Categories'), 2) %>

  <% button_bar do %>
    <%= submit_button('save', _('Save'), :cancel => {:action => 'index'}) %>

    <% unless @first_edit %>
      <%= button(:back, _('Back to control panel'), :controller => 'profile_editor') %>
    <% end %>
  <% end %>

  <% if user && user.has_permission?('destroy_profile', profile) && !@first_edit %>
    <% button_bar(:id => 'delete-profile') do %>
      <%= button(:remove, _('Delete software and community'), {:action => :destroy_profile}) %>
      <% if environment.admins.include?(current_person) %>
        <% if profile.visible? %>
          <%= button(:remove, _('Deactivate software and community'), {:action => :deactivate_profile, :id=>profile.id}, :id=>'deactivate_profile_button', :data => {:confirm=>_("Are you sure you want to deactivate this profile?")}) %>
        <% else %>
          <%= button(:add, _('Activate software and community'), {:action => :activate_profile, :id=>profile.id}, :data => {:confirm=>_("Are you sure you want to deactivate this profile?")}) %>
        <% end %>
      <% end %>
    <% end %>
  <% end %>
<% end %>