history = $history; return $this; } public function setHandles(array $handles) { $this->handles = $handles; return $this; } public function render() { $drequest = $this->getDiffusionRequest(); $handles = $this->handles; $rows = array(); foreach ($this->history as $history) { $epoch = $history->getEpoch(); if ($epoch) { $date = date('M j, Y', $epoch); $time = date('g:i A', $epoch); } else { $date = null; $time = null; } $data = $history->getCommitData(); $author_phid = null; if ($data) { $author_phid = $data->getCommitDetail('authorPHID'); } if ($author_phid && isset($handles[$author_phid])) { $author = $handles[$author_phid]->renderLink(); } else { $author = phutil_escape_html($history->getAuthorName()); } $rows[] = array( $this->linkBrowse( $drequest->getPath(), array( 'commit' => $history->getCommitIdentifier(), )), self::linkCommit( $drequest->getRepository(), $history->getCommitIdentifier()), $this->linkChange( $history->getChangeType(), $history->getFileType(), null, $history->getCommitIdentifier()), $date, $time, $author, AphrontTableView::renderSingleDisplayLine( phutil_escape_html($history->getSummary())), // TODO: etc etc ); } $view = new AphrontTableView($rows); $view->setHeaders( array( 'Browse', 'Commit', 'Change', 'Date', 'Time', 'Author', 'Details', )); $view->setColumnClasses( array( '', 'n', '', '', 'right', '', 'wide', )); return $view->render(); } }