% 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 %>
<% 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 %>
<% end %>