Move Facebook inviter view into the contacts layout, rather than a facebox

This commit is contained in:
danielgrippi 2011-08-12 15:40:04 -07:00
parent 7b85dcec9c
commit a8d37fb3fc
6 changed files with 49 additions and 39 deletions

View file

@ -47,7 +47,7 @@ class ServicesController < ApplicationController
def finder def finder
service = current_user.services.where(:type => "Services::#{params[:provider].titleize}").first service = current_user.services.where(:type => "Services::#{params[:provider].titleize}").first
@friends = service ? service.finder(:remote => params[:remote]) : [] @friends = service ? service.finder(:remote => params[:remote]) : []
render :layout => false # render :layout => false
end end
def inviter def inviter

View file

@ -5,27 +5,49 @@
- content_for :head do - content_for :head do
= include_javascripts :finder = include_javascripts :finder
#aspect_edit_pane.larger.friend_finder #section_header
#facebox_header %h2
%h4 = t('contacts.index.title')
= t('.invite_your_friends_from', :service => params[:provider].titleize)
.description
- if @friends.size > 0
= t('.friends', :count => @friends.size)
- else
%i= t('.not_connected')
= render 'shared/contact_sidebar'
.contact_list .span-18.last
%h3
= t('.service_friends', :service => params[:provider].titleize)
#people_stream.stream.contacts
- if @friends.size > 0 - if @friends.size > 0
= render :partial => 'services/finder', :locals => {:friends => @friends} - for friend in @friends
.stream_element{:id => friend.id}
.right
- if friend.already_invited?
= link_to t('.resend'), service_inviter_path(:uid => friend.uid, :provider => 'facebook', :invitation_id => friend.invitation_id)
- elsif friend.on_diaspora?
= render 'aspect_memberships/aspect_dropdown', :contact => contact_proxy(friend), :person => friend.person, :hang => 'left'
- else
= facebook_invite_form(friend)
- if friend.on_diaspora?
= person_image_link(friend.person, :size => :thumb_small)
- else
= image_tag(friend.photo_url, :class => 'avatar')
.content
%span.from
- if friend.on_diaspora?
= link_to friend.name, person_path(friend.person)
- else
= friend.name
.info
- if friend.person
= friend.person.diaspora_handle
- else
not yet on diaspora
/= will_paginate @friends
- else - else
%br %h3.no_contacts
%br = t('.no_friends')
%br
%br
%br
%br
%br
%h4{:style => 'text-align:center;'}
= link_to t('services.index.connect_to_facebook'), "/auth/facebook" if AppConfig[:configured_services].include?('facebook')

View file

@ -11,7 +11,6 @@
- if AppConfig[:featured_users] - if AppConfig[:featured_users]
%li{:class => ("active" if defined?(@featured))} %li{:class => ("active" if defined?(@featured))}
= link_to t('contacts.featured.featured_users'), "/featured", :class => "element_selector" = link_to t('contacts.featured.featured_users'), "/featured", :class => "element_selector"
/%li %li
/ = link_to "Invite friends", "#", :class => "element_selector" = link_to "Facebook Friends", friend_finder_path('facebook'), :class => "element_selector"

View file

@ -1,7 +1,7 @@
- if AppConfig.configured_services.include?('facebook') - if AppConfig.configured_services.include?('facebook')
- if defined? remote - if defined? remote
= link_to t('.from_facebook'), friend_finder_path('facebook', :remote => remote), :rel => 'facebox' = link_to t('.from_facebook'), friend_finder_path('facebook', :remote => remote)
-else -else
= link_to t('.from_facebook'), friend_finder_path('facebook'), :rel => 'facebox' = link_to t('.from_facebook'), friend_finder_path('facebook')
%br %br
= link_to t('.by_email'), new_user_invitation_path, :title => t('.invite_someone'), :rel => 'facebox' = link_to t('.by_email'), new_user_invitation_path, :title => t('.invite_someone'), :rel => 'facebox'

View file

@ -642,14 +642,8 @@ en:
join_me_on_diaspora: "Join me on DIASPORA*" join_me_on_diaspora: "Join me on DIASPORA*"
click_link_to_accept_invitation: "Click this link to accept your invitation" click_link_to_accept_invitation: "Click this link to accept your invitation"
finder: finder:
invite_your_friends_from: "Invite your friends from %{service}" service_friends: "%{service} Friends"
friends: no_friends: "No Facebook friends found."
zero: "no friends"
one: "1 friend"
few: "%{count} friends"
many: "%{count} friends"
other: "%{count} friends"
not_connected: "not connected"
remote_friend: remote_friend:
resend: "resend" resend: "resend"
invite: "invite" invite: "invite"

View file

@ -2670,11 +2670,6 @@ h1.tag
.hover_edit .hover_edit
:display inline :display inline
.friend_finder
.share_with
:background
:color rgb(245,245,245)
#contacts_of_contact #contacts_of_contact
.section .section
:margin :margin