1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Add colgroup in differential "shield" tables

Summary: Fixes minor brokenness from D8686.

Test Plan: Expanded a generated file, saw a normal-looking diff.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D8693
This commit is contained in:
Ben Alpert 2014-04-03 15:11:06 -07:00 committed by epriestley
parent 7446402f92
commit a0ac3d6716
3 changed files with 19 additions and 20 deletions

View file

@ -7,7 +7,7 @@
return array(
'names' =>
array(
'core.pkg.css' => 'fb144113',
'core.pkg.css' => '1f7a202d',
'core.pkg.js' => '57d0e1c4',
'darkconsole.pkg.js' => 'ca8671ce',
'differential.pkg.css' => '331c38d9',
@ -22,7 +22,7 @@ return array(
'rsrc/css/aphront/context-bar.css' => '1c3b0529',
'rsrc/css/aphront/dark-console.css' => '6378ef3d',
'rsrc/css/aphront/dialog-view.css' => 'c01d24b4',
'rsrc/css/aphront/error-view.css' => '16cd9949',
'rsrc/css/aphront/error-view.css' => '9f1d5518',
'rsrc/css/aphront/lightbox-attachment.css' => '7acac05d',
'rsrc/css/aphront/list-filter-view.css' => 'ef989c67',
'rsrc/css/aphront/multi-column.css' => '12f65921',
@ -486,7 +486,7 @@ return array(
'aphront-contextbar-view-css' => '1c3b0529',
'aphront-dark-console-css' => '6378ef3d',
'aphront-dialog-view-css' => 'c01d24b4',
'aphront-error-view-css' => '16cd9949',
'aphront-error-view-css' => '9f1d5518',
'aphront-list-filter-view-css' => 'ef989c67',
'aphront-multi-column-view-css' => '12f65921',
'aphront-notes' => '6acadd3f',

View file

@ -358,6 +358,17 @@ abstract class DifferentialChangesetHTMLRenderer
$content)));
}
private function renderColgroup() {
return phutil_tag('colgroup', array(), array(
phutil_tag('col', array('class' => 'num')),
phutil_tag('col', array('class' => 'left')),
phutil_tag('col', array('class' => 'num')),
phutil_tag('col', array('class' => 'copy')),
phutil_tag('col', array('class' => 'right')),
phutil_tag('col', array('class' => 'cov')),
));
}
protected function wrapChangeInTable($content) {
if (!$content) {
return null;
@ -369,7 +380,10 @@ abstract class DifferentialChangesetHTMLRenderer
'class' => 'differential-diff remarkup-code PhabricatorMonospaced',
'sigil' => 'differential-diff',
),
$content);
array(
$this->renderColgroup(),
$content,
));
}
protected function renderInlineComment(

View file

@ -7,17 +7,6 @@ final class DifferentialChangesetTwoUpRenderer
return false;
}
private function renderColgroup() {
return phutil_tag('colgroup', array(), array(
phutil_tag('col', array('class' => 'num')),
phutil_tag('col', array('class' => 'left')),
phutil_tag('col', array('class' => 'num')),
phutil_tag('col', array('class' => 'copy')),
phutil_tag('col', array('class' => 'right')),
phutil_tag('col', array('class' => 'cov')),
));
}
public function renderTextChange(
$range_start,
$range_len,
@ -42,7 +31,6 @@ final class DifferentialChangesetTwoUpRenderer
}
$html = array();
$html[] = $this->renderColgroup();
$old_lines = $this->getOldLines();
$new_lines = $this->getNewLines();
@ -438,10 +426,7 @@ final class DifferentialChangesetTwoUpRenderer
$th_new = phutil_tag('th', array('id' => "C{$id}OL1"), 1);
}
$output = array();
$output[] = $this->renderColgroup();
$output[] = hsprintf(
$output = hsprintf(
'<tr class="differential-image-diff">'.
'%s'.
'<td class="differential-old-image">%s</td>'.