final touchups to hovercard
This commit is contained in:
parent
d51e9431a6
commit
fd015129c4
8 changed files with 57 additions and 35 deletions
|
|
@ -225,7 +225,8 @@ class Person < ActiveRecord::Base
|
|||
:name => self.name,
|
||||
:avatar => self.profile.image_url(:thumb_small),
|
||||
:handle => self.diaspora_handle,
|
||||
:url => "/people/#{self.id}"
|
||||
:url => "/people/#{self.id}",
|
||||
:hashtags => self.profile.tags.map{|t| "##{t.name}"}
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
= person_image_link(comment.author)
|
||||
.content
|
||||
%span.from
|
||||
= person_link(comment.author, :class => "author")
|
||||
= person_link(comment.author, :class => "hovercardable")
|
||||
|
||||
%span{:class => direction_for(comment.text)}
|
||||
= markdownify(comment.text, :youtube_maps => comment.youtube_titles)
|
||||
|
|
|
|||
|
|
@ -52,15 +52,16 @@
|
|||
.ajax_loader
|
||||
= image_tag("ajax-loader.gif")
|
||||
|
||||
#hovercard
|
||||
%img.avatar
|
||||
%h4
|
||||
%a.person
|
||||
#hovercard_dropdown_container
|
||||
#hovercard_container
|
||||
#hovercard
|
||||
%img.avatar
|
||||
%h4
|
||||
%a.person
|
||||
#hovercard_dropdown_container
|
||||
|
||||
.hovercard_footer
|
||||
.footer_container
|
||||
Message
|
||||
.hovercard_footer
|
||||
.footer_container
|
||||
.hashtags
|
||||
|
||||
%ul#user_menu.dropdown
|
||||
%li
|
||||
|
|
|
|||
|
|
@ -5,13 +5,9 @@
|
|||
- if current_user
|
||||
- contact = current_user.contacts.find_by_person_id(person.id)
|
||||
- contact ||= Contact.new(:person => person)
|
||||
- unless person == current_user.person
|
||||
.right
|
||||
= render 'aspect_memberships/aspect_dropdown', :contact => contact, :person => person, :hang => 'left'
|
||||
|
||||
.content
|
||||
%span.from
|
||||
=person_link(person)
|
||||
.info
|
||||
= person.profile.format_tags(person.profile.tag_string)
|
||||
=person_link(person, :class => "hovercardable")
|
||||
|
||||
= will_paginate people, :params => {:controller => 'people', :action => 'tag_index'}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
.content
|
||||
%div.post_initial_info
|
||||
%span.from
|
||||
= person_link(post.author, :class => 'author')
|
||||
= person_link(post.author, :class => 'hovercardable')
|
||||
%time.time.timeago{:datetime => post.created_at, :integer => time_for_sort(post).to_i}
|
||||
%span.details
|
||||
\-
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ javascripts:
|
|||
- public/javascripts/widgets/flashes.js
|
||||
- public/javascripts/widgets/post.js
|
||||
- public/javascripts/widgets/hovercard.js
|
||||
- public/javascripts/widgets/notifications-badge.js
|
||||
- public/javascripts/view.js
|
||||
- public/javascripts/stream.js
|
||||
- public/javascripts/content-updater.js
|
||||
|
|
|
|||
|
|
@ -7,20 +7,22 @@
|
|||
this.start = function() {
|
||||
self.personCache = new this.Cache();
|
||||
self.dropdownCache = new this.Cache();
|
||||
|
||||
|
||||
var card = $("#hovercard");
|
||||
self.hoverCard = {
|
||||
tip: $("#hovercard"),
|
||||
tip: $("#hovercard_container"),
|
||||
dropdownContainer: $("#hovercard_dropdown_container"),
|
||||
offset: {
|
||||
left: 0,
|
||||
top: 18
|
||||
left: -10,
|
||||
top: 13
|
||||
},
|
||||
personLink: $("#hovercard").find("a.person"),
|
||||
avatar: $("#hovercard").find(".avatar"),
|
||||
dropdown: $("#hovercard").find(".dropdown_list")
|
||||
personLink: card.find("a.person"),
|
||||
avatar: card.find(".avatar"),
|
||||
dropdown: card.find(".dropdown_list"),
|
||||
hashtags: card.find(".hashtags"),
|
||||
};
|
||||
|
||||
$(document.body).delegate("a.author:not(.self)", "hover", self.handleHoverEvent);
|
||||
$(document.body).delegate("a.hovercardable:not(.self)", "hover", self.handleHoverEvent);
|
||||
self.hoverCard.tip.hover(self.hoverCardHover, self.clearTimeout);
|
||||
|
||||
Diaspora.widgets.subscribe("aspectDropdown/updated aspectDropdown/blurred", function(evt, personId, dropdownHtml) {
|
||||
|
|
@ -67,6 +69,14 @@
|
|||
self.hoverCard.personLink.text(person.name);
|
||||
self.hoverCard.dropdown.attr("data-person-id", person.id);
|
||||
|
||||
$.each(person.hashtags, function(index, hashtag) {
|
||||
self.hoverCard.hashtags.append(
|
||||
$("<a/>", {
|
||||
href: "/tags/" + hashtag.substring(1)
|
||||
}).text(hashtag)
|
||||
);
|
||||
});
|
||||
|
||||
self.dropdownCache.get(self.target.attr("href") + "/aspect_membership_button", function(dropdown) {
|
||||
self.hoverCard.dropdownContainer.html(dropdown);
|
||||
self.hoverCard.tip.fadeIn(140);
|
||||
|
|
|
|||
|
|
@ -3066,14 +3066,12 @@ ul.left_nav
|
|||
:margin
|
||||
:top 30px
|
||||
|
||||
.tags_people
|
||||
.dropdown
|
||||
:display none
|
||||
|
||||
#hovercard
|
||||
@include border-radius(2px)
|
||||
@include box-shadow(0,0,5px,#666)
|
||||
|
||||
:position relative
|
||||
|
||||
.avatar
|
||||
:position relative
|
||||
:height 70px
|
||||
|
|
@ -3081,21 +3079,16 @@ ul.left_nav
|
|||
:margin
|
||||
:right 10px
|
||||
|
||||
:position absolute
|
||||
:display none
|
||||
:background
|
||||
:color $background
|
||||
|
||||
:padding 5px
|
||||
:bottom 28px
|
||||
:bottom 55px
|
||||
|
||||
:border 1px solid #999
|
||||
|
||||
:width 220px
|
||||
|
||||
:z
|
||||
:index 10
|
||||
|
||||
.hovercard_footer
|
||||
:position absolute
|
||||
:bottom 0
|
||||
|
|
@ -3104,6 +3097,9 @@ ul.left_nav
|
|||
:color #eee
|
||||
:width 100%
|
||||
|
||||
:height 20px
|
||||
:min-height 20px
|
||||
|
||||
:font
|
||||
:size smaller
|
||||
|
||||
|
|
@ -3112,3 +3108,20 @@ ul.left_nav
|
|||
|
||||
.footer_container
|
||||
:padding 2px 5px
|
||||
|
||||
.hashtags
|
||||
:overflow hidden
|
||||
:white-space nowrap
|
||||
:text-overflow ellipsis
|
||||
|
||||
a
|
||||
:color #999
|
||||
:margin
|
||||
:right 4px
|
||||
|
||||
#hovercard_container
|
||||
:padding 10px
|
||||
:top 5px
|
||||
:position absolute
|
||||
:display none
|
||||
:z-index 10
|
||||
|
|
|
|||
Loading…
Reference in a new issue