Added code to display edit button next to discuss button when viewing a story. Button will vanish if comment was posted > 10 minutes

pull/328/head
MrRenter 2015-04-17 22:33:07 -04:00
parent 820fbb99c7
commit c711b41fa0
1 changed files with 5 additions and 1 deletions

View File

@ -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 = "<a class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost' id='test-" + commentDetails._id + "'>Edit</a> · ";
}
$(div)
.html(
'<div class="media media-news">' +
@ -36,6 +39,7 @@
'<h6>' +
'<div class="clearfix comment-a-comment negative-15">' +
"<a class='btn btn-no-shadow btn-primary btn-xs btn-primary-ghost' id='" + commentDetails._id + "'>Reply</a> · " +
editButton +
"commented " + moment(commentDetails.commentOn).fromNow() + " by " +
"<a href='/" + commentDetails.author.username + "'>@" + commentDetails.author.username + "</a>" +
'</div>' +