From 8941448866045fe826ba607ef07e4537da7e8f60 Mon Sep 17 00:00:00 2001 From: zhitomirskiyi Date: Wed, 26 Jan 2011 17:40:44 -0800 Subject: [PATCH] placed friend finder in facebox. added translations --- app/controllers/services_controller.rb | 1 + app/views/aspects/edit.html.haml | 7 -- app/views/aspects/index.html.haml | 10 +-- app/views/services/finder.html.haml | 89 +++++++++++++++----------- config/locales/diaspora/en.yml | 5 ++ 5 files changed, 62 insertions(+), 50 deletions(-) diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index 9e40db844..578faf4fd 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -48,6 +48,7 @@ class ServicesController < ApplicationController def finder service = current_user.services.where(:provider => params[:provider]).first @friends = service ? service.finder : {} + render :layout => false end def inviter diff --git a/app/views/aspects/edit.html.haml b/app/views/aspects/edit.html.haml index bb63cf99a..b48758c51 100644 --- a/app/views/aspects/edit.html.haml +++ b/app/views/aspects/edit.html.haml @@ -12,13 +12,6 @@ .description = t('contacts', :count =>@aspect_contacts_count) - .person_tiles{:style => "display:none;"} - - for contact in @aspect.contacts - .tile - = person_image_link contact.person - = link_to contact.person.name, contact.person - %hr - = form_for @aspect do |asp| = asp.text_field :name, :value => @aspect.name = asp.submit t('.rename_aspect'), :class => 'button' diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index c3bed4da1..2a244ba6c 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -44,9 +44,9 @@ %h4= t('shared.invitations.invites') = render "shared/invitations", :invites => @invites - .section - %h4 - Find your friends - - = link_to "From Facebook", friend_finder_path('facebook') + - if SERVICES['facebook']['app_id'] !="" + .section + %h4 + = t('.invite_your_friends') + = link_to t('.from_facebook'), friend_finder_path('facebook'), :rel => 'facebox' diff --git a/app/views/services/finder.html.haml b/app/views/services/finder.html.haml index 73fb80f07..75021ceda 100644 --- a/app/views/services/finder.html.haml +++ b/app/views/services/finder.html.haml @@ -5,46 +5,59 @@ - content_for :head do = include_javascripts :aspects -.span-24.last - %h3 - Facebook friend finder +#aspect_edit_pane + #facebox_header + %h4 + = t('.invite_your_friends_from', :service => params[:provider].titleize) + .description + - if @friends.keys.length > 0 + = "#{@friends.keys.length} friends" + - else + %i= t('.not_connected') + -.span-12.prepend-6 .contact_list - = search_field_tag :contact_search, "", :class => 'contact_list_search', :results => 5, :placeholder => t('shared.contact_list.all_contacts') - %ul - - for uid in @friends.keys - - friend = @friends[uid] - %li - .right - -if friend[:contact] && !friend[:contact].pending - = t('people.person.already_connected') - - elsif (friend[:contact] && friend[:contact].pending) - = t('people.person.pending_request') - - elsif friend[:person] - = link_to t('people.show.start_sharing'), - {:controller => "people", - :action => "share_with", - :id => friend[:person].id}, - :class => 'button', - :rel => 'facebox' - - elsif friend[:invitation_id] - = t('invitations.new.already_invited') - %br - = link_to t('.resend'), service_inviter_path(:uid => uid, :provider => 'facebook', :invitation_id => friend[:invitation_id]) - - 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 @friends.keys.length > 0 + = search_field_tag :contact_search, "", :class => 'contact_list_search', :results => 5, :placeholder => t('shared.contact_list.all_contacts') + %ul + - for uid in @friends.keys + - friend = @friends[uid] + %li + .right + -if friend[:contact] && !friend[:contact].pending + = t('people.person.already_connected') + - elsif (friend[:contact] && friend[:contact].pending) + = t('people.person.pending_request') + - elsif friend[:person] + = link_to t('people.show.start_sharing'), + {:controller => "people", + :action => "share_with", + :id => friend[:person].id}, + :class => 'button', + :rel => 'facebox' + - elsif friend[:invitation_id] + = t('invitations.new.already_invited') + %br + = link_to t('.resend'), service_inviter_path(:uid => uid, :provider => 'facebook', :invitation_id => friend[:invitation_id]) + - 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", :disable_with => "#{t('.generating')}..." - - if friend[:person] - = person_image_link(friend[:person]) - - %h4.name - if friend[:person] - = link_to friend[:name], person_path(friend[:person]) - - else - = friend[:name] + = person_image_link(friend[:person]) + %h4.name + - if friend[:person] + = link_to friend[:name], person_path(friend[:person]) + - else + = friend[:name] + + - else + %br + %br + %br + %h4 + = link_to t('services.index.connect_to_facebook'), "/auth/facebook" if SERVICES['facebook']['app_id'] !="" diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 18c777c73..bb67e4bc9 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -189,6 +189,8 @@ en: index: handle_explanation: "This is your diaspora handle. Like an email address, you can give this to people to reach you." no_contacts: "No contacts" + invite_your_friends: "Invite your friends" + from_facebook: "From Facebook" notifications: request_accepted: "accepted your share request." new_request: "offered to share with you." @@ -428,7 +430,10 @@ en: join_me_on_diaspora: "Join me on DIASPORA*" click_link_to_accept_invitation: "Click this link to accept your invitation" finder: + generating: "generating" resend: "resend" + invite_your_friends_from: "Invite your friends from %{service}" + not_connected: "not connected" notifier: hello: "Hello %{name}!" love: "love,"