Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/view/DifferentialRevisionListView.php
<?php | <?php | ||||
/** | /** | ||||
* Render a table of Differential revisions. | * Render a table of Differential revisions. | ||||
*/ | */ | ||||
final class DifferentialRevisionListView extends AphrontView { | final class DifferentialRevisionListView extends AphrontView { | ||||
private $revisions = array(); | private $revisions = array(); | ||||
private $header; | private $header; | ||||
private $noDataString; | private $noDataString; | ||||
private $noBox; | private $noBox; | ||||
private $background = null; | private $background = null; | ||||
private $unlandedDependencies = array(); | private $unlandedDependencies = array(); | ||||
private $customFieldLists = array(); | |||||
public function setUnlandedDependencies(array $unlanded_dependencies) { | public function setUnlandedDependencies(array $unlanded_dependencies) { | ||||
$this->unlandedDependencies = $unlanded_dependencies; | $this->unlandedDependencies = $unlanded_dependencies; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getUnlandedDependencies() { | public function getUnlandedDependencies() { | ||||
return $this->unlandedDependencies; | return $this->unlandedDependencies; | ||||
Show All 20 Lines | public function setNoBox($box) { | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setBackground($background) { | public function setBackground($background) { | ||||
$this->background = $background; | $this->background = $background; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function setCustomFieldLists(array $lists) { | |||||
$this->customFieldLists = $lists; | |||||
return $this; | |||||
} | |||||
public function render() { | public function render() { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$this->initBehavior('phabricator-tooltips', array()); | $this->initBehavior('phabricator-tooltips', array()); | ||||
$this->requireResource('aphront-tooltip-css'); | $this->requireResource('aphront-tooltip-css'); | ||||
$reviewer_limit = 7; | $reviewer_limit = 7; | ||||
▲ Show 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | foreach ($this->revisions as $key => $revision) { | ||||
$icon = $revision->getStatusIcon(); | $icon = $revision->getStatusIcon(); | ||||
$color = $revision->getStatusIconColor(); | $color = $revision->getStatusIconColor(); | ||||
$item->setStatusIcon( | $item->setStatusIcon( | ||||
"{$icon} {$color}", | "{$icon} {$color}", | ||||
$revision->getStatusDisplayName()); | $revision->getStatusDisplayName()); | ||||
$field_list = idx($this->customFieldLists, $revision->getPHID()); | |||||
if ($field_list) { | |||||
$field_list | |||||
->addFieldsToListViewItem($revision, $viewer, $item); | |||||
} | |||||
$list->addItem($item); | $list->addItem($item); | ||||
} | } | ||||
$list->setNoDataString($this->noDataString); | $list->setNoDataString($this->noDataString); | ||||
if ($this->header && !$this->noBox) { | if ($this->header && !$this->noBox) { | ||||
$list->setFlush(true); | $list->setFlush(true); | ||||
▲ Show 20 Lines • Show All 80 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0