[Common mobile] Add no comment text

This commit is contained in:
Julia Svinareva 2019-08-12 10:50:44 +03:00
parent 69d6f4b141
commit 03c94b12eb
4 changed files with 57 additions and 39 deletions

View file

@ -147,9 +147,20 @@ define([
},
renderComments: function (comments) {
var $pageComments = $('.page-comments .page-content');
if (!comments) {
if ($('.comment').length > 0) {
$('.comment').remove();
}
var textNoComments = !!window.DE ? this.textNoDocumentComments : !!window.PE ? this.textNoPresentationComments : this.textNoSpreadsheetComments,
template = '<div id="no-comments" style="text-align: center; margin-top: 35px;">' + textNoComments + '</div>';
$pageComments.append(_.template(template));
} else {
if ($('#no-comments').length > 0) {
$('#no-comments').remove();
}
var $listComments = $('#comments-list'),
items = [];
_.each(comments, function (comment) {
var itemTemplate = [
'<li class="comment item-content">',
@ -177,11 +188,11 @@ define([
items.push(_.template(itemTemplate)({
android: Framework7.prototype.device.android,
item: comment,
replys: comment.replys.length
replys: comment.replys.length,
}));
});
$listComments.html(items);
}
},
@ -198,7 +209,11 @@ define([
textFinal: 'Final',
textOriginal: 'Original',
textChange: 'Review Change',
textEditUsers: 'Users'
textEditUsers: 'Users',
textNoDocumentComments: 'This document doesn\'t contain comments',
textNoSpreadsheetComments: 'This spreadsheet doesn\'t contain comments',
textNoPresentationComments: 'This presentation doesn\'t contain comments'
}
})(), Common.Views.Collaboration || {}))

View file

@ -594,5 +594,6 @@
"Common.Views.Collaboration.textFinal": "Final",
"Common.Views.Collaboration.textOriginal": "Original",
"Common.Views.Collaboration.textChange": "Review Change",
"Common.Views.Collaboration.textEditUsers": "Users"
"Common.Views.Collaboration.textEditUsers": "Users",
"Common.Views.Collaboration.textNoDocumentComments": "This document doesn\'t contain comments"
}

View file

@ -495,5 +495,6 @@
"Common.Views.Collaboration.textBack": "Back",
"Common.Views.Collaboration.textCollaboration": "Collaboration",
"Common.Views.Collaboration.textEditUsers": "Users",
"Common.Views.Collaboration.textСomments": "Сomments"
"Common.Views.Collaboration.textСomments": "Сomments",
"Common.Views.Collaboration.textNoPresentationComments": "This presentation doesn\'t contain comments"
}

View file

@ -580,5 +580,6 @@
"Common.Views.Collaboration.textBack": "Back",
"Common.Views.Collaboration.textCollaboration": "Collaboration",
"Common.Views.Collaboration.textEditUsers": "Users",
"Common.Views.Collaboration.textСomments": "Сomments"
"Common.Views.Collaboration.textСomments": "Сomments",
"Common.Views.Collaboration.textNoSpreadsheetComments": "This spreadsheet doesn\'t contain comments"
}