Do not delete comment containers; replace them with success message. This also fixes a visual bug when deleting the last comment

This commit is contained in:
Maximilian Grundke
2017-08-25 18:33:39 +02:00
parent 73ec4d0902
commit bb79852e42
4 changed files with 17 additions and 5 deletions

View File

@ -90,6 +90,12 @@
border: 1px solid #cccccc; border: 1px solid #cccccc;
padding: 15px; padding: 15px;
.comment-removed {
margin-top: 20px;
margin-bottom: 20px;
font-style: italic;
}
.popover-actions { .popover-actions {
display: flex; display: flex;

View File

@ -308,11 +308,7 @@ also, all settings from the rails model needed for the editor configuration in t
var commentId = $(event.target).data('comment-id'); var commentId = $(event.target).data('comment-id');
deleteComment(commentId, editor, fileid, function () { deleteComment(commentId, editor, fileid, function () {
var parent = $(button).parent().parent(); var parent = $(button).parent().parent();
parent.siblings().first().remove(); // potential divider parent.html('<div class="comment-removed"><%= t('comments.deleted') %></div>');
parent.remove(); // the comment itself
if (container.html() === '') {
otherComments.hide();
}
}); });
}); });
}); });

View File

@ -156,6 +156,9 @@ de:
user_exercise_feedback: user_exercise_feedback:
one: Feedback one: Feedback
other: Feedback other: Feedback
comment:
one: Kommentar
other: Kommentare
errors: errors:
messages: messages:
together: 'muss zusammen mit %{attribute} definiert werden' together: 'muss zusammen mit %{attribute} definiert werden'
@ -584,4 +587,6 @@ de:
estimated_time_20_to_30: "zwischen 20 und 30 Minuten" estimated_time_20_to_30: "zwischen 20 und 30 Minuten"
estimated_time_more_30: "mehr als 30 Minuten" estimated_time_more_30: "mehr als 30 Minuten"
working_time: "Geschätze Bearbeitungszeit für diese Aufgabe:" working_time: "Geschätze Bearbeitungszeit für diese Aufgabe:"
comments:
deleted: "Gelöscht"

View File

@ -177,6 +177,9 @@ en:
user_exercise_feedback: user_exercise_feedback:
one: Feedback one: Feedback
other: Feedback other: Feedback
comment:
one: Comment
other: Comments
errors: errors:
messages: messages:
together: 'has to be set along with %{attribute}' together: 'has to be set along with %{attribute}'
@ -605,3 +608,5 @@ en:
estimated_time_20_to_30: "between 20 and 30 minutes" estimated_time_20_to_30: "between 20 and 30 minutes"
estimated_time_more_30: "more than 30 minutes" estimated_time_more_30: "more than 30 minutes"
working_time: "Estimated time working on this exercise:" working_time: "Estimated time working on this exercise:"
comments:
deleted: "Deleted"