_profile_suggestions_list.html.erb 2.13 KB
<% if suggestions.empty? %>
  <p>
    <em>
      <%= _('You have no more suggestions :(') %>
    </em>
  </p>
<% else %>
  <ul class="profile-list">
    <% suggestions.each do |s| %>
      <li>
        <%= link_to_profile profile_image(s.suggestion, :minor) + '<br/>' + s.suggestion.short_name,
                            s.suggestion.identifier, :class => 'profile-link' %>
        <%= button_without_text :help, content_tag('span',_('info about suggestion')),
              '#',
              :class => 'explain-suggestion',
              :title => _('Why this suggestion?') %>
        <div class='extra_info' style='display:none'>
          <%= profile_suggestion_categories(s) %>
        </div>
        <div class="controll">
          <% if collection == :friends_suggestions %>
            <%= button_without_text :add, content_tag('span',_('add')),
                  s.suggestion.add_url,
                  :class => 'add-friend accept-suggestion',
                  :title => _('Add friend') %>
            <%= button_without_text :remove, content_tag('span',_('remove')),
                { :controller => 'friends', :action => 'remove_suggestion', :id => s.suggestion.identifier },
                  :class => 'remove-suggestion',
                  :title => _('Remove suggestion'),
                  :confirm => _('Are you sure you want to remove this suggestion?') %>
          <% elsif collection == :communities_suggestions %>
              <%= button_without_text :add, content_tag('span',_('join')),
                    s.suggestion.join_url,
                    :class => 'join-community accept-suggestion',
                    :title => _("Join %s") % s.suggestion.name %>
              <%= button_without_text :remove, content_tag('span',_('remove')),
                  { :action => 'remove_suggestion', :id => s.suggestion.identifier },
                    :class => 'remove-suggestion',
                    :title => _('Remove suggestion'),
                    :confirm => _('Are you sure you want to remove this suggestion?') %>
          <% end %>
        </div><!-- end class="controll" -->
      </li>
    <% end %>
  </ul>
<% end %>
<br style="clear:both" />