Skip to content

Commit

Permalink
Added id, comments on loaded updates work now.
Browse files Browse the repository at this point in the history
  • Loading branch information
DFectuoso committed Apr 4, 2010
1 parent cee4455 commit dda9405
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion main.py
Expand Up @@ -68,12 +68,14 @@ def user_fullname(self):
#Json representations
def comment_dict(comment):
return {
'user': comment.user_fullname(),
'id': str(comment.key().id()),
'user_fullname': comment.user_fullname(),
'body': comment.body,
'created': str(comment.created)}

def updates_dict(update):
return {
'id':str(update.key().id()),
'user_fullname':update.user_fullname(),
'body':update.body,
'created':str(update.created),
Expand Down
2 changes: 1 addition & 1 deletion templates/main.html
Expand Up @@ -54,7 +54,7 @@

function renderUpdate(update){
u = "<p>" + update.body + " | " + update.ago + " | " + update.user_fullname + " |";
u += "<a href='javascript:void() onclick='toggleComment(" + update.id + ")' id='comment-link-" + update.id + "'>Comment</a>";
u += "<a href='javascript:void()' onclick='toggleComment(" + update.id + ")' id='comment-link-" + update.id + "'>Comment</a>";
u += "<form action='/comment/"+update.id+"' method='post' id='comment-form-"+update.id+"' style='display:none;'>";
u += "<input type='text' name='body'/><input type='submit' value='Comment' />";
u += "<a href='javascript:void()' onclick='toggleComment("+u.id+")'>Cancel</a>";
Expand Down

0 comments on commit dda9405

Please sign in to comment.