Permalink
Browse files

show unpopular tags in there aren't any/many popular ones

  • Loading branch information...
1 parent a6ed209 commit 3d2277609a193902c63bb046dba5d40e1b917670 @brianshaler brianshaler committed May 26, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 public/js/templates/activity_item.ejs
@@ -18,7 +18,9 @@
</span>
<p class="activity-item-text"><%= parsed_message %></p>
<span class="activity-item-topics">
- <% topics.forEach(function (topic) { if (topic.instances > 1 || topics.length <= 3) { %>
+ <% popular = [];
+ topics.forEach(function (topic) { if (topic.instances > 1) { popular.push(topic); } });
+ topics.forEach(function (topic) { if (topic.instances > 1 || popular.length <= 3) { %>
<a href="/topic/view/<%= topic._id %>"><%= topic.text %></a>
<% }}); %>
<a href="#" class="add-topic">

0 comments on commit 3d22776

Please sign in to comment.