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;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.popover-action-button {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
#otherComments {
|
#otherComments {
|
||||||
h5 {
|
h5 {
|
||||||
margin-top: 0px;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
@ -75,6 +79,15 @@ p.comment {
|
|||||||
max-height: 200px;
|
max-height: 200px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
border: 1px solid #cccccc;
|
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') %>' +
|
'<%= t('request_for_comments.comment_edited') %>' +
|
||||||
'</div>'
|
'</div>'
|
||||||
}
|
}
|
||||||
htmlContent += '</div>';
|
htmlContent += '</div>' +
|
||||||
htmlContent += '<div class="popover-comment">' + preprocess(comment.text) + '</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>';
|
htmlContent += '</p>';
|
||||||
});
|
});
|
||||||
return htmlContent;
|
return htmlContent;
|
||||||
|
Reference in New Issue
Block a user