%= render :partial => 'invite/dialog_wait_loading', :locals => {:contact_list => @contact_list.id } if @import_from != 'manual' %>
<% if profile.person? %>
<%= _('Invite your friends') %>
<% else %>
<%= _('Invite your friends to join %s') % profile.name %>
<% end %>
<%= _('Step 2 of 2: Selecting Friends') %>
<%= button(:back, _('Back'), { :action => 'select_address_book' }, :id => 'invitation_back_button') %>
<%= _('Indicate which friends you want to invite.') %>
<% form_tag do %>
<%= hidden_field_tag(:import_from, @import_from) %>
<%= hidden_field_tag(:contact_list, @contact_list.id) %>
<%= labelled_form_field(_('Enter one e-mail address per line:'), text_area_tag(:manual_import_addresses, (@manual_import_addresses || ''), :rows => 5, :style => 'width: 98%;')) %>
<% if @import_from != 'manual' %>
<%= link_to_function _('Check all'), "$$('input.contact_to_invite').each(function(checkbox) { checkbox.checked = true; });" %>
<%= link_to_function _('Uncheck all'), "$$('input.contact_to_invite').each(function(checkbox) { checkbox.checked = false; });" %>
<% end -%>
<%= link_to_function(_('Personalize invitation mail'), nil) do |page|
page['invitation-mail_template'].show
end %>
<%= h _("Now enter an invitation message. You must keep the code in your invitation text. When your friends receive the invitation e-mail, will be replaced by a link that they need to click to activate their account. and codes will be replaced by your name and friend name, but they are optional.") %>
<%= labelled_form_field(_('Invitation text:'), text_area_tag(:mail_template, @mail_template, :cols => 72, :rows => 8)) %>
<% button_bar do %>
<%= submit_button(:ok, _("Invite my friends!")) %>
<% end %>
<% end %>