Make 'not sharing' a button, eliminate xss in alert
This commit is contained in:
parent
7399caa066
commit
f9fbb63ecb
3 changed files with 8 additions and 3 deletions
|
|
@ -71,7 +71,7 @@ class Person < ActiveRecord::Base
|
||||||
).order("contacts.user_id DESC", "requests.recipient_id DESC", "profiles.last_name ASC", "profiles.first_name ASC")
|
).order("contacts.user_id DESC", "requests.recipient_id DESC", "profiles.last_name ASC", "profiles.first_name ASC")
|
||||||
end
|
end
|
||||||
|
|
||||||
def name
|
def name(opts = {})
|
||||||
@name ||= if profile.first_name.nil? || profile.first_name.blank?
|
@name ||= if profile.first_name.nil? || profile.first_name.blank?
|
||||||
self.diaspora_handle
|
self.diaspora_handle
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,12 @@
|
||||||
.aspects
|
.aspects
|
||||||
- if !contact
|
- if !contact
|
||||||
%h4
|
%h4
|
||||||
= t('people.show.not_connected', :name => person.first_name)
|
= link_to truncate(t('people.show.not_connected', :name => person.name), :length => 49, :separator => ' ', :omission => ''),
|
||||||
|
{:controller => "people",
|
||||||
|
:action => "share_with",
|
||||||
|
:id => @person.id},
|
||||||
|
:class => 'share_with button',
|
||||||
|
:rel => 'facebox'
|
||||||
- elsif contact.pending
|
- elsif contact.pending
|
||||||
%h4
|
%h4
|
||||||
= t('people.person.pending_request')
|
= t('people.person.pending_request')
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
$(this).closest('li').fadeOut(200);
|
$(this).closest('li').fadeOut(200);
|
||||||
});
|
});
|
||||||
$('.delete').bind('ajax:failure', function() {
|
$('.delete').bind('ajax:failure', function() {
|
||||||
alert(h("#{t('.cannot_remove', :name => person.name)}"));
|
alert("#{h(t('.cannot_remove', :name => person.name))}");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue