1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-28 00:10:57 +01:00

Add indication of hg branch open/closed in branch list

Summary: Adds some basic UI for open / closed state when viewing a list of branches in Mercurial. Fixes T12838

Test Plan: Close and open branches, view list.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T12838

Differential Revision: https://secure.phabricator.com/D18447
This commit is contained in:
Chad Little 2017-08-21 08:51:39 -07:00
parent 295c806219
commit d2a3f2da73

View file

@ -74,14 +74,6 @@ final class DiffusionBranchListView extends DiffusionView {
}
}
$fields = $branch->getRawFields();
$closed = idx($fields, 'closed');
if ($closed) {
$status = pht('Closed');
} else {
$status = pht('Open');
}
$browse_href = $drequest->generateURI(
array(
'action' => 'browse',
@ -129,6 +121,18 @@ final class DiffusionBranchListView extends DiffusionView {
}
$item->addAttribute(array($datetime));
if ($can_close_branches) {
$fields = $branch->getRawFields();
$closed = idx($fields, 'closed');
if ($closed) {
$status = pht('Branch Closed');
$item->setDisabled(true);
} else {
$status = pht('Branch Open');
}
$item->addAttribute($status);
}
$list->addItem($item);
}