Differential D15487 Diff 37335 src/applications/diffusion/controller/DiffusionBranchTableController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionBranchTableController.php
| Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | if (!$branches) { | ||||
| pht('This repository has no branches.')); | pht('This repository has no branches.')); | ||||
| } else { | } else { | ||||
| $commits = id(new DiffusionCommitQuery()) | $commits = id(new DiffusionCommitQuery()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->withIdentifiers(mpull($branches, 'getCommitIdentifier')) | ->withIdentifiers(mpull($branches, 'getCommitIdentifier')) | ||||
| ->withRepository($repository) | ->withRepository($repository) | ||||
| ->execute(); | ->execute(); | ||||
| $view = id(new DiffusionBranchTableView()) | $table = id(new DiffusionBranchTableView()) | ||||
| ->setUser($viewer) | ->setUser($viewer) | ||||
| ->setBranches($branches) | ->setBranches($branches) | ||||
| ->setCommits($commits) | ->setCommits($commits) | ||||
| ->setDiffusionRequest($drequest); | ->setDiffusionRequest($drequest); | ||||
| $panel = id(new PHUIObjectBoxView()) | $content = id(new PHUIObjectBoxView()) | ||||
| ->setHeaderText(pht('Branches')) | ->setHeaderText($repository->getName()) | ||||
| ->setTable($view); | ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | ||||
| ->setTable($table); | |||||
| $content = $panel; | |||||
| } | } | ||||
| $crumbs = $this->buildCrumbs( | $crumbs = $this->buildCrumbs( | ||||
| array( | array( | ||||
| 'branches' => true, | 'branches' => true, | ||||
| )); | )); | ||||
| $crumbs->setBorder(true); | |||||
| $pager_box = $this->renderTablePagerBox($pager); | $pager_box = $this->renderTablePagerBox($pager); | ||||
| $header = id(new PHUIHeaderView()) | |||||
| ->setHeader(pht('Branches')) | |||||
| ->setHeaderIcon('fa-code-fork'); | |||||
| $view = id(new PHUITwoColumnView()) | |||||
| ->setHeader($header) | |||||
| ->setFooter(array( | |||||
| $content, | |||||
| $pager_box, | |||||
| )); | |||||
| return $this->newPage() | return $this->newPage() | ||||
| ->setTitle( | ->setTitle( | ||||
| array( | array( | ||||
| pht('Branches'), | pht('Branches'), | ||||
| $repository->getDisplayName(), | $repository->getDisplayName(), | ||||
| )) | )) | ||||
| ->setCrumbs($crumbs) | ->setCrumbs($crumbs) | ||||
| ->appendChild( | ->appendChild( | ||||
| array( | array( | ||||
| $content, | $view, | ||||
| $pager_box, | |||||
| )); | )); | ||||
| } | } | ||||
| } | } | ||||