mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 14:52:41 +01:00
Fix error with inline comments on images
Summary: This data structure is a `dict<int, list<Comment>>` now, where the `int` is the line number. Test Plan: - Created a diff changing an image. - Added inline comments on the left and right sides of the diff. - Saw some exceptions and general sadness. - Applied patch. - Reloaded page. - Everything worked great. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D4264
This commit is contained in:
parent
394340fd8f
commit
62bc3373e5
1 changed files with 22 additions and 18 deletions
|
@ -403,25 +403,29 @@ final class DifferentialChangesetTwoUpRenderer
|
||||||
|
|
||||||
$html_old = array();
|
$html_old = array();
|
||||||
$html_new = array();
|
$html_new = array();
|
||||||
foreach ($this->getOldComments() as $comment) {
|
foreach ($this->getOldComments() as $on_line => $comment_group) {
|
||||||
$comment_html = $this->renderInlineComment($comment, $on_right = false);
|
foreach ($comment_group as $comment) {
|
||||||
$html_old[] =
|
$comment_html = $this->renderInlineComment($comment, $on_right = false);
|
||||||
'<tr class="inline">'.
|
$html_old[] =
|
||||||
'<th />'.
|
'<tr class="inline">'.
|
||||||
'<td class="left">'.$comment_html.'</td>'.
|
'<th />'.
|
||||||
'<th />'.
|
'<td class="left">'.$comment_html.'</td>'.
|
||||||
'<td class="right3" colspan="3" />'.
|
'<th />'.
|
||||||
'</tr>';
|
'<td class="right3" colspan="3" />'.
|
||||||
|
'</tr>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
foreach ($this->getNewComments() as $comment) {
|
foreach ($this->getNewComments() as $lin_line => $comment_group) {
|
||||||
$comment_html = $this->renderInlineComment($comment, $on_right = true);
|
foreach ($comment_group as $comment) {
|
||||||
$html_new[] =
|
$comment_html = $this->renderInlineComment($comment, $on_right = true);
|
||||||
'<tr class="inline">'.
|
$html_new[] =
|
||||||
'<th />'.
|
'<tr class="inline">'.
|
||||||
'<td class="left" />'.
|
'<th />'.
|
||||||
'<th />'.
|
'<td class="left" />'.
|
||||||
'<td class="right3" colspan="3">'.$comment_html.'</td>'.
|
'<th />'.
|
||||||
'</tr>';
|
'<td class="right3" colspan="3">'.$comment_html.'</td>'.
|
||||||
|
'</tr>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$old) {
|
if (!$old) {
|
||||||
|
|
Loading…
Reference in a new issue