%= error_messages_for 'create_enterprise' %>
<%= __('Enterprise registration') %>
<% if @validation == :region && @regions.empty? %>
<%= __('There are no validators to validate the registration of this new enterprise. Contact your administrator for instructions.') %>
<% button_bar do %>
<%= button :back, _('Go back'), { :profile => current_user.person.identifier, :action=>"enterprises", :controller=>"profile" }%>
<% end %>
<% else %>
<%= __('To register a new enterprise, fill in the form and hit the Register button. Then the enterprise will be submitted for evaluation at the validation entitiy of your choice (within your state) and when the enterprise is aproved you will be able to activate its profile.') %>
<%= required_fields_message %>
<% labelled_form_for(:create_enterprise, @create_enterprise) do |f| %>
<%= required f.text_field 'name', :onchange => "updateUrlField(this, 'create_enterprise_identifier')", :size => 40 %>
<%= required labelled_form_field(_('Address'), content_tag('code', environment.top_url + "/" + text_field(:create_enterprise, 'identifier', :size => 26))) %>
<%= render :partial => 'shared/organization_custom_fields', :locals => { :f => f, :object_name => :create_enterprise, :profile => @create_enterprise } %>
<%= required labelled_form_field(_('Region'), f.select('region_id', @regions)) if @validation == :region %>
<% if @validation == :admin %>
<%= hidden_field_tag 'create_enterprise[target_id]', environment.id %>
<% end %>
<% button_bar do %>
<%= submit_button('next', _('Next'), :cancel => {:profile => current_user.person.identifier, :action=>"enterprises", :controller=>"profile"}) %>
<% end %>
<% end %>
<% end %>