_add_friend.rhtml 1.63 KB
<h2><%= _('New friend')  %></h2>

<%= link_to( profile_image(task.requestor, :minor, :border => 0), task.requestor.public_profile_url ) %>

<%= _('%s wants to connect to you as a friend.') %
    content_tag('strong', link_to( task.requestor.name, task.requestor.public_profile_url ) ) %>

<% form_for('task', task, :url => { :action => 'close', :id => task.id } ) do |f| %>

  <div>

    <%= radio_button_tag(:decision, 'finish', true,
        :id => "decision-finish-#{task.id}",
        :onclick => "Element.show('group-for-friend-#{task.id}')") %>
    <label for="<%= "decision-finish-#{task.id}" %>"><b><%= _('Accept') %></b></label>

    &nbsp; &nbsp;

    <%= radio_button_tag(:decision, 'cancel', false,
        :id => "decision-cancel-#{task.id}",
        :onclick => "Element.hide('group-for-friend-#{task.id}')") %>
    <label for="<%= "decision-cancel-#{task.id}" %>"><b><%= _('Ignore') %></b></label>

    <%
      content_tag('div', :id => "group-for-friend-#{task.id}",
                  :help => _('You can type the first letters of an existing group and have the system present you the available options, or you can type the name of a new group if you want.'))              do %>
        <%= _('Classify your new friend:') %>
        <%= text_field_with_local_autocomplete("task[group_for_friend]",
            profile.suggested_friend_groups,
            :id => "field-group-for-friend-#{task.id}") %>
      <p class="friend-classify-suggestions">
      <%= _('Suggestions: %s') % profile.suggested_friend_groups.join(', ') %>
      </p>

    <% end %>
  </div>

  <% button_bar do %>
    <%= submit_button(:ok, _('Ok!')) %>
  <% end %>
<% end %>