From a0ac3d67168ba528273a63290fdde1ca96dbf374 Mon Sep 17 00:00:00 2001 From: Ben Alpert Date: Thu, 3 Apr 2014 15:11:06 -0700 Subject: [PATCH] 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 --- resources/celerity/map.php | 6 +++--- .../DifferentialChangesetHTMLRenderer.php | 16 +++++++++++++++- .../DifferentialChangesetTwoUpRenderer.php | 17 +---------------- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 3609f76a10..d65cb1e3da 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -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', diff --git a/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php b/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php index bf2aeadded..d37a2b9f06 100644 --- a/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php @@ -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( diff --git a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php index 5c4627e95d..1714346766 100644 --- a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php @@ -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( ''. '%s'. '%s'.