Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added id, comments on loaded updates work now.

  • Loading branch information...
commit dda94059fcb3812bb12d7a13653bbe0a3f1ea7f7 1 parent cee4455
@DFectuoso DFectuoso authored
Showing with 4 additions and 2 deletions.
  1. +3 −1 main.py
  2. +1 −1  templates/main.html
View
4 main.py
@@ -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),
View
2  templates/main.html
@@ -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>";
Please sign in to comment.
Something went wrong with that request. Please try again.