_software_community.html.erb 2.87 KB
<h2><%= _('General information') %></h2>

  <%= required_fields_message %>

  <%= @plugins.dispatch(:profile_info_extra_contents).collect { |content| instance_exec(&content) }.join("") %>

<% 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 jQuery("#profile-data").find("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() {
       jQuery("#profile_data_identifier").val(jQuery("#old_profile_identifier").val());
       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? %>

<%= render :partial => 'moderation', :locals => { :profile => @profile } %>

<% if profile.enterprise? && profile.environment.enabled?('products_for_enterprises') %>
  <h2><%=_('Products/Services catalog')%></h2>
  <%= labelled_form_field(_('Number of products/services displayed per page on catalog'), text_field(:profile_data, :products_per_catalog_page, :size => 3)) %>
<% end %>