Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13961314
D15631.id37667.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
11 KB
Referenced Files
None
Subscribers
None
D15631.id37667.diff
View Options
diff --git a/src/applications/files/controller/PhabricatorFileComposeController.php b/src/applications/files/controller/PhabricatorFileComposeController.php
--- a/src/applications/files/controller/PhabricatorFileComposeController.php
+++ b/src/applications/files/controller/PhabricatorFileComposeController.php
@@ -155,8 +155,7 @@
'defaultIcon' => $value_icon,
));
- $dialog = id(new AphrontDialogView())
- ->setUser($viewer)
+ return $this->newDialog()
->setFormID($dialog_id)
->setClass('compose-dialog')
->setTitle(pht('Compose Image'))
@@ -188,8 +187,6 @@
->appendChild($icon_input)
->addCancelButton('/')
->addSubmitButton(pht('Save Image'));
-
- return id(new AphrontDialogResponse())->setDialog($dialog);
}
private function getIconMap() {
diff --git a/src/applications/files/controller/PhabricatorFileDeleteController.php b/src/applications/files/controller/PhabricatorFileDeleteController.php
--- a/src/applications/files/controller/PhabricatorFileDeleteController.php
+++ b/src/applications/files/controller/PhabricatorFileDeleteController.php
@@ -29,17 +29,14 @@
return id(new AphrontRedirectResponse())->setURI('/file/');
}
- $dialog = new AphrontDialogView();
- $dialog->setUser($viewer);
- $dialog->setTitle(pht('Really delete file?'));
- $dialog->appendChild(hsprintf(
+ return $this->newDialog()
+ ->setTitle(pht('Really delete file?'))
+ ->appendChild(hsprintf(
'<p>%s</p>',
pht(
- "Permanently delete '%s'? This action can not be undone.",
- $file->getName())));
- $dialog->addSubmitButton(pht('Delete'));
- $dialog->addCancelButton($file->getInfoURI());
-
- return id(new AphrontDialogResponse())->setDialog($dialog);
+ 'Permanently delete "%s"? This action can not be undone.',
+ $file->getName())))
+ ->addSubmitButton(pht('Delete'))
+ ->addCancelButton($file->getInfoURI());
}
}
diff --git a/src/applications/files/controller/PhabricatorFileEditController.php b/src/applications/files/controller/PhabricatorFileEditController.php
--- a/src/applications/files/controller/PhabricatorFileEditController.php
+++ b/src/applications/files/controller/PhabricatorFileEditController.php
@@ -19,8 +19,9 @@
return new Aphront404Response();
}
- $title = pht('Edit %s', $file->getName());
+ $title = pht('Edit File: %s', $file->getName());
$file_name = $file->getName();
+ $header_icon = 'fa-pencil';
$view_uri = '/'.$file->getMonogram();
$error_name = true;
$validation_exception = null;
@@ -86,21 +87,28 @@
$crumbs = $this->buildApplicationCrumbs()
->addTextCrumb($file->getMonogram(), $view_uri)
- ->addTextCrumb(pht('Edit'));
+ ->addTextCrumb(pht('Edit'))
+ ->setBorder(true);
- $object_box = id(new PHUIObjectBoxView())
+ $box = id(new PHUIObjectBoxView())
->setHeaderText($title)
->setValidationException($validation_exception)
+ ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($form);
- return $this->buildApplicationPage(
- array(
- $crumbs,
- $object_box,
- ),
- array(
- 'title' => $title,
- ));
+ $header = id(new PHUIHeaderView())
+ ->setHeader($title)
+ ->setHeaderIcon($header_icon);
+
+ $view = id(new PHUITwoColumnView())
+ ->setHeader($header)
+ ->setFooter($box);
+
+ return $this->newPage()
+ ->setTitle($title)
+ ->setCrumbs($crumbs)
+ ->appendChild($view);
+
}
}
diff --git a/src/applications/files/controller/PhabricatorFileInfoController.php b/src/applications/files/controller/PhabricatorFileInfoController.php
--- a/src/applications/files/controller/PhabricatorFileInfoController.php
+++ b/src/applications/files/controller/PhabricatorFileInfoController.php
@@ -35,7 +35,8 @@
$header = id(new PHUIHeaderView())
->setUser($viewer)
->setPolicyObject($file)
- ->setHeader($file->getName());
+ ->setHeader($file->getName())
+ ->setHeaderIcon('fa-file-o');
$ttl = $file->getTTL();
if ($ttl !== null) {
@@ -55,28 +56,35 @@
$header->addTag($partial_tag);
}
- $actions = $this->buildActionView($file);
+ $curtain = $this->buildCurtainView($file);
$timeline = $this->buildTransactionView($file);
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(
'F'.$file->getID(),
$this->getApplicationURI("/info/{$phid}/"));
+ $crumbs->setBorder(true);
$object_box = id(new PHUIObjectBoxView())
- ->setHeader($header);
+ ->setHeaderText(pht('File'))
+ ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY);
- $this->buildPropertyViews($object_box, $file, $actions);
+ $this->buildPropertyViews($object_box, $file);
+ $title = $file->getName();
- return $this->buildApplicationPage(
- array(
- $crumbs,
+ $view = id(new PHUITwoColumnView())
+ ->setHeader($header)
+ ->setCurtain($curtain)
+ ->setMainColumn(array(
$object_box,
$timeline,
- ),
- array(
- 'title' => $file->getName(),
- 'pageObjects' => array($file->getPHID()),
));
+
+ return $this->newPage()
+ ->setTitle($title)
+ ->setCrumbs($crumbs)
+ ->setPageObjectPHIDs(array($file->getPHID()))
+ ->appendChild($view);
+
}
private function buildTransactionView(PhabricatorFile $file) {
@@ -108,7 +116,7 @@
);
}
- private function buildActionView(PhabricatorFile $file) {
+ private function buildCurtainView(PhabricatorFile $file) {
$viewer = $this->getViewer();
$id = $file->getID();
@@ -118,14 +126,12 @@
$file,
PhabricatorPolicyCapability::CAN_EDIT);
- $view = id(new PhabricatorActionListView())
- ->setUser($viewer)
- ->setObject($file);
+ $curtain = $this->newCurtainView($file);
$can_download = !$file->getIsPartial();
if ($file->isViewableInBrowser()) {
- $view->addAction(
+ $curtain->addAction(
id(new PhabricatorActionView())
->setName(pht('View File'))
->setIcon('fa-file-o')
@@ -133,7 +139,7 @@
->setDisabled(!$can_download)
->setWorkflow(!$can_download));
} else {
- $view->addAction(
+ $curtain->addAction(
id(new PhabricatorActionView())
->setUser($viewer)
->setRenderAsForm($can_download)
@@ -145,7 +151,7 @@
->setWorkflow(!$can_download));
}
- $view->addAction(
+ $curtain->addAction(
id(new PhabricatorActionView())
->setName(pht('Edit File'))
->setIcon('fa-pencil')
@@ -153,7 +159,7 @@
->setWorkflow(!$can_edit)
->setDisabled(!$can_edit));
- $view->addAction(
+ $curtain->addAction(
id(new PhabricatorActionView())
->setName(pht('Delete File'))
->setIcon('fa-times')
@@ -161,24 +167,22 @@
->setWorkflow(true)
->setDisabled(!$can_edit));
- $view->addAction(
+ $curtain->addAction(
id(new PhabricatorActionView())
->setName(pht('View Transforms'))
->setIcon('fa-crop')
->setHref($this->getApplicationURI("/transforms/{$id}/")));
- return $view;
+ return $curtain;
}
private function buildPropertyViews(
PHUIObjectBoxView $box,
- PhabricatorFile $file,
- PhabricatorActionListView $actions) {
+ PhabricatorFile $file) {
$request = $this->getRequest();
$viewer = $request->getUser();
$properties = id(new PHUIPropertyListView());
- $properties->setActionList($actions);
$box->addPropertyList($properties, pht('Details'));
if ($file->getAuthorPHID()) {
diff --git a/src/applications/files/controller/PhabricatorFileTransformListController.php b/src/applications/files/controller/PhabricatorFileTransformListController.php
--- a/src/applications/files/controller/PhabricatorFileTransformListController.php
+++ b/src/applications/files/controller/PhabricatorFileTransformListController.php
@@ -113,26 +113,35 @@
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($monogram, '/'.$monogram);
$crumbs->addTextCrumb(pht('Transforms'));
+ $crumbs->setBorder(true);
$dst_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('File Sources'))
+ ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setTable($dst_table);
$src_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Available Transforms'))
+ ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setTable($src_table);
- return $this->buildApplicationPage(
- array(
- $crumbs,
+ $title = pht('%s Transforms', $file->getName());
+
+ $header = id(new PHUIHeaderView())
+ ->setHeader($title)
+ ->setHeaderIcon('fa-arrows-alt');
+
+ $view = id(new PHUITwoColumnView())
+ ->setHeader($header)
+ ->setFooter(array(
$dst_box,
$src_box,
- ),
- array(
- 'title' => array(
- pht('%s %s', $monogram, $file->getName()),
- pht('Tranforms'),
- ),
));
+
+ return $this->newPage()
+ ->setTitle($title)
+ ->setCrumbs($crumbs)
+ ->appendChild($view);
+
}
}
diff --git a/src/applications/files/controller/PhabricatorFileUploadController.php b/src/applications/files/controller/PhabricatorFileUploadController.php
--- a/src/applications/files/controller/PhabricatorFileUploadController.php
+++ b/src/applications/files/controller/PhabricatorFileUploadController.php
@@ -81,6 +81,7 @@
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Upload'), $request->getRequestURI());
+ $crumbs->setBorder(true);
$title = pht('Upload File');
@@ -89,19 +90,26 @@
->setShowIfSupportedID($support_id);
$form_box = id(new PHUIObjectBoxView())
- ->setHeaderText($title)
+ ->setHeaderText(pht('File'))
->setFormErrors($errors)
+ ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form);
- return $this->buildApplicationPage(
- array(
- $crumbs,
+ $header = id(new PHUIHeaderView())
+ ->setHeader($title)
+ ->setHeaderIcon('fa-upload');
+
+ $view = id(new PHUITwoColumnView())
+ ->setHeader($header)
+ ->setFooter(array(
$form_box,
$global_upload,
- ),
- array(
- 'title' => $title,
));
+
+ return $this->newPage()
+ ->setTitle($title)
+ ->setCrumbs($crumbs)
+ ->appendChild($view);
}
}
diff --git a/src/applications/files/controller/PhabricatorFileUploadDialogController.php b/src/applications/files/controller/PhabricatorFileUploadDialogController.php
--- a/src/applications/files/controller/PhabricatorFileUploadDialogController.php
+++ b/src/applications/files/controller/PhabricatorFileUploadDialogController.php
@@ -6,14 +6,12 @@
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
- $dialog = id(new AphrontDialogView())
- ->setUser($viewer)
+ return $this->newDialog()
->setTitle(pht('Upload File'))
->appendChild(pht(
'To add files, drag and drop them into the comment text area.'))
->addCancelButton('/', pht('Close'));
- return id(new AphrontDialogResponse())->setDialog($dialog);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 16 2024, 4:23 AM (4 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6715902
Default Alt Text
D15631.id37667.diff (11 KB)
Attached To
Mode
D15631: Update Files to new UI
Attached
Detach File
Event Timeline
Log In to Comment