mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-28 20:18:13 +01:00
Add more information to Branch status page in Manage Repository
Summary: Adds an icon for default branch, status for branch status Test Plan: Review `hg` and `git` repositories, change default branch, etc. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D18443
This commit is contained in:
parent
68008dce60
commit
281fc19f3f
1 changed files with 21 additions and 0 deletions
|
@ -117,23 +117,44 @@ final class DiffusionRepositoryBranchesManagementPanel
|
||||||
$tracking = $repository->shouldTrackBranch($branch_name);
|
$tracking = $repository->shouldTrackBranch($branch_name);
|
||||||
$autoclosing = $repository->shouldAutocloseBranch($branch_name);
|
$autoclosing = $repository->shouldAutocloseBranch($branch_name);
|
||||||
|
|
||||||
|
$default = $repository->getDefaultBranch();
|
||||||
|
$icon = null;
|
||||||
|
if ($default == $branch->getShortName()) {
|
||||||
|
$icon = id(new PHUIIconView())
|
||||||
|
->setIcon('fa-code-fork');
|
||||||
|
}
|
||||||
|
|
||||||
|
$fields = $branch->getRawFields();
|
||||||
|
$closed = idx($fields, 'closed');
|
||||||
|
if ($closed) {
|
||||||
|
$status = pht('Closed');
|
||||||
|
} else {
|
||||||
|
$status = pht('Open');
|
||||||
|
}
|
||||||
|
|
||||||
$rows[] = array(
|
$rows[] = array(
|
||||||
|
$icon,
|
||||||
$branch_name,
|
$branch_name,
|
||||||
$tracking ? pht('Tracking') : pht('Off'),
|
$tracking ? pht('Tracking') : pht('Off'),
|
||||||
$autoclosing ? pht('Autoclose On') : pht('Off'),
|
$autoclosing ? pht('Autoclose On') : pht('Off'),
|
||||||
|
$status,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$branch_table = new AphrontTableView($rows);
|
$branch_table = new AphrontTableView($rows);
|
||||||
$branch_table->setHeaders(
|
$branch_table->setHeaders(
|
||||||
array(
|
array(
|
||||||
|
'',
|
||||||
pht('Branch'),
|
pht('Branch'),
|
||||||
pht('Track'),
|
pht('Track'),
|
||||||
pht('Autoclose'),
|
pht('Autoclose'),
|
||||||
|
pht('Status'),
|
||||||
));
|
));
|
||||||
$branch_table->setColumnClasses(
|
$branch_table->setColumnClasses(
|
||||||
array(
|
array(
|
||||||
|
'',
|
||||||
'pri',
|
'pri',
|
||||||
'narrow',
|
'narrow',
|
||||||
|
'narrow',
|
||||||
'wide',
|
'wide',
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue