added likes to the stream element underscore partial

This commit is contained in:
Daniel Grippi 2011-12-03 11:09:57 -08:00 committed by Dennis Collinson
parent d504bf4591
commit dca3581ae2
3 changed files with 24 additions and 3 deletions

View file

@ -18,6 +18,7 @@ class Post < ActiveRecord::Base
t.add :public
t.add :created_at
t.add :comments_count
t.add :likes_count
t.add :last_three_comments
t.add :provider_display_name
t.add :author

View file

@ -2,8 +2,8 @@
<div class="right controls">
<% if(author.id != current_user.id) { %>
<a href="#" class="block_user control_icon">
<img src="/images/icons/ignoreuser.png">
<a href="/blocks?block[person_id]=<%= author.id %>" class="block_user control_icon" data-confirm="Ignore and remove user from all aspects?" data-method="post" rel="nofollow" data-original-title="Ignore">
<img alt="Ignoreuser" src="/images/icons/ignoreuser.png">
</a>
<% } %>
@ -55,6 +55,18 @@
</a>
</div>
<div class="likes on_post">
<div class="likes_container">
<% if(likes_count > 0){ %>
<img alt="Heart" src="/images/icons/heart.png?1322618579">
<a href="/posts/<%= id %>/likes" class="expand_likes">
<%= likes_count %> like
</a>
<span class="hidden likes_list"></span>
<% } %>
</div>
</div>
<div class="comments">
<div class="comment_stream">
@ -71,6 +83,14 @@
<% _.each(last_three_comments, function(comment) { %>
<li id="<%= comment.guid %>" class="comment">
<% if(comment.author.id == current_user.id || author.id == current_user.id) { %>
<div class="right controls">
<a href="/posts/<%= id %>/comments/<%= comment.id %>" class="delete comment_delete" data-original-title="Delete">
<img alt="Deletelabel" src="/images/deletelabel.png">
</a>
</div>
<% } %>
<a href="/people/<%= author.id %>">
<img src="<%= comment.author.avatar.small %>" class="avatar" data-person-id="<%= comment.author.id %>"/>
</a>

View file

@ -27,7 +27,7 @@ $(function() {
},
collectionFetched: function() {
this.$(".details time").timeago();
this.$("time").timeago();
this.$("label").inFieldLabels();
this.$("#paginate").remove();