<% if @wizard %> <%= render :partial => 'account/wizard_steps'%> <% end %>

<%= __('Invite your friends') %>

<% unless @friends %> <% if !@wizard %>

<%= __('Step 1 of 1: Select address book') %>

<% end %> <% form_tag do %> <%= hidden_field_tag(:import, 1) %> <%= hidden_field_tag(:wizard, @wizard) %> <%= [ radio_button_tag(:import_from, "manual", @import_from == "manual", :onclick => 'hide_invite_friend_login_password()') + content_tag('label', __('Manually (empty field)'), :for => "import_from_manual"), radio_button_tag(:import_from, "gmail", @import_from == "gmail", :onclick => 'show_invite_friend_login_password()') + content_tag('label', 'Gmail', :for => 'import_from_gmail'), radio_button_tag(:import_from, "yahoo", @import_from == "yahoo", :onclick => 'show_invite_friend_login_password()') + content_tag('label', 'Yahoo', :for => "import_from_yahoo"), radio_button_tag(:import_from, "hotmail", @import_from == "hotmail", :onclick => 'show_invite_friend_login_password()') + content_tag('label', 'Hotmail', :for => "import_from_hotmail") ].join("\n
\n") %>
> <%= labelled_form_field(__("Username") + ":", text_field_tag(:login, @login)) %> <%= labelled_form_field(__("Password") + ":", password_field_tag(:password)) %>
<% button_bar do %> <%= submit_button(:forward, __("Next")) %> <% end %>

<%= __("We won't store your password or contact anyone without your permission.")%>

<% end %> <% else %> <% if !@wizard %>

<%= __('Step 2 of 2: Selecting Friends') %>

<% end %>

<%= __('Indicate which friends you want to invite.') %>

<% if @wizard && @import_from == 'manual' %>
<%= __('Import now your contacts from %s, %s or %s') % [link_to_import('GMail', :import_from => 'gmail'), link_to_import('Yahoo', :import_from => 'yahoo'), link_to_import('Hotmail', :import_from => 'hotmail')] %>
<%= _('or') %>
<% end %> <% form_tag do %> <%= hidden_field_tag(:confirmation, 1) %> <%= hidden_field_tag(:import_from, @import_from) %> <%= hidden_field_tag(:wizard, @wizard) %>
<%= __('Enter one e-mail address per line:') %> <%= text_area_tag(:manual_import_addresses, (@manual_import_addresses || ''), :cols => 72, :rows => 5) %>
<% if @import_from != 'manual' %>
<%= link_to_function __('Check all'), "$$('input.friend_to_invite').each(function(checkbox) { checkbox.checked = true; });" %> <%= link_to_function __('Uncheck all'), "$$('input.friend_to_invite').each(function(checkbox) { checkbox.checked = false; });" %> <% friend_pos = 0 %>
<% @friends.each do |friend| %> <% friend_pos += 1 %>

<%= hidden_field_tag("webmail_friends[]", friend.to_yaml) %> <%= check_box_tag("webmail_import_addresses[]", friend[2], (!@webmail_import_addresses || @webmail_import_addresses.include?(friend[2])), :id => "friends_to_invite_#{friend_pos}", :class => "friend_to_invite" ) %>

<% end %>
<% end -%>
<%= link_to_function(_('Personalize invitation message'), nil) do |page| page['invitation-message'].show end %> <% button_bar do %> <%= submit_button(:ok, __("Invite my friends!")) %> <% end %> <% end %> <% end %>