return issue;
},
+ _injectCommentsRelational: function (issue, users) {
+ if (issue.comments) {
+ var that = this;
+ var newComments = issue.comments.map(function (comment) {
+ var newComment = _.extend({}, comment, { author: comment.login });
+ delete newComment.login;
+ newComment = that._injectRelational(newComment, users, 'author', 'login');
+ return newComment;
+ });
+ issue = _.extend({}, issue, { comments: newComments });
+ }
+ return issue;
+ },
+
_prepareClosed: function (issue) {
if (issue.status === 'CLOSED') {
issue.secondaryLocations = [];
issue = that._injectRelational(issue, r.users, 'assignee', 'login');
issue = that._injectRelational(issue, r.users, 'reporter', 'login');
issue = that._injectRelational(issue, r.actionPlans, 'actionPlan', 'key');
+ issue = that._injectCommentsRelational(issue, r.users);
issue = that._prepareClosed(issue);
return issue;
});
return issue;
},
+ _injectCommentsRelational: function (issue, users) {
+ if (issue.comments) {
+ var that = this;
+ var newComments = issue.comments.map(function (comment) {
+ var newComment = _.extend({}, comment, { author: comment.login });
+ delete newComment.login;
+ newComment = that._injectRelational(newComment, users, 'author', 'login');
+ return newComment;
+ });
+ issue = _.extend({}, issue, { comments: newComments });
+ }
+ return issue;
+ },
+
_prepareClosed: function (issue) {
if (issue.status === 'CLOSED') {
issue.secondaryLocations = [];
issue = that._injectRelational(issue, r.users, 'assignee', 'login');
issue = that._injectRelational(issue, r.users, 'reporter', 'login');
issue = that._injectRelational(issue, r.actionPlans, 'actionPlan', 'key');
+ issue = that._injectCommentsRelational(issue, r.users);
issue = that._prepareClosed(issue);
return issue;
});
issue = this._injectRelational(issue, r.users, 'assignee', 'login');
issue = this._injectRelational(issue, r.users, 'reporter', 'login');
issue = this._injectRelational(issue, r.actionPlans, 'actionPlan', 'key');
+ issue = this._injectCommentsRelational(issue, r.users);
issue = this._prepareClosed(issue);
return issue;
} else {
return issue;
},
+ _injectCommentsRelational: function (issue, users) {
+ if (issue.comments) {
+ var that = this;
+ var newComments = issue.comments.map(function (comment) {
+ var newComment = _.extend({}, comment, { author: comment.login });
+ delete newComment.login;
+ newComment = that._injectRelational(newComment, users, 'author', 'login');
+ return newComment;
+ });
+ issue = _.extend({}, issue, { comments: newComments });
+ }
+ return issue;
+ },
+
_prepareClosed: function (issue) {
if (issue.status === 'CLOSED') {
issue.secondaryLocations = [];
<div class="issue-comments">
{{#each comments}}
<div class="issue-comment" data-comment-key="{{key}}">
- <div class="issue-comment-author" title="{{userName}}">
- {{#ifShowAvatars}}{{avatarHelper email 16}}{{else}}
- <i class="icon-comment icon-half-transparent"></i>{{/ifShowAvatars}} {{userName}}
+ <div class="issue-comment-author" title="{{authorName}}">
+ {{#ifShowAvatars}}{{avatarHelper authorEmail 16}}{{else}}
+ <i class="icon-comment icon-half-transparent"></i>{{/ifShowAvatars}} {{authorName}}
</div>
<div class="issue-comment-text markdown">{{{show html htmlText}}}</div>
<div class="issue-comment-age">({{fromNow createdAt}})</div>