Differential D20185 Diff 48213 src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
<?php | <?php | ||||
final class DifferentialRevisionUpdateHistoryView extends AphrontView { | final class DifferentialRevisionUpdateHistoryView extends AphrontView { | ||||
private $diffs = array(); | private $diffs = array(); | ||||
private $selectedVersusDiffID; | private $selectedVersusDiffID; | ||||
private $selectedDiffID; | private $selectedDiffID; | ||||
private $selectedWhitespace; | |||||
private $commitsForLinks = array(); | private $commitsForLinks = array(); | ||||
private $unitStatus = array(); | private $unitStatus = array(); | ||||
public function setDiffs(array $diffs) { | public function setDiffs(array $diffs) { | ||||
assert_instances_of($diffs, 'DifferentialDiff'); | assert_instances_of($diffs, 'DifferentialDiff'); | ||||
$this->diffs = $diffs; | $this->diffs = $diffs; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setSelectedVersusDiffID($id) { | public function setSelectedVersusDiffID($id) { | ||||
$this->selectedVersusDiffID = $id; | $this->selectedVersusDiffID = $id; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setSelectedDiffID($id) { | public function setSelectedDiffID($id) { | ||||
$this->selectedDiffID = $id; | $this->selectedDiffID = $id; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setSelectedWhitespace($whitespace) { | |||||
$this->selectedWhitespace = $whitespace; | |||||
return $this; | |||||
} | |||||
public function setCommitsForLinks(array $commits) { | public function setCommitsForLinks(array $commits) { | ||||
assert_instances_of($commits, 'PhabricatorRepositoryCommit'); | assert_instances_of($commits, 'PhabricatorRepositoryCommit'); | ||||
$this->commitsForLinks = $commits; | $this->commitsForLinks = $commits; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setDiffUnitStatuses(array $unit_status) { | public function setDiffUnitStatuses(array $unit_status) { | ||||
$this->unitStatus = $unit_status; | $this->unitStatus = $unit_status; | ||||
▲ Show 20 Lines • Show All 178 Lines • ▼ Show 20 Lines | public function render() { | ||||
} | } | ||||
Javelin::initBehavior( | Javelin::initBehavior( | ||||
'differential-diff-radios', | 'differential-diff-radios', | ||||
array( | array( | ||||
'radios' => $radios, | 'radios' => $radios, | ||||
)); | )); | ||||
$options = array( | |||||
DifferentialChangesetParser::WHITESPACE_IGNORE_ALL => pht('Ignore All'), | |||||
DifferentialChangesetParser::WHITESPACE_IGNORE_MOST => pht('Ignore Most'), | |||||
DifferentialChangesetParser::WHITESPACE_IGNORE_TRAILING => | |||||
pht('Ignore Trailing'), | |||||
DifferentialChangesetParser::WHITESPACE_SHOW_ALL => pht('Show All'), | |||||
); | |||||
foreach ($options as $value => $label) { | |||||
$options[$value] = phutil_tag( | |||||
'option', | |||||
array( | |||||
'value' => $value, | |||||
'selected' => ($value == $this->selectedWhitespace) | |||||
? 'selected' | |||||
: null, | |||||
), | |||||
$label); | |||||
} | |||||
$select = phutil_tag('select', array('name' => 'whitespace'), $options); | |||||
$table = id(new AphrontTableView($rows)); | $table = id(new AphrontTableView($rows)); | ||||
$table->setHeaders( | $table->setHeaders( | ||||
array( | array( | ||||
pht('Diff'), | pht('Diff'), | ||||
pht('ID'), | pht('ID'), | ||||
pht('Base'), | pht('Base'), | ||||
pht('Description'), | pht('Description'), | ||||
pht('Created'), | pht('Created'), | ||||
Show All 30 Lines | public function render() { | ||||
$show_diff = phutil_tag( | $show_diff = phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'differential-update-history-footer', | 'class' => 'differential-update-history-footer', | ||||
), | ), | ||||
array( | array( | ||||
phutil_tag( | phutil_tag( | ||||
'label', | |||||
array(), | |||||
array( | |||||
pht('Whitespace Changes:'), | |||||
$select, | |||||
)), | |||||
phutil_tag( | |||||
'button', | 'button', | ||||
array(), | array(), | ||||
pht('Show Diff')), | pht('Show Diff')), | ||||
)); | )); | ||||
$content = phabricator_form( | $content = phabricator_form( | ||||
$this->getUser(), | $this->getUser(), | ||||
array( | array( | ||||
▲ Show 20 Lines • Show All 130 Lines • Show Last 20 Lines |