Differential D21151 Diff 50367 src/applications/differential/controller/DifferentialRevisionViewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/controller/DifferentialRevisionViewController.php
| Show First 20 Lines • Show All 468 Lines • ▼ Show 20 Lines | public function handleRequest(AphrontRequest $request) { | ||||
| } | } | ||||
| $tab_group->addTab( | $tab_group->addTab( | ||||
| id(new PHUITabView()) | id(new PHUITabView()) | ||||
| ->setName(pht('History')) | ->setName(pht('History')) | ||||
| ->setKey('history') | ->setKey('history') | ||||
| ->appendChild($history)); | ->appendChild($history)); | ||||
| $filetree_on = $viewer->compareUserSetting( | $filetree = id(new DifferentialFileTreeEngine()) | ||||
| PhabricatorShowFiletreeSetting::SETTINGKEY, | ->setViewer($viewer); | ||||
| PhabricatorShowFiletreeSetting::VALUE_ENABLE_FILETREE); | |||||
| $collapsed_key = PhabricatorFiletreeVisibleSetting::SETTINGKEY; | $filetree_collapsed = !$filetree->getIsVisible(); | ||||
| $filetree_collapsed = (bool)$viewer->getUserSetting($collapsed_key); | |||||
| // See PHI811. If the viewer has the file tree on, the files tab with the | // See PHI811. If the viewer has the file tree on, the files tab with the | ||||
| // table of contents is redundant, so default to the "History" tab instead. | // table of contents is redundant, so default to the "History" tab instead. | ||||
| if ($filetree_on && !$filetree_collapsed) { | if (!$filetree_collapsed) { | ||||
| $tab_group->selectTab('history'); | $tab_group->selectTab('history'); | ||||
| } | } | ||||
| $tab_group->addTab( | $tab_group->addTab( | ||||
| id(new PHUITabView()) | id(new PHUITabView()) | ||||
| ->setName(pht('Commits')) | ->setName(pht('Commits')) | ||||
| ->setKey('commits') | ->setKey('commits') | ||||
| ->appendChild($local_table)); | ->appendChild($local_table)); | ||||
| ▲ Show 20 Lines • Show All 109 Lines • ▼ Show 20 Lines | public function handleRequest(AphrontRequest $request) { | ||||
| $monogram = $revision->getMonogram(); | $monogram = $revision->getMonogram(); | ||||
| $operations_box = $this->buildOperationsBox($revision); | $operations_box = $this->buildOperationsBox($revision); | ||||
| $crumbs = $this->buildApplicationCrumbs(); | $crumbs = $this->buildApplicationCrumbs(); | ||||
| $crumbs->addTextCrumb($monogram); | $crumbs->addTextCrumb($monogram); | ||||
| $crumbs->setBorder(true); | $crumbs->setBorder(true); | ||||
| $nav = null; | $filetree | ||||
| if ($filetree_on && !$this->isVeryLargeDiff()) { | ->setChangesets($changesets) | ||||
| $width_key = PhabricatorFiletreeWidthSetting::SETTINGKEY; | ->setDisabled($this->isVeryLargeDiff()); | ||||
| $width_value = $viewer->getUserSetting($width_key); | |||||
| $nav = id(new DifferentialChangesetFileTreeSideNavBuilder()) | |||||
| ->setTitle($monogram) | |||||
| ->setBaseURI(new PhutilURI($revision->getURI())) | |||||
| ->setCollapsed($filetree_collapsed) | |||||
| ->setWidth((int)$width_value) | |||||
| ->build($changesets); | |||||
| } | |||||
| $view = id(new PHUITwoColumnView()) | $view = id(new PHUITwoColumnView()) | ||||
| ->setHeader($header) | ->setHeader($header) | ||||
| ->setSubheader($subheader) | ->setSubheader($subheader) | ||||
| ->setCurtain($curtain) | ->setCurtain($curtain) | ||||
| ->setMainColumn( | ->setMainColumn( | ||||
| array( | array( | ||||
| $operations_box, | $operations_box, | ||||
| $info_view, | $info_view, | ||||
| $details, | $details, | ||||
| $diff_detail_box, | $diff_detail_box, | ||||
| $unit_box, | $unit_box, | ||||
| $timeline, | $timeline, | ||||
| $signature_message, | $signature_message, | ||||
| )) | )) | ||||
| ->setFooter($footer); | ->setFooter($footer); | ||||
| $main_content = array( | |||||
| $crumbs, | |||||
| $view, | |||||
| ); | |||||
| $main_content = $filetree->newView($main_content); | |||||
| if (!$filetree->getDisabled()) { | |||||
| $changeset_view->setFormationView($main_content); | |||||
| } | |||||
| $page = $this->newPage() | $page = $this->newPage() | ||||
| ->setTitle($monogram.' '.$revision->getTitle()) | ->setTitle($monogram.' '.$revision->getTitle()) | ||||
| ->setCrumbs($crumbs) | |||||
| ->setPageObjectPHIDs(array($revision->getPHID())) | ->setPageObjectPHIDs(array($revision->getPHID())) | ||||
| ->appendChild($view); | ->appendChild($main_content); | ||||
| if ($nav) { | |||||
| $page->setNavigation($nav); | |||||
| } | |||||
| return $page; | return $page; | ||||
| } | } | ||||
| private function buildHeader(DifferentialRevision $revision) { | private function buildHeader(DifferentialRevision $revision) { | ||||
| $view = id(new PHUIHeaderView()) | $view = id(new PHUIHeaderView()) | ||||
| ->setHeader($revision->getTitle($revision)) | ->setHeader($revision->getTitle($revision)) | ||||
| ->setUser($this->getViewer()) | ->setUser($this->getViewer()) | ||||
| ▲ Show 20 Lines • Show All 788 Lines • Show Last 20 Lines | |||||