mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-02 09:58:24 +01:00
Make content more prominent in Files and move some details to the curtain
Summary: Ref T13528. Now that we're hinting users into Files, put the content first and move the detail panel under it. Move the most-useful details (author, size, dimensions) into the curtain. Test Plan: {F7409925} Maniphest Tasks: T13528 Differential Revision: https://secure.phabricator.com/D21201
This commit is contained in:
parent
1edca1ee2a
commit
fbbd2e35cb
1 changed files with 48 additions and 51 deletions
|
@ -81,8 +81,8 @@ final class PhabricatorFileViewController extends PhabricatorFileController {
|
||||||
->setCurtain($curtain)
|
->setCurtain($curtain)
|
||||||
->setMainColumn(
|
->setMainColumn(
|
||||||
array(
|
array(
|
||||||
$object_box,
|
|
||||||
$file_content,
|
$file_content,
|
||||||
|
$object_box,
|
||||||
$timeline,
|
$timeline,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -171,6 +171,47 @@ final class PhabricatorFileViewController extends PhabricatorFileController {
|
||||||
->setIcon('fa-crop')
|
->setIcon('fa-crop')
|
||||||
->setHref($this->getApplicationURI("/transforms/{$id}/")));
|
->setHref($this->getApplicationURI("/transforms/{$id}/")));
|
||||||
|
|
||||||
|
$phids = array();
|
||||||
|
|
||||||
|
$viewer_phid = $viewer->getPHID();
|
||||||
|
$author_phid = $file->getAuthorPHID();
|
||||||
|
if ($author_phid) {
|
||||||
|
$phids[] = $author_phid;
|
||||||
|
}
|
||||||
|
|
||||||
|
$handles = $viewer->loadHandles($phids);
|
||||||
|
|
||||||
|
if ($author_phid) {
|
||||||
|
$author_refs = id(new PHUICurtainObjectRefListView())
|
||||||
|
->setViewer($viewer);
|
||||||
|
|
||||||
|
$author_ref = $author_refs->newObjectRefView()
|
||||||
|
->setHandle($handles[$author_phid])
|
||||||
|
->setEpoch($file->getDateCreated())
|
||||||
|
->setHighlighted($author_phid === $viewer_phid);
|
||||||
|
|
||||||
|
$curtain->newPanel()
|
||||||
|
->setHeaderText(pht('Authored By'))
|
||||||
|
->appendChild($author_refs);
|
||||||
|
}
|
||||||
|
|
||||||
|
$curtain->newPanel()
|
||||||
|
->setHeaderText(pht('Size'))
|
||||||
|
->appendChild(phutil_format_bytes($file->getByteSize()));
|
||||||
|
|
||||||
|
$width = $file->getImageWidth();
|
||||||
|
$height = $file->getImageHeight();
|
||||||
|
|
||||||
|
if ($width || $height) {
|
||||||
|
$curtain->newPanel()
|
||||||
|
->setHeaderText(pht('Dimensions'))
|
||||||
|
->appendChild(
|
||||||
|
pht(
|
||||||
|
"%spx \xC3\x97 %spx",
|
||||||
|
new PhutilNumber($width),
|
||||||
|
new PhutilNumber($height)));
|
||||||
|
}
|
||||||
|
|
||||||
return $curtain;
|
return $curtain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,36 +224,14 @@ final class PhabricatorFileViewController extends PhabricatorFileController {
|
||||||
$tab_group = id(new PHUITabGroupView());
|
$tab_group = id(new PHUITabGroupView());
|
||||||
$box->addTabGroup($tab_group);
|
$box->addTabGroup($tab_group);
|
||||||
|
|
||||||
$properties = id(new PHUIPropertyListView());
|
$finfo = new PHUIPropertyListView();
|
||||||
|
|
||||||
$tab_group->addTab(
|
$tab_group->addTab(
|
||||||
id(new PHUITabView())
|
id(new PHUITabView())
|
||||||
->setName(pht('Details'))
|
->setName(pht('Details'))
|
||||||
->setKey('details')
|
->setKey('details')
|
||||||
->appendChild($properties));
|
|
||||||
|
|
||||||
if ($file->getAuthorPHID()) {
|
|
||||||
$properties->addProperty(
|
|
||||||
pht('Author'),
|
|
||||||
$viewer->renderHandle($file->getAuthorPHID()));
|
|
||||||
}
|
|
||||||
|
|
||||||
$properties->addProperty(
|
|
||||||
pht('Created'),
|
|
||||||
phabricator_datetime($file->getDateCreated(), $viewer));
|
|
||||||
|
|
||||||
$finfo = id(new PHUIPropertyListView());
|
|
||||||
|
|
||||||
$tab_group->addTab(
|
|
||||||
id(new PHUITabView())
|
|
||||||
->setName(pht('File Info'))
|
|
||||||
->setKey('info')
|
|
||||||
->appendChild($finfo));
|
->appendChild($finfo));
|
||||||
|
|
||||||
$finfo->addProperty(
|
|
||||||
pht('Size'),
|
|
||||||
phutil_format_bytes($file->getByteSize()));
|
|
||||||
|
|
||||||
$finfo->addProperty(
|
$finfo->addProperty(
|
||||||
pht('Mime Type'),
|
pht('Mime Type'),
|
||||||
$file->getMimeType());
|
$file->getMimeType());
|
||||||
|
@ -229,20 +248,6 @@ final class PhabricatorFileViewController extends PhabricatorFileController {
|
||||||
phutil_format_relative_time_detailed($delta)));
|
phutil_format_relative_time_detailed($delta)));
|
||||||
}
|
}
|
||||||
|
|
||||||
$width = $file->getImageWidth();
|
|
||||||
if ($width) {
|
|
||||||
$finfo->addProperty(
|
|
||||||
pht('Width'),
|
|
||||||
pht('%s px', new PhutilNumber($width)));
|
|
||||||
}
|
|
||||||
|
|
||||||
$height = $file->getImageHeight();
|
|
||||||
if ($height) {
|
|
||||||
$finfo->addProperty(
|
|
||||||
pht('Height'),
|
|
||||||
pht('%s px', new PhutilNumber($height)));
|
|
||||||
}
|
|
||||||
|
|
||||||
$is_image = $file->isViewableImage();
|
$is_image = $file->isViewableImage();
|
||||||
if ($is_image) {
|
if ($is_image) {
|
||||||
$image_string = pht('Yes');
|
$image_string = pht('Yes');
|
||||||
|
@ -283,16 +288,8 @@ final class PhabricatorFileViewController extends PhabricatorFileController {
|
||||||
$finfo->addProperty(pht('Attributes'), $types);
|
$finfo->addProperty(pht('Attributes'), $types);
|
||||||
}
|
}
|
||||||
|
|
||||||
$storage_properties = new PHUIPropertyListView();
|
$finfo->addProperty(
|
||||||
|
pht('Storage Engine'),
|
||||||
$tab_group->addTab(
|
|
||||||
id(new PHUITabView())
|
|
||||||
->setName(pht('Storage'))
|
|
||||||
->setKey('storage')
|
|
||||||
->appendChild($storage_properties));
|
|
||||||
|
|
||||||
$storage_properties->addProperty(
|
|
||||||
pht('Engine'),
|
|
||||||
$file->getStorageEngine());
|
$file->getStorageEngine());
|
||||||
|
|
||||||
$engine = $this->loadStorageEngine($file);
|
$engine = $this->loadStorageEngine($file);
|
||||||
|
@ -307,10 +304,10 @@ final class PhabricatorFileViewController extends PhabricatorFileController {
|
||||||
$format_name = pht('Unknown ("%s")', $format_key);
|
$format_name = pht('Unknown ("%s")', $format_key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$storage_properties->addProperty(pht('Format'), $format_name);
|
$finfo->addProperty(pht('Storage Format'), $format_name);
|
||||||
|
|
||||||
$storage_properties->addProperty(
|
$finfo->addProperty(
|
||||||
pht('Handle'),
|
pht('Storage Handle'),
|
||||||
$file->getStorageHandle());
|
$file->getStorageHandle());
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue