now functionally correct
This commit is contained in:
parent
70fe2cf10f
commit
e4062bf5fd
4 changed files with 28 additions and 13 deletions
|
|
@ -71,7 +71,8 @@ class ServicesController < ApplicationController
|
||||||
su.save
|
su.save
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.json{ render :json => invite_redirect_url(invite, invited_user, su) }
|
format.html{ invite_redirect_url(invite, invited_user, su)}
|
||||||
|
format.json{ render :json => invite_redirect_json(invite, invited_user, su) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -86,11 +87,19 @@ MSG
|
||||||
"https://www.facebook.com/?compose=1&id=#{facebook_uid}&subject=#{subject}&message=#{message}&sk=messages"
|
"https://www.facebook.com/?compose=1&id=#{facebook_uid}&subject=#{subject}&message=#{message}&sk=messages"
|
||||||
end
|
end
|
||||||
|
|
||||||
def invite_redirect_url(invite, user, service_user)
|
def invite_redirect_json(invite, user, service_user)
|
||||||
if invite.email_like_identifer
|
if invite.email_like_identifer
|
||||||
{:message => t("invitations.create.sent") + service_user.name }
|
{:message => t("invitations.create.sent") + service_user.name }
|
||||||
else
|
else
|
||||||
{:url => facebook_message_url(user, service_user.uid)}
|
{:url => facebook_message_url(user, service_user.uid)}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def invite_redirect_url(invite, user, service_user)
|
||||||
|
if invite.email_like_identifer
|
||||||
|
redirect_to(friend_finder_path(:provider => 'facebook'), :notice => "you re-invited #{service_user.name}")
|
||||||
|
else
|
||||||
|
redirect_to(facebook_message_url(user, service_user.uid))
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,7 @@
|
||||||
.right
|
.right
|
||||||
|
|
||||||
- if friend.already_invited?
|
- if friend.already_invited?
|
||||||
.button.resend
|
= link_to t('.resend'), service_inviter_path(:uid => friend.uid, :provider => 'facebook', :invitation_id => friend.invitation_id), :class => 'button resend'
|
||||||
= link_to t('.resend'), service_inviter_path(:uid => friend.uid, :provider => 'facebook', :invitation_id => friend.invitation_id, :format => :json)
|
|
||||||
- elsif friend.on_diaspora?
|
- elsif friend.on_diaspora?
|
||||||
= render 'shared/aspect_dropdown', :selected_aspects => contact_proxy(friend).aspects, :person => friend.person, :hang => 'left'
|
= render 'shared/aspect_dropdown', :selected_aspects => contact_proxy(friend).aspects, :person => friend.person, :hang => 'left'
|
||||||
- else
|
- else
|
||||||
|
|
|
||||||
|
|
@ -8,14 +8,14 @@ var ContactEdit = {
|
||||||
$('.dropdown.aspect_membership .dropdown_list > li').live('click', function(evt){
|
$('.dropdown.aspect_membership .dropdown_list > li').live('click', function(evt){
|
||||||
ContactEdit.processClick($(this), evt);
|
ContactEdit.processClick($(this), evt);
|
||||||
});
|
});
|
||||||
$('.button.resend').live('click', function(evt){
|
// $('.button.resend').live('click', function(evt){
|
||||||
evt.preventDefault();
|
// evt.preventDefault();
|
||||||
$.post($(this).href, {},
|
// $.post($(this).href, {},
|
||||||
function(data){
|
// function(data){
|
||||||
console.log(data);
|
// console.log(data);
|
||||||
ContactEdit.processSuccess($(this), evt, data)
|
// ContactEdit.processSuccess($(this), evt, data)
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
},
|
},
|
||||||
|
|
||||||
processClick: function(li, evt){
|
processClick: function(li, evt){
|
||||||
|
|
@ -34,7 +34,7 @@ var ContactEdit = {
|
||||||
"aspect_id" : li.data("aspect_id"),
|
"aspect_id" : li.data("aspect_id"),
|
||||||
"uid" : li.parent().data("service_uid")
|
"uid" : li.parent().data("service_uid")
|
||||||
}, function(data){
|
}, function(data){
|
||||||
processSuccess(li, evt, data);
|
ContactEdit.processSuccess(li, evt, data);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3397,3 +3397,10 @@ ul#getting_started
|
||||||
|
|
||||||
.green
|
.green
|
||||||
:color green
|
:color green
|
||||||
|
// .resend
|
||||||
|
// :color black
|
||||||
|
// &:hover
|
||||||
|
// :text-decoration none
|
||||||
|
// :color black
|
||||||
|
// &:hover
|
||||||
|
// :text-decoration none
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue