Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionTagListController.php
| Show All 39 Lines | switch ($repository->getVersionControlSystem()) { | ||||
| 'diffusion.tagsquery', | 'diffusion.tagsquery', | ||||
| $params); | $params); | ||||
| $tags = DiffusionRepositoryTag::newFromConduit($conduit_result); | $tags = DiffusionRepositoryTag::newFromConduit($conduit_result); | ||||
| break; | break; | ||||
| } | } | ||||
| $tags = $pager->sliceResults($tags); | $tags = $pager->sliceResults($tags); | ||||
| $content = null; | $content = null; | ||||
| $header = id(new PHUIHeaderView()) | |||||
| ->setHeader(pht('Tags')) | |||||
| ->setHeaderIcon('fa-tags'); | |||||
| if (!$tags) { | if (!$tags) { | ||||
| $content = $this->renderStatusMessage( | $content = $this->renderStatusMessage( | ||||
| pht('No Tags'), | pht('No Tags'), | ||||
| $is_commit | $is_commit | ||||
| ? pht('This commit has no tags.') | ? pht('This commit has no tags.') | ||||
| : pht('This repository has no tags.')); | : pht('This repository has no tags.')); | ||||
| } else { | } else { | ||||
| $commits = id(new DiffusionCommitQuery()) | $commits = id(new DiffusionCommitQuery()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->withRepository($repository) | ->withRepository($repository) | ||||
| ->withIdentifiers(mpull($tags, 'getCommitIdentifier')) | ->withIdentifiers(mpull($tags, 'getCommitIdentifier')) | ||||
| ->needCommitData(true) | ->needCommitData(true) | ||||
| ->execute(); | ->execute(); | ||||
| $view = id(new DiffusionTagListView()) | $view = id(new DiffusionTagListView()) | ||||
| ->setTags($tags) | ->setTags($tags) | ||||
| ->setUser($viewer) | ->setUser($viewer) | ||||
| ->setCommits($commits) | ->setCommits($commits) | ||||
| ->setDiffusionRequest($drequest); | ->setDiffusionRequest($drequest); | ||||
| $phids = $view->getRequiredHandlePHIDs(); | $phids = $view->getRequiredHandlePHIDs(); | ||||
| $handles = $this->loadViewerHandles($phids); | $handles = $this->loadViewerHandles($phids); | ||||
| $view->setHandles($handles); | $view->setHandles($handles); | ||||
| $panel = id(new PHUIObjectBoxView()) | $content = $view; | ||||
| ->setHeaderText(pht('Tags')) | |||||
| ->appendChild($view); | |||||
| $content = $panel; | |||||
| } | } | ||||
| $crumbs = $this->buildCrumbs( | $crumbs = $this->buildCrumbs( | ||||
| array( | array( | ||||
| 'tags' => true, | 'tags' => true, | ||||
| 'commit' => $drequest->getSymbolicCommit(), | 'commit' => $drequest->getSymbolicCommit(), | ||||
| )); | )); | ||||
| $crumbs->setBorder(true); | |||||
| $box = id(new PHUIObjectBoxView()) | |||||
| ->setHeaderText($repository->getDisplayName()) | |||||
| ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) | |||||
| ->setTable($view); | |||||
| $pager_box = $this->renderTablePagerBox($pager); | $pager_box = $this->renderTablePagerBox($pager); | ||||
| $view = id(new PHUITwoColumnView()) | |||||
| ->setHeader($header) | |||||
| ->setFooter(array( | |||||
| $box, | |||||
| $pager_box, | |||||
| )); | |||||
| return $this->newPage() | return $this->newPage() | ||||
| ->setTitle( | ->setTitle( | ||||
| array( | array( | ||||
| pht('Tags'), | pht('Tags'), | ||||
| $repository->getDisplayName(), | $repository->getDisplayName(), | ||||
| )) | )) | ||||
| ->setCrumbs($crumbs) | ->setCrumbs($crumbs) | ||||
| ->appendChild( | ->appendChild($view); | ||||
| array( | |||||
| $content, | |||||
| $pager_box, | |||||
| )); | |||||
| } | } | ||||
| } | } | ||||