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 = { json = {
:id => self.id, :id => self.id,
:name => self.name, :name => self.name,
:avatar => self.profile.image_url(:thumb_small), :avatar => self.profile.image_url(:thumb_medium),
:handle => self.diaspora_handle, :handle => self.diaspora_handle,
:url => "/people/#{self.id}", :url => "/people/#{self.id}",
:hashtags => self.profile.tags.map{|t| "##{t.name}"} :hashtags => self.profile.tags.map{|t| "##{t.name}"}

View file

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

View file

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

View file

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