Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionHistoryController.php
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | public function handleRequest(AphrontRequest $request) { | ||||
// If we draw the graph, commits will often appear to be unrelated because | // If we draw the graph, commits will often appear to be unrelated because | ||||
// intermediate nodes are omitted. Just drop the graph. | // intermediate nodes are omitted. Just drop the graph. | ||||
// The ideal behavior would be to load the entire graph and then connect | // The ideal behavior would be to load the entire graph and then connect | ||||
// ancestors appropriately, but this would currrently be prohibitively | // ancestors appropriately, but this would currrently be prohibitively | ||||
// expensive in the general case. | // expensive in the general case. | ||||
$show_graph = !strlen($drequest->getPath()); | $show_graph = ($drequest->getPath() === null | ||||
|| !strlen($drequest->getPath())); | |||||
if ($show_graph) { | if ($show_graph) { | ||||
$history_list | $history_list | ||||
->setParents($history_results['parents']) | ->setParents($history_results['parents']) | ||||
->setIsHead(!$pager->getOffset()) | ->setIsHead(!$pager->getOffset()) | ||||
->setIsTail(!$pager->getHasMorePages()); | ->setIsTail(!$pager->getHasMorePages()); | ||||
} | } | ||||
$header = $this->buildHeader($drequest); | $header = $this->buildHeader($drequest); | ||||
Show All 31 Lines | return $this->newPage() | ||||
->appendChild($view) | ->appendChild($view) | ||||
->addClass('diffusion-history-view'); | ->addClass('diffusion-history-view'); | ||||
} | } | ||||
private function buildHeader(DiffusionRequest $drequest) { | private function buildHeader(DiffusionRequest $drequest) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$repository = $drequest->getRepository(); | $repository = $drequest->getRepository(); | ||||
$no_path = !strlen($drequest->getPath()); | $no_path = $drequest->getPath() === null || !strlen($drequest->getPath()); | ||||
if ($no_path) { | if ($no_path) { | ||||
$header_text = pht('History'); | $header_text = pht('History'); | ||||
} else { | } else { | ||||
$header_text = $this->renderPathLinks($drequest, $mode = 'history'); | $header_text = $this->renderPathLinks($drequest, $mode = 'history'); | ||||
} | } | ||||
$header = id(new PHUIHeaderView()) | $header = id(new PHUIHeaderView()) | ||||
->setUser($viewer) | ->setUser($viewer) | ||||
Show All 18 Lines |