Use person_link in notifications_helper, move hovercard css out to a file
This commit is contained in:
parent
6f807f263a
commit
14759b2c80
5 changed files with 80 additions and 74 deletions
|
|
@ -56,7 +56,9 @@ module NotificationsHelper
|
||||||
actors =people || note.actors
|
actors =people || note.actors
|
||||||
number_of_actors = actors.count
|
number_of_actors = actors.count
|
||||||
sentence_translations = {:two_words_connector => " #{t('notifications.index.and')} ", :last_word_connector => ", #{t('notifications.index.and')} " }
|
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
|
if number_of_actors < 4
|
||||||
message = actor_links.to_sentence(sentence_translations)
|
message = actor_links.to_sentence(sentence_translations)
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,7 @@ stylesheets:
|
||||||
- public/stylesheets/lightbox.css
|
- public/stylesheets/lightbox.css
|
||||||
- public/stylesheets/autocomplete.css
|
- public/stylesheets/autocomplete.css
|
||||||
- public/stylesheets/tags.css
|
- public/stylesheets/tags.css
|
||||||
|
- public/stylesheets/hovercard.css
|
||||||
- public/stylesheets/vendor/facebox.css
|
- public/stylesheets/vendor/facebox.css
|
||||||
- public/stylesheets/vendor/fileuploader.css
|
- public/stylesheets/vendor/fileuploader.css
|
||||||
- public/stylesheets/vendor/tipsy.css
|
- public/stylesheets/vendor/tipsy.css
|
||||||
|
|
|
||||||
|
|
@ -3078,7 +3078,7 @@ ul.left_nav
|
||||||
:padding 10px
|
:padding 10px
|
||||||
:min-height 30px
|
:min-height 30px
|
||||||
|
|
||||||
img
|
> img
|
||||||
:height 30px
|
:height 30px
|
||||||
:width 30px
|
:width 30px
|
||||||
:float left
|
:float left
|
||||||
|
|
@ -3119,75 +3119,3 @@ ul.left_nav
|
||||||
:margin
|
:margin
|
||||||
:top 30px
|
: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
|
|
||||||
|
|
||||||
|
|
|
||||||
74
public/stylesheets/sass/hovercard.sass
Normal file
74
public/stylesheets/sass/hovercard.sass
Normal file
|
|
@ -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
|
||||||
|
|
||||||
|
|
@ -296,6 +296,7 @@ describe PeopleController do
|
||||||
contacts = contact.contacts
|
contacts = contact.contacts
|
||||||
get :contacts, :person_id => bob.person.id
|
get :contacts, :person_id => bob.person.id
|
||||||
assigns(:contacts_of_contact).should == contacts
|
assigns(:contacts_of_contact).should == contacts
|
||||||
|
response.should be_success
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue