Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/view/DiffusionBranchListView.php
Show All 27 Lines | public function render() { | ||||
$buildables = $this->loadBuildables($commits); | $buildables = $this->loadBuildables($commits); | ||||
$have_builds = false; | $have_builds = false; | ||||
$can_close_branches = ($repository->isHg()); | $can_close_branches = ($repository->isHg()); | ||||
Javelin::initBehavior('phabricator-tooltips'); | Javelin::initBehavior('phabricator-tooltips'); | ||||
$list = id(new PHUIObjectItemListView()) | $list = id(new PHUIObjectItemListView()) | ||||
->setFlush(true) | |||||
->addClass('diffusion-history-list') | ->addClass('diffusion-history-list') | ||||
->addClass('diffusion-branch-list'); | ->addClass('diffusion-branch-list'); | ||||
$publisher = $repository->newPublisher(); | |||||
foreach ($this->branches as $branch) { | foreach ($this->branches as $branch) { | ||||
$build_view = null; | $build_view = null; | ||||
$button_bar = new PHUIButtonBarView(); | $button_bar = new PHUIButtonBarView(); | ||||
$commit = idx($commits, $branch->getCommitIdentifier()); | $commit = idx($commits, $branch->getCommitIdentifier()); | ||||
if ($commit) { | if ($commit) { | ||||
$details = $commit->getSummary(); | $details = $commit->getSummary(); | ||||
$datetime = phabricator_datetime($commit->getEpoch(), $viewer); | $datetime = phabricator_datetime($commit->getEpoch(), $viewer); | ||||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | foreach ($this->branches as $branch) { | ||||
))) | ))) | ||||
->setSubhead($subhead) | ->setSubhead($subhead) | ||||
->setSideColumn(array( | ->setSideColumn(array( | ||||
$build_view, | $build_view, | ||||
$button_bar, | $button_bar, | ||||
)); | )); | ||||
if ($branch->getShortName() == $repository->getDefaultBranch()) { | if ($branch->getShortName() == $repository->getDefaultBranch()) { | ||||
$item->setStatusIcon('fa-code-fork', pht('Default Branch')); | $item->setStatusIcon('fa-star', pht('Default Branch')); | ||||
} else { | |||||
if ($publisher->shouldPublishRef($branch)) { | |||||
$item->setStatusIcon('fa-code-fork', pht('Permanent Ref')); | |||||
} else { | |||||
$item->setStatusIcon( | |||||
'fa-folder-open-o grey', pht('Not a Permanent Ref')); | |||||
} | } | ||||
} | |||||
$item->addAttribute(array($datetime)); | $item->addAttribute(array($datetime)); | ||||
if ($can_close_branches) { | if ($can_close_branches) { | ||||
$fields = $branch->getRawFields(); | $fields = $branch->getRawFields(); | ||||
$closed = idx($fields, 'closed'); | $closed = idx($fields, 'closed'); | ||||
if ($closed) { | if ($closed) { | ||||
$status = pht('Branch Closed'); | $status = pht('Branch Closed'); | ||||
$item->setDisabled(true); | $item->setDisabled(true); | ||||
Show All 13 Lines |