summaryrefslogtreecommitdiffstats
path: root/extensions/MozReview/web/js
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/MozReview/web/js')
-rw-r--r--extensions/MozReview/web/js/mozreview.js41
1 files changed, 19 insertions, 22 deletions
diff --git a/extensions/MozReview/web/js/mozreview.js b/extensions/MozReview/web/js/mozreview.js
index 272f7a61b..70d99aaf6 100644
--- a/extensions/MozReview/web/js/mozreview.js
+++ b/extensions/MozReview/web/js/mozreview.js
@@ -12,6 +12,7 @@ MozReview.getReviewRequest = function() {
var hostUrl = $('.mozreview-requests').data('mozreviewUrl');
var tr = $('<tr/>');
var td = $('<td/>');
+ var link = $('<a/>');
var rrSummaryApiUrl = hostUrl +
'api/extensions/mozreview.extension.MozReviewExtension/summary/?bug=' +
@@ -26,34 +27,32 @@ MozReview.getReviewRequest = function() {
return rrUrl(rrId) + 'diff/#index_header';
}
- function rrRow(rr, isParent) {
- var tdSummary = td.clone();
+ function rrCommitRow(rr, firstCommit) {
var trCommit = tr.clone();
- var reviewLink = $('<a/>');
- var diffLink = reviewLink.clone();
-
- if (!isParent) {
- tdSummary.addClass('mozreview-child-request-summary');
- diffLink.attr('href', rrDiffUrl(rr.id));
- diffLink.text(rr.commit.substr(0, 12));
- diffLink.addClass('mozreview-diff-link');
- tdSummary.append(diffLink);
- tdSummary.append(' ');
+ var tdSubmitter = td.clone();
+ var tdRev = td.clone();
+ var tdSummary = td.clone();
+ var diffLink = link.clone();
+ var reviewLink = link.clone();
+
+ if (firstCommit) {
+ tdSubmitter.text(rr.submitter);
}
+ diffLink.attr('href', rrDiffUrl(rr.id));
+ diffLink.text(rr.commit.substr(0, 12));
+ diffLink.addClass('mozreview-diff-link');
+ tdRev.append(diffLink);
+
+ tdSummary.addClass('mozreview-summary');
reviewLink.attr('href', rrUrl(rr.id));
reviewLink.text(rr.summary);
tdSummary.append(reviewLink);
- if (isParent) {
- tdSummary.append($('<span/>').text(' (' + rr.submitter + ')'));
- }
-
- tdSummary.addClass('mozreview-summary');
-
trCommit.append(
+ tdSubmitter,
+ tdRev,
tdSummary,
- td.clone().text(rr.status),
td.clone().text(rr.issue_open_count)
.addClass('mozreview-open-issues'),
td.clone().text(timeAgo(new Date(rr.last_updated)))
@@ -94,10 +93,8 @@ MozReview.getReviewRequest = function() {
} else {
for (i = 0; i < data.review_request_summaries.length; i++) {
family = data.review_request_summaries[i];
- parent = family.parent;
- tbody.append(rrRow(parent, true));
for (j = 0; j < family.children.length; j++) {
- tbody.append(rrRow(family.children[j], false));
+ tbody.append(rrCommitRow(family.children[j], j==0));
}
}
}