From c711b41fa0400961115ce80637211866e1f575f9 Mon Sep 17 00:00:00 2001 From: MrRenter Date: Fri, 17 Apr 2015 22:33:07 -0400 Subject: [PATCH] Added code to display edit button next to discuss button when viewing a story. Button will vanish if comment was posted > 10 minutes --- views/stories/comments.jade | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/views/stories/comments.jade b/views/stories/comments.jade index f21f43ac3a..ae2b051d06 100644 --- a/views/stories/comments.jade +++ b/views/stories/comments.jade @@ -21,7 +21,10 @@ success: function (data, textStatus, xhr) { commentDetails = data; var div = document.createElement('div'); - + var editButton = ""; + if ((Date.now() - commentDetails.commentOn) < 600000){ + editButton = "Edit · "; + } $(div) .html( '
' + @@ -36,6 +39,7 @@ '
' + '
' + "Reply · " + + editButton + "commented " + moment(commentDetails.commentOn).fromNow() + " by " + "@" + commentDetails.author.username + "" + '
' +