Skip to content

Commit

Permalink
Display Gravatars
Browse files Browse the repository at this point in the history
  • Loading branch information
lennart committed Jun 6, 2010
1 parent 4fbf619 commit 40092ae
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
11 changes: 10 additions & 1 deletion _attachments/style/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,15 @@ div.avatar img {
height : 40px;
}

#items ul {
#links ul {
list-style: none;
}

#links li .author img {
margin: .5em;
float: left;
}

.message {
font-family: Georgia, serif;
margin: 1.5em;
Expand All @@ -134,3 +139,7 @@ div.avatar img {
.user {
font-weight: bold;
}

.clear {
clear: both;
}
10 changes: 9 additions & 1 deletion evently/links/recent/selectors/ul/_changes/after.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,13 @@ function(e,r) {
$("time",widget).prettyDate();
var message = $(".message",widget).first();
message.html($.linkify($.mustache.escape(message.html())));
blob.meta = e.value;
var authorElement = $(".author", widget).first()
var author = authorElement.attr("data-id");
$.couch.userDb(function(db) {
db.openDoc("org.couchdb.user:"+author, {success: function(doc) {
//console.debug(doc["couch.app.profile"].email);
authorElement.html("<img src="+doc["couch.app.profile"].gravatar_url+">");
}});
});
blob.meta = e.value;
}
1 change: 1 addition & 0 deletions evently/links/recent/selectors/ul/_changes/data.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
function(data) {
var app = $$("#links").app,
profile = $$("#profile").profile, stash = data.value;
stash.profile_name = profile.name;
if(profile && (stash.name == profile.name)) {
stash.author = true;
stash.name = "you";
Expand Down
3 changes: 2 additions & 1 deletion evently/links/recent/selectors/ul/_changes/mustache.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<li class="link" data-id="{{{_id}}}">
<a href="{{{url}}}" target="_blank">{{{url}}}</a> by <span class="author">{{name}}</span> about <time datetime="{{{created_at}}}">{{{created_at}}}</time> ago.
<span class="author" data-id="{{profile_name}}">{{name}}</span><a href="{{{url}}}" target="_blank">{{{url}}}</a><time datetime="{{{created_at}}}">{{{created_at}}}</time>
<br/>
<span class="message">
{{message}}
</span>
{{#author}}
<a href="#/delete/{{{_id}}}/{{{_rev}}}">Delete</a>
{{/author}}
<div class="clear"></div>
</li>

0 comments on commit 40092ae

Please sign in to comment.