diff --git a/src/applications/phragment/controller/PhragmentBrowseController.php b/src/applications/phragment/controller/PhragmentBrowseController.php index adb4c0d796..852f1e8644 100644 --- a/src/applications/phragment/controller/PhragmentBrowseController.php +++ b/src/applications/phragment/controller/PhragmentBrowseController.php @@ -66,6 +66,10 @@ final class PhragmentBrowseController extends PhragmentController { $item->addAttribute(pht( 'Latest Version %s', $fragment->getLatestVersion()->getSequence())); + if ($fragment->isDeleted()) { + $item->setDisabled(true); + $item->addAttribute(pht('Deleted')); + } } else { $item->addAttribute('Directory'); } diff --git a/src/applications/phragment/controller/PhragmentController.php b/src/applications/phragment/controller/PhragmentController.php index d156745f4b..ac5d43c032 100644 --- a/src/applications/phragment/controller/PhragmentController.php +++ b/src/applications/phragment/controller/PhragmentController.php @@ -134,9 +134,15 @@ abstract class PhragmentController extends PhabricatorController { ->setActionList($actions); if (!$fragment->isDirectory()) { - $properties->addProperty( - pht('Type'), - pht('File')); + if ($fragment->isDeleted()) { + $properties->addProperty( + pht('Type'), + pht('File (Deleted)')); + } else { + $properties->addProperty( + pht('Type'), + pht('File')); + } $properties->addProperty( pht('Latest Version'), $this->renderHandlesForPHIDs(array($fragment->getLatestVersionPHID()))); diff --git a/src/applications/phragment/controller/PhragmentHistoryController.php b/src/applications/phragment/controller/PhragmentHistoryController.php index 4ca50c0f3a..53cac0c360 100644 --- a/src/applications/phragment/controller/PhragmentHistoryController.php +++ b/src/applications/phragment/controller/PhragmentHistoryController.php @@ -52,6 +52,11 @@ final class PhragmentHistoryController extends PhragmentController { $version->getDateCreated(), $viewer)); + if ($version->getFilePHID() === null) { + $item->setDisabled(true); + $item->addAttribute('Deletion'); + } + $disabled = !isset($files[$version->getFilePHID()]); $action = id(new PHUIListItemView()) ->setIcon('download') diff --git a/src/applications/phragment/storage/PhragmentFragment.php b/src/applications/phragment/storage/PhragmentFragment.php index 87caf483e3..446c306acd 100644 --- a/src/applications/phragment/storage/PhragmentFragment.php +++ b/src/applications/phragment/storage/PhragmentFragment.php @@ -42,6 +42,10 @@ final class PhragmentFragment extends PhragmentDAO return $this->latestVersionPHID === null; } + public function isDeleted() { + return $this->getLatestVersion()->getFilePHID() === null; + } + public function getLatestVersion() { if ($this->latestVersionPHID === null) { return null;