friend finder has invite buttons and aspect dropdowns

This commit is contained in:
zhitomirskiyi 2011-01-26 12:43:30 -08:00
parent 89a8817ce6
commit ab41a5f24a
3 changed files with 11 additions and 7 deletions

View file

@ -17,7 +17,6 @@ class ApplicationController < ActionController::Base
@aspect = nil @aspect = nil
@object_aspect_ids = [] @object_aspect_ids = []
@all_aspects = current_user.aspects.includes(:aspect_memberships) @all_aspects = current_user.aspects.includes(:aspect_memberships)
@aspects_dropdown_array = @all_aspects.collect{|x| [x.to_s, x.id]}
@notification_count = Notification.for(current_user, :unread =>true).count @notification_count = Notification.for(current_user, :unread =>true).count
end end
end end

View file

@ -24,10 +24,8 @@
%h4 %h4
= t('.aspect') = t('.aspect')
- unless @aspect.is_a? Aspect = invite.select(:aspects, options_from_collection_for_select(@all_aspects, 'id', 'name'))
= invite.select(:aspects, @aspects_dropdown_array)
- else
= invite.select(:aspects, @aspects_dropdown_array, :selected => @aspect.id)
%br %br
%br %br

View file

@ -9,11 +9,12 @@
%h3 %h3
Facebook friend finder Facebook friend finder
.span-10.prepend-7 .span-12.prepend-6
.contact_list .contact_list
= search_field_tag :contact_search, "", :class => 'contact_list_search', :results => 5, :placeholder => t('shared.contact_list.all_contacts') = search_field_tag :contact_search, "", :class => 'contact_list_search', :results => 5, :placeholder => t('shared.contact_list.all_contacts')
%ul %ul
- for friend in @friends.values - for uid in @friends.keys
- friend = @friends[uid]
%li %li
.right .right
-if friend[:contact] && !friend[:contact].pending -if friend[:contact] && !friend[:contact].pending
@ -27,6 +28,12 @@
:id => friend[:person].id}, :id => friend[:person].id},
:class => 'button', :class => 'button',
:rel => 'facebox' :rel => 'facebox'
- else
= form_tag service_inviter_path do
= select_tag (:aspect_id, options_from_collection_for_select(@all_aspects, 'id', 'name'))
= hidden_field_tag :uid, uid
= hidden_field_tag :provider, 'facebook'
= submit_tag "invite"
- if friend[:person] - if friend[:person]
= person_image_link(friend[:person]) = person_image_link(friend[:person])