[Common mobile] Add no comment text
This commit is contained in:
parent
69d6f4b141
commit
03c94b12eb
|
@ -147,41 +147,52 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
renderComments: function (comments) {
|
renderComments: function (comments) {
|
||||||
var $listComments = $('#comments-list'),
|
var $pageComments = $('.page-comments .page-content');
|
||||||
items = [];
|
if (!comments) {
|
||||||
|
if ($('.comment').length > 0) {
|
||||||
_.each(comments, function (comment) {
|
$('.comment').remove();
|
||||||
var itemTemplate = [
|
}
|
||||||
'<li class="comment item-content">',
|
var textNoComments = !!window.DE ? this.textNoDocumentComments : !!window.PE ? this.textNoPresentationComments : this.textNoSpreadsheetComments,
|
||||||
'<div class="item-inner">',
|
template = '<div id="no-comments" style="text-align: center; margin-top: 35px;">' + textNoComments + '</div>';
|
||||||
'<p class="user-name"><%= item.username %></p>',
|
$pageComments.append(_.template(template));
|
||||||
'<p class="comment-date"><%= item.date %></p>',
|
} else {
|
||||||
'<% if(item.quote) {%>',
|
if ($('#no-comments').length > 0) {
|
||||||
'<p class="comment-quote" data-id="<%= item.uid %>"><%= item.quote %></p>',
|
$('#no-comments').remove();
|
||||||
'<% } %>',
|
}
|
||||||
'<p class="comment-text"><%= item.comment %></p>',
|
var $listComments = $('#comments-list'),
|
||||||
'<% if(replys > 0) {%>',
|
items = [];
|
||||||
'<ul class="list-reply">',
|
_.each(comments, function (comment) {
|
||||||
'<% _.each(item.replys, function (reply) { %>',
|
var itemTemplate = [
|
||||||
'<li class="reply-item">',
|
'<li class="comment item-content">',
|
||||||
'<p class="user-name"><%= reply.username %></p>',
|
'<div class="item-inner">',
|
||||||
'<p class="reply-date"><%= reply.date %></p>',
|
'<p class="user-name"><%= item.username %></p>',
|
||||||
'<p class="reply-text"><%= reply.reply %></p>',
|
'<p class="comment-date"><%= item.date %></p>',
|
||||||
'</li>',
|
'<% if(item.quote) {%>',
|
||||||
'<% }); %>',
|
'<p class="comment-quote" data-id="<%= item.uid %>"><%= item.quote %></p>',
|
||||||
'</ul>',
|
'<% } %>',
|
||||||
'<% } %>',
|
'<p class="comment-text"><%= item.comment %></p>',
|
||||||
'</div>',
|
'<% if(replys > 0) {%>',
|
||||||
'</li>'
|
'<ul class="list-reply">',
|
||||||
].join('');
|
'<% _.each(item.replys, function (reply) { %>',
|
||||||
items.push(_.template(itemTemplate)({
|
'<li class="reply-item">',
|
||||||
android: Framework7.prototype.device.android,
|
'<p class="user-name"><%= reply.username %></p>',
|
||||||
item: comment,
|
'<p class="reply-date"><%= reply.date %></p>',
|
||||||
replys: comment.replys.length
|
'<p class="reply-text"><%= reply.reply %></p>',
|
||||||
}));
|
'</li>',
|
||||||
});
|
'<% }); %>',
|
||||||
|
'</ul>',
|
||||||
$listComments.html(items);
|
'<% } %>',
|
||||||
|
'</div>',
|
||||||
|
'</li>'
|
||||||
|
].join('');
|
||||||
|
items.push(_.template(itemTemplate)({
|
||||||
|
android: Framework7.prototype.device.android,
|
||||||
|
item: comment,
|
||||||
|
replys: comment.replys.length,
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
$listComments.html(items);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
@ -198,7 +209,11 @@ define([
|
||||||
textFinal: 'Final',
|
textFinal: 'Final',
|
||||||
textOriginal: 'Original',
|
textOriginal: 'Original',
|
||||||
textChange: 'Review Change',
|
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 || {}))
|
})(), Common.Views.Collaboration || {}))
|
||||||
|
|
|
@ -594,5 +594,6 @@
|
||||||
"Common.Views.Collaboration.textFinal": "Final",
|
"Common.Views.Collaboration.textFinal": "Final",
|
||||||
"Common.Views.Collaboration.textOriginal": "Original",
|
"Common.Views.Collaboration.textOriginal": "Original",
|
||||||
"Common.Views.Collaboration.textChange": "Review Change",
|
"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"
|
||||||
}
|
}
|
|
@ -495,5 +495,6 @@
|
||||||
"Common.Views.Collaboration.textBack": "Back",
|
"Common.Views.Collaboration.textBack": "Back",
|
||||||
"Common.Views.Collaboration.textCollaboration": "Collaboration",
|
"Common.Views.Collaboration.textCollaboration": "Collaboration",
|
||||||
"Common.Views.Collaboration.textEditUsers": "Users",
|
"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"
|
||||||
}
|
}
|
|
@ -580,5 +580,6 @@
|
||||||
"Common.Views.Collaboration.textBack": "Back",
|
"Common.Views.Collaboration.textBack": "Back",
|
||||||
"Common.Views.Collaboration.textCollaboration": "Collaboration",
|
"Common.Views.Collaboration.textCollaboration": "Collaboration",
|
||||||
"Common.Views.Collaboration.textEditUsers": "Users",
|
"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"
|
||||||
}
|
}
|
Loading…
Reference in a new issue