hovercard on comments

This commit is contained in:
danielgrippi 2011-07-06 17:13:11 -07:00
parent 738487b381
commit f3d185fe41
4 changed files with 19 additions and 9 deletions

View file

@ -223,7 +223,7 @@ class Person < ActiveRecord::Base
json = {
:id => self.id,
:name => self.name,
:avatar => self.profile.image_url(:thumb_small),
:avatar => self.profile.image_url(:thumb_medium),
:handle => self.diaspora_handle,
:url => "/people/#{self.id}",
:hashtags => self.profile.tags.map{|t| "##{t.name}"}

View file

@ -57,7 +57,7 @@ class StatusMessage < Post
if opts[:plain_text]
person ? ERB::Util.h(person.name) : ERB::Util.h($~[1])
else
person ? "<a href=\"/people/#{person.id}\" class=\"mention\">@#{ERB::Util.h(person.name)}</a>" : ERB::Util.h($~[1])
person ? "<a href=\"/people/#{person.id}\" class=\"mention hovercardable\">@#{ERB::Util.h(person.name)}</a>" : ERB::Util.h($~[1])
end
end
form_message
@ -107,7 +107,7 @@ class StatusMessage < Post
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
<activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
</entry>
XML
XML
end
def socket_to_user(user_or_id, opts={})

View file

@ -3082,12 +3082,21 @@ ul.left_nav
:background
:color $background
:height 70px
:padding 5px
:bottom 55px
:bottom 25px
:border 1px solid #999
:width 240px
h4
:margin
:bottom 10px
a
:font
:weight bold !important
.hovercard_footer
:position absolute
@ -3097,8 +3106,7 @@ ul.left_nav
:color #eee
:width 100%
:height 20px
:min-height 20px
:min-height 19px
:font
:size smaller
@ -3107,7 +3115,7 @@ ul.left_nav
:top 1px solid #ccc
.footer_container
:padding 2px 5px
:padding 1px 5px
.hashtags
:overflow hidden
@ -3118,6 +3126,8 @@ ul.left_nav
:color #999
:margin
:right 4px
:font
:weight normal
#hovercard_container
:padding 10px

View file

@ -87,8 +87,8 @@ STR
describe '#format_mentions' do
it 'adds the links in the formated message text' do
@sm.format_mentions(@sm.raw_message).should == <<-STR
#{link_to('@' << @people[0].name, person_path(@people[0]), :class => 'mention')} can mention people like Raphael #{link_to('@' << @people[1].name, person_path(@people[1]), :class => 'mention')}
can mention people like Raphaellike Raphael #{link_to('@' << @people[2].name, person_path(@people[2]), :class => 'mention')} can mention people like Raph
#{link_to('@' << @people[0].name, person_path(@people[0]), :class => 'mention hovercardable')} can mention people like Raphael #{link_to('@' << @people[1].name, person_path(@people[1]), :class => 'mention hovercardable')}
can mention people like Raphaellike Raphael #{link_to('@' << @people[2].name, person_path(@people[2]), :class => 'mention hovercardable')} can mention people like Raph
STR
end