<% if profile.person? %>

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

<% else %>

<%= _('Invite your friends to join %s') % profile.name %>

<% end %> <% unless @contacts %>

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

<% form_tag do %> <%= hidden_field_tag(:step, 1) %> <%= [ 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 %>

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

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

<% form_tag do %> <%= hidden_field_tag(:step, 2) %> <%= hidden_field_tag(:import_from, @import_from) %>
<%= labelled_form_field(_('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.contact_to_invite').each(function(checkbox) { checkbox.checked = true; });" %> <%= link_to_function _('Uncheck all'), "$$('input.contact_to_invite').each(function(checkbox) { checkbox.checked = false; });" %> <% friend_pos = 0 %>
<% @contacts.each do |contact| %> <% friend_pos += 1 %>

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

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