From 00b245a5667911bfb33a495e864d3cb311cafd20 Mon Sep 17 00:00:00 2001 From: Aviv Eyal Date: Fri, 14 Nov 2014 16:58:24 -0800 Subject: [PATCH] Set up colspec for differential 1up Summary: This upgrades 1up view from "does not work" back to "barely works". Test Plan: view diff, 1up and 2up. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D10854 --- .../render/DifferentialChangesetHTMLRenderer.php | 12 ++---------- .../render/DifferentialChangesetOneUpRenderer.php | 8 ++++++++ .../render/DifferentialChangesetTwoUpRenderer.php | 11 +++++++++++ 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php b/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php index ae94b74026..bddbe46d74 100644 --- a/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php @@ -409,16 +409,8 @@ 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')), - )); - } + abstract protected function renderColgroup(); + protected function wrapChangeInTable($content) { if (!$content) { diff --git a/src/applications/differential/render/DifferentialChangesetOneUpRenderer.php b/src/applications/differential/render/DifferentialChangesetOneUpRenderer.php index b214f74c5f..cf5be02f5c 100644 --- a/src/applications/differential/render/DifferentialChangesetOneUpRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetOneUpRenderer.php @@ -7,6 +7,14 @@ final class DifferentialChangesetOneUpRenderer return true; } + protected function renderColgroup() { + return phutil_tag('colgroup', array(), array( + phutil_tag('col', array('class' => 'num')), + phutil_tag('col', array('class' => 'num')), + phutil_tag('col', array('class' => 'unified')), + )); + } + public function renderTextChange( $range_start, $range_len, diff --git a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php index 4608c2453d..06c841284d 100644 --- a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php @@ -7,6 +7,17 @@ final class DifferentialChangesetTwoUpRenderer return false; } + protected 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,