Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding format

  • Loading branch information...
commit 9be968d5ee4cbbb38596c5e97e68ca2e33a86f82 1 parent d02e7cb
@DFectuoso DFectuoso authored
Showing with 10 additions and 3 deletions.
  1. +1 −1  main.py
  2. +9 −2 templates/main.html
View
2  main.py
@@ -68,7 +68,7 @@ def user_fullname(self):
#Json representations
def updates_dict(update):
return {
- 'user':update.user_fullname(),
+ 'user_fullname':update.user_fullname(),
'body':update.body,
'created':str(update.created)}
View
11 templates/main.html
@@ -53,8 +53,15 @@
}
- function renderUpdate(message){
- return "<div>" + message.body + "</div>";
+ 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 += "<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>";
+ u += "</form>";
+ u += "</p>";
+ return u;
}
</script>
{% endblock %}
Please sign in to comment.
Something went wrong with that request. Please try again.