Differential D19857 Diff 47420 src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php
Show All 17 Lines | public function shouldEnableForRepository( | ||||
return ($repository->isGit() || $repository->isHg()); | return ($repository->isGit() || $repository->isHg()); | ||||
} | } | ||||
public function getManagementPanelIcon() { | public function getManagementPanelIcon() { | ||||
$repository = $this->getRepository(); | $repository = $this->getRepository(); | ||||
$has_any = | $has_any = | ||||
$repository->getDetail('default-branch') || | $repository->getDetail('default-branch') || | ||||
$repository->getDetail('branch-filter') || | $repository->getTrackOnlyRules() || | ||||
$repository->getAutocloseOnlyRules(); | $repository->getAutocloseOnlyRules(); | ||||
if ($has_any) { | if ($has_any) { | ||||
return 'fa-code-fork'; | return 'fa-code-fork'; | ||||
} else { | } else { | ||||
return 'fa-code-fork grey'; | return 'fa-code-fork grey'; | ||||
} | } | ||||
} | } | ||||
Show All 34 Lines | public function buildManagementPanelContent() { | ||||
$repository = $this->getRepository(); | $repository = $this->getRepository(); | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$content = array(); | $content = array(); | ||||
$view = id(new PHUIPropertyListView()) | $view = id(new PHUIPropertyListView()) | ||||
->setViewer($viewer); | ->setViewer($viewer); | ||||
$default_branch = nonempty( | $default_branch = nonempty( | ||||
$repository->getHumanReadableDetail('default-branch'), | $repository->getDetail('default-branch'), | ||||
phutil_tag('em', array(), $repository->getDefaultBranch())); | phutil_tag('em', array(), $repository->getDefaultBranch())); | ||||
$view->addProperty(pht('Default Branch'), $default_branch); | $view->addProperty(pht('Default Branch'), $default_branch); | ||||
$track_only_rules = $repository->getTrackOnlyRules(); | |||||
$track_only_rules = implode(', ', $track_only_rules); | |||||
$track_only = nonempty( | $track_only = nonempty( | ||||
$repository->getHumanReadableDetail('branch-filter', array()), | $track_only_rules, | ||||
phutil_tag('em', array(), pht('Track All Branches'))); | phutil_tag('em', array(), pht('Track All Branches'))); | ||||
$view->addProperty(pht('Track Only'), $track_only); | $view->addProperty(pht('Track Only'), $track_only); | ||||
$autoclose_rules = $repository->getAutocloseOnlyRules(); | $autoclose_rules = $repository->getAutocloseOnlyRules(); | ||||
$autoclose_rules = implode(', ', $autoclose_rules); | $autoclose_rules = implode(', ', $autoclose_rules); | ||||
$autoclose_only = nonempty( | $autoclose_only = nonempty( | ||||
$autoclose_rules, | $autoclose_rules, | ||||
phutil_tag('em', array(), pht('Autoclose On All Branches'))); | phutil_tag('em', array(), pht('Autoclose On All Branches'))); | ||||
▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines |