1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-03-25 18:50:15 +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:
Chad Little 2017-08-17 12:09:10 -07:00
parent 68008dce60
commit 281fc19f3f

View file

@ -117,23 +117,44 @@ final class DiffusionRepositoryBranchesManagementPanel
$tracking = $repository->shouldTrackBranch($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(
$icon,
$branch_name,
$tracking ? pht('Tracking') : pht('Off'),
$autoclosing ? pht('Autoclose On') : pht('Off'),
$status,
);
}
$branch_table = new AphrontTableView($rows);
$branch_table->setHeaders(
array(
'',
pht('Branch'),
pht('Track'),
pht('Autoclose'),
pht('Status'),
));
$branch_table->setColumnClasses(
array(
'',
'pri',
'narrow',
'narrow',
'wide',
));