Skip to content
Browse files

Added recent users to the top of the list.

  • Loading branch information...
1 parent e4d79c8 commit 0991a36e7739cf089797f2425a93e90aac3bd6a4 @dustin committed Jul 1, 2011
Showing with 25 additions and 3 deletions.
  1. +5 −1 compass/src/screen.sass
  2. +14 −1 evently/items/_changes/data.js
  3. +6 −1 evently/items/_changes/mustache.html
View
6 compass/src/screen.sass
@@ -13,7 +13,11 @@ h1, h2
h1
font-size: 1.75em
- margin: 5px
+ margin: 0
+ padding: 0
+
+ img
+ vertical-align: bottom
h2
font-size: 1.5em
View
15 evently/items/_changes/data.js
@@ -61,7 +61,20 @@ function(data) {
return d;
});
+ var seenUsers = { };
+ var users = [ ];
+ data.rows.forEach(function(r) {
+ var d = r.doc;
+ if (!seenUsers[d.actor.email]) {
+ seenUsers[d.actor.email] = true;
+
+ var user = d.actor;
+ user.url = gravatarURL(d.actor.email, 32);
+ users.push(user);
+ }
+ });
+
return {
- items: items, jsonified: JSON.stringify(items)
+ items: items, users: users, jsonified: JSON.stringify(items)
};
};
View
7 evently/items/_changes/mustache.html
@@ -1,4 +1,9 @@
-<h1>Recent Activity</h1>
+<h1>
+ {{#users}}
+ <img width="32" height="32" src="{{img}}" class="gravatar" alt="{{email}}"/>
+ {{/users}}
+ Recent Activity
+</h1>
<ul>
{{#items}}
<li>

0 comments on commit 0991a36

Please sign in to comment.
Something went wrong with that request. Please try again.