_organization.rhtml 4.01 KB
<h2><%= _('General information') %></h2>

  <%= required_fields_message %>

  <%= required f.text_field(:name) %>

<% if @environment.enabled?('enable_organization_url_change') %>
  <script type="text/javascript">
    function updateUrlField(name_field, id) {
      url_field = $(id);
      url_field.value = convToValidIdentifier(name_field.value, "-");
      warn_value_change(url_field);
    }
  </script>
<% end %>

<% if @environment.enabled?('enable_organization_url_change') %>
  <script type="text/javascript">
    function submit_button() {
       return $("profile_data_identifier").form.select("input.submit")[0];
    }
    function warn_value_change() {
       show_warning('profile-identifier-formitem', "identifier-change-confirmation");
       disable_button(submit_button());
    }
    function confirm_change() {
       enable_button(submit_button());
       hide_warning('identifier-change-confirmation');
    }
    function no_change() {
       $("profile_data_identifier").value = $("old_profile_identifier").value;
       enable_button(submit_button());
       hide_warning('identifier-change-confirmation');
    }

  </script>

    <%= hidden_field_tag 'old_profile_identifier', @profile.identifier %>
    <div id="profile-identifier-formitem">
      <%= required labelled_form_field( _('Address'),
            content_tag('code',
              url_for(profile.url).gsub(/#{profile.identifier}$/, '') +
              text_field(:profile_data, :identifier, :onchange => "warn_value_change()", :size => 25)
            ) +
            content_tag('div',
              content_tag('strong', _('WARNING!')) + '&nbsp;' +
                _("You are about to change the address, and this will break external links to the homepage or to content inside it. Do you really want to change?") +
              content_tag('div',
                button_to_function(:ok, _("Yes"), "confirm_change()") + ' ' +
                button_to_function(:cancel, _('No'), 'no_change()')
              ),
              :id => 'identifier-change-confirmation',
              :class => 'change-confirmation',
              :style => 'display: none;'
            )
          )
      %>
    </div>
<% end %>

  <%= render :partial => 'shared/organization_custom_fields', :locals => { :f => f, :object_name => 'profile_data', :profile => @profile } %>

  <%= labelled_check_box(_('Enable "contact us"'), 'profile_data[enable_contact_us]', "1", @profile.enable_contact_us) if @profile.enterprise? %>

  <h1><%= _('Moderation options') %></h1>
  <% if profile.community? %>
    <div style='margin-bottom: 1em'>
    <%= _('New members must be approved:')%>
    </div>
    <div style='margin-bottom: 0.5em'>
      <%= radio_button 'profile_data', 'closed', 'true', :style => 'float: left' %>
      <div style='margin-left: 30px'>
        <%= _('<strong>Before</strong> joining this group (a moderator has to accept the member in pending request before member can access the intranet and/or the website).') %>
      </div>
    </div>
    <div>
      <%= radio_button 'profile_data', 'closed', 'false', :style => 'float: left' %>
      <div style='margin-left: 30px'>
        <%= _('<strong>After</strong> joining this group (a moderator can always desactivate access for users later).') %>
      </div>
    </div>
    <br>
  <% end %>
  <div style='margin-bottom: 1em'>
  <%= _('New articles posted by members of this group must be approved:')%>

  </div>
  <div style='margin-bottom: 0.5em'>
    <%= radio_button 'profile_data', 'moderated_articles', 'true', :style => 'float: left' %>
    <div style='margin-left: 30px'>
      <%= _('<strong>Before</strong> being published in this group (a moderator has to accept the article in pending request before the article be listed as a article of this group).') %>
    </div>
  </div>
  <div>
    <%= radio_button 'profile_data', 'moderated_articles', 'false', :style => 'float: left' %>
    <div style='margin-left: 30px'>
      <%= _('<strong>After</strong> being published in this group (a moderator can always remove publicated articles later).') %>
    </div>
  </div>