Show edit and delete buttons for comments that can be edited by the user
This commit is contained in:
@ -65,9 +65,13 @@ p.comment {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.popover-action-button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#otherComments {
|
||||
h5 {
|
||||
margin-top: 0px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.container {
|
||||
@ -75,6 +79,15 @@ p.comment {
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
border: 1px solid #cccccc;
|
||||
|
||||
.popover-actions {
|
||||
display: flex;
|
||||
|
||||
.popover-action-button {
|
||||
display: block;
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -193,8 +193,14 @@ also, all settings from the rails model needed for the editor configuration in t
|
||||
'<%= t('request_for_comments.comment_edited') %>' +
|
||||
'</div>'
|
||||
}
|
||||
htmlContent += '</div>';
|
||||
htmlContent += '<div class="popover-comment">' + preprocess(comment.text) + '</div>';
|
||||
htmlContent += '</div>' +
|
||||
'<div class="popover-comment">' + preprocess(comment.text) + '</div>';
|
||||
if (comment.editable) {
|
||||
htmlContent += '<div class="popover-actions">' +
|
||||
'<button class="popover-action-button btn btn-xs btn-warning" id="edit-' + comment.id + '"><%= t('shared.edit') %></button>' +
|
||||
'<button class="popover-action-button btn btn-xs btn-danger" id="delete-' + comment.id + '"><%= t('shared.destroy') %></button>' +
|
||||
'</div>';
|
||||
}
|
||||
htmlContent += '</p>';
|
||||
});
|
||||
return htmlContent;
|
||||
|
Reference in New Issue
Block a user