diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index 66c69d898f12ac9229503b9b1c670f3130f73a87..869fa6fc86413c45b637c93fa1a222ac0f913da5 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -56,7 +56,9 @@ module NotificationsHelper actors =people || note.actors number_of_actors = actors.count sentence_translations = {:two_words_connector => " #{t('notifications.index.and')} ", :last_word_connector => ", #{t('notifications.index.and')} " } - actor_links = actors.collect{ |person| link_to("#{h(person.name.titlecase.strip)}", person_path(person), :class => ('hovercardable' if defined?(user_signed_in?) && user_signed_in? && current_user.person != person))} + actor_links = actors.collect{ |person| + person_link(person, :class => 'hovercardable', :what => 'thefuck' ) + } if number_of_actors < 4 message = actor_links.to_sentence(sentence_translations) diff --git a/config/assets.yml b/config/assets.yml index 969d1b299328fe55eab3a96143f7675a21922693..67240f263c9fab8d5e01600cced0522648e14901 100644 --- a/config/assets.yml +++ b/config/assets.yml @@ -87,6 +87,7 @@ stylesheets: - public/stylesheets/lightbox.css - public/stylesheets/autocomplete.css - public/stylesheets/tags.css + - public/stylesheets/hovercard.css - public/stylesheets/vendor/facebox.css - public/stylesheets/vendor/fileuploader.css - public/stylesheets/vendor/tipsy.css diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 5435bf321cb611d35c709d2d985ee17966841b5a..048cfff99e7065930bc891794aff57936d4e0d53 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -3078,7 +3078,7 @@ ul.left_nav :padding 10px :min-height 30px - img + > img :height 30px :width 30px :float left @@ -3119,75 +3119,3 @@ ul.left_nav :margin :top 30px -#hovercard - @include border-radius(2px) - @include box-shadow(0,0,5px,#666) - - :position relative - - .avatar - :position relative - :height 70px - :width 70px - :margin - :right 10px - :left 0 - :top 0 !important - - :background - :color $background - - :height 70px - - :padding 5px - :bottom 25px - - :border 1px solid #999 - :width 220px - - h4 - :margin - :bottom 10px - a - :color $blue - :font - :weight bold !important - - .hovercard_footer - :position absolute - :bottom 0 - :left 0 - :background - :color #eee - :width 100% - - :min-height 19px - - :font - :size smaller - - :border - :top 1px solid #ccc - - .footer_container - :padding 1px 5px - - .hashtags - :overflow hidden - :white-space nowrap - :text-overflow ellipsis - - a - :color #999 - :margin - :right 4px - :font - :weight normal - -#hovercard_container - :padding 10px - :top 5px - :position absolute - :display none - :z-index 10 - diff --git a/public/stylesheets/sass/hovercard.sass b/public/stylesheets/sass/hovercard.sass new file mode 100644 index 0000000000000000000000000000000000000000..34293614ecbc64dec11477fb0d1c9514233e9a6e --- /dev/null +++ b/public/stylesheets/sass/hovercard.sass @@ -0,0 +1,74 @@ +@import 'mixins' + +#hovercard + @include border-radius(2px) + @include box-shadow(0,0,5px,#666) + + :position relative + + .avatar + :position relative + :height 70px + :width 70px + :margin + :right 10px + :left 0 + :top 0 !important + + :background + :color $background + + :height 70px + + :padding 5px + :bottom 25px + + :border 1px solid #999 + :width 220px + + h4 + :margin + :bottom 10px + a + :color $blue + :font + :weight bold !important + + .hovercard_footer + :position absolute + :bottom 0 + :left 0 + :background + :color #eee + :width 100% + + :min-height 19px + + :font + :size smaller + + :border + :top 1px solid #ccc + + .footer_container + :padding 1px 5px + + .hashtags + :overflow hidden + :white-space nowrap + :text-overflow ellipsis + + a + :color #999 + :margin + :right 4px + :font + :weight normal + +#hovercard_container + :padding 10px + :top 5px + :position absolute + :display none + :z-index 10 + diff --git a/spec/controllers/people_controller_spec.rb b/spec/controllers/people_controller_spec.rb index fa7e4d4ef595ad5e47c5d074f9b79ef0305a83d0..eadac9b6002b150651992888fb7c6859a98662ed 100644 --- a/spec/controllers/people_controller_spec.rb +++ b/spec/controllers/people_controller_spec.rb @@ -296,6 +296,7 @@ describe PeopleController do contacts = contact.contacts get :contacts, :person_id => bob.person.id assigns(:contacts_of_contact).should == contacts + response.should be_success end end