Page MenuHomePhabricator

D7737.diff
No OneTemporary

D7737.diff

Index: src/applications/phragment/controller/PhragmentBrowseController.php
===================================================================
--- src/applications/phragment/controller/PhragmentBrowseController.php
+++ src/applications/phragment/controller/PhragmentBrowseController.php
@@ -66,6 +66,10 @@
$item->addAttribute(pht(
'Latest Version %s',
$fragment->getLatestVersion()->getSequence()));
+ if ($fragment->isDeleted()) {
+ $item->setDisabled(true);
+ $item->addAttribute(pht('Deleted'));
+ }
} else {
$item->addAttribute('Directory');
}
Index: src/applications/phragment/controller/PhragmentController.php
===================================================================
--- src/applications/phragment/controller/PhragmentController.php
+++ src/applications/phragment/controller/PhragmentController.php
@@ -134,9 +134,15 @@
->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())));
Index: src/applications/phragment/controller/PhragmentHistoryController.php
===================================================================
--- src/applications/phragment/controller/PhragmentHistoryController.php
+++ src/applications/phragment/controller/PhragmentHistoryController.php
@@ -52,6 +52,11 @@
$version->getDateCreated(),
$viewer));
+ if ($version->getFilePHID() === null) {
+ $item->setDisabled(true);
+ $item->addAttribute('Deletion');
+ }
+
$disabled = !isset($files[$version->getFilePHID()]);
$action = id(new PHUIListItemView())
->setIcon('download')
Index: src/applications/phragment/storage/PhragmentFragment.php
===================================================================
--- src/applications/phragment/storage/PhragmentFragment.php
+++ src/applications/phragment/storage/PhragmentFragment.php
@@ -42,6 +42,10 @@
return $this->latestVersionPHID === null;
}
+ public function isDeleted() {
+ return $this->getLatestVersion()->getFilePHID() === null;
+ }
+
public function getLatestVersion() {
if ($this->latestVersionPHID === null) {
return null;

File Metadata

Mime Type
text/plain
Expires
Thu, May 16, 12:22 AM (2 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6290474
Default Alt Text
D7737.diff (2 KB)

Event Timeline