Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/view/DiffusionHistoryTableView.php
Show First 20 Lines • Show All 181 Lines • ▼ Show 20 Lines | foreach ($this->history as $history) { | ||||
$browse = $this->linkBrowse( | $browse = $this->linkBrowse( | ||||
$history->getPath(), | $history->getPath(), | ||||
array( | array( | ||||
'commit' => $history->getCommitIdentifier(), | 'commit' => $history->getCommitIdentifier(), | ||||
'branch' => $drequest->getBranch(), | 'branch' => $drequest->getBranch(), | ||||
'type' => $history->getFileType(), | 'type' => $history->getFileType(), | ||||
)); | )); | ||||
$status = $commit->getAuditStatus(); | |||||
$icon = PhabricatorAuditCommitStatusConstants::getStatusIcon($status); | |||||
$color = PhabricatorAuditCommitStatusConstants::getStatusColor($status); | |||||
$name = PhabricatorAuditCommitStatusConstants::getStatusName($status); | |||||
$audit_view = id(new PHUIIconView()) | |||||
->setIcon($icon, $color) | |||||
->addSigil('has-tooltip') | |||||
->setMetadata( | |||||
array( | |||||
'tip' => $name, | |||||
)); | |||||
$rows[] = array( | $rows[] = array( | ||||
$graph ? $graph[$ii++] : null, | $graph ? $graph[$ii++] : null, | ||||
$browse, | $browse, | ||||
self::linkCommit( | self::linkCommit( | ||||
$drequest->getRepository(), | $drequest->getRepository(), | ||||
$history->getCommitIdentifier()), | $history->getCommitIdentifier()), | ||||
$build, | $build, | ||||
$audit_view, | |||||
($commit ? | ($commit ? | ||||
self::linkRevision(idx($this->revisions, $commit->getPHID())) : | self::linkRevision(idx($this->revisions, $commit->getPHID())) : | ||||
null), | null), | ||||
$author, | $author, | ||||
$summary, | $summary, | ||||
$committed, | $committed, | ||||
); | ); | ||||
} | } | ||||
$view = new AphrontTableView($rows); | $view = new AphrontTableView($rows); | ||||
$view->setHeaders( | $view->setHeaders( | ||||
array( | array( | ||||
null, | null, | ||||
null, | null, | ||||
pht('Commit'), | pht('Commit'), | ||||
null, | null, | ||||
null, | null, | ||||
pht('Author/Committer'), | null, | ||||
pht('Author'), | |||||
pht('Details'), | pht('Details'), | ||||
pht('Committed'), | pht('Committed'), | ||||
)); | )); | ||||
$view->setColumnClasses( | $view->setColumnClasses( | ||||
array( | array( | ||||
'threads', | 'threads', | ||||
'nudgeright', | 'nudgeright', | ||||
'', | '', | ||||
'icon', | 'icon', | ||||
'icon', | |||||
'', | '', | ||||
'', | '', | ||||
'wide', | 'wide', | ||||
'right', | 'right', | ||||
)); | )); | ||||
$view->setColumnVisibility( | $view->setColumnVisibility( | ||||
array( | array( | ||||
$graph ? true : false, | $graph ? true : false, | ||||
true, | true, | ||||
true, | true, | ||||
$has_any_build, | $has_any_build, | ||||
true, | |||||
$show_revisions, | $show_revisions, | ||||
)); | )); | ||||
$view->setDeviceVisibility( | $view->setDeviceVisibility( | ||||
array( | array( | ||||
$graph ? true : false, | $graph ? true : false, | ||||
true, | true, | ||||
true, | true, | ||||
true, | true, | ||||
true, | true, | ||||
true, | |||||
false, | false, | ||||
true, | true, | ||||
false, | false, | ||||
)); | )); | ||||
return $view->render(); | return $view->render(); | ||||
} | } | ||||
} | } |