From fd13275f7ea8269c36d3910b7cb1999e6fd1bdae Mon Sep 17 00:00:00 2001 From: Chad Little Date: Tue, 5 Mar 2013 08:05:51 -0800 Subject: [PATCH] Widen pinboard to 280x210. Summary: This widens pinboard images to 280x210, which neatly fits on an iPhone 4, and gives more visual space to Macros and Mocks. Test Plan: Test Pinboard in Chrome and iOS simulator. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5224 --- src/__celerity_resource_map__.php | 2 +- .../controller/PhabricatorFileTransformController.php | 3 +++ src/applications/files/storage/PhabricatorFile.php | 6 ++++++ .../macro/controller/PhabricatorMacroListController.php | 4 ++-- .../pholio/controller/PholioMockListController.php | 4 ++-- webroot/rsrc/css/layout/phabricator-pinboard-view.css | 8 ++++++-- 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php index ceca1f9538..2e444e3c2b 100644 --- a/src/__celerity_resource_map__.php +++ b/src/__celerity_resource_map__.php @@ -2889,7 +2889,7 @@ celerity_register_resource_map(array( ), 'phabricator-pinboard-view-css' => array( - 'uri' => '/res/c6af8d76/rsrc/css/layout/phabricator-pinboard-view.css', + 'uri' => '/res/dbd15ab7/rsrc/css/layout/phabricator-pinboard-view.css', 'type' => 'css', 'requires' => array( diff --git a/src/applications/files/controller/PhabricatorFileTransformController.php b/src/applications/files/controller/PhabricatorFileTransformController.php index 3cf5adeece..849de8ac07 100644 --- a/src/applications/files/controller/PhabricatorFileTransformController.php +++ b/src/applications/files/controller/PhabricatorFileTransformController.php @@ -49,6 +49,9 @@ final class PhabricatorFileTransformController $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); switch ($this->transform) { + case 'thumb-280x210': + $xformed_file = $this->executeThumbTransform($file, 280, 210); + break; case 'thumb-220x165': $xformed_file = $this->executeThumbTransform($file, 220, 165); break; diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php index 1f3c46e20d..3d4810d4e1 100644 --- a/src/applications/files/storage/PhabricatorFile.php +++ b/src/applications/files/storage/PhabricatorFile.php @@ -475,6 +475,12 @@ final class PhabricatorFile extends PhabricatorFileDAO return PhabricatorEnv::getCDNURI($path); } + public function getThumb280x210URI() { + $path = '/file/xform/thumb-280x210/'.$this->getPHID().'/' + .$this->getSecretKey().'/'; + return PhabricatorEnv::getCDNURI($path); + } + public function isViewableInBrowser() { return ($this->getViewableMimeType() !== null); } diff --git a/src/applications/macro/controller/PhabricatorMacroListController.php b/src/applications/macro/controller/PhabricatorMacroListController.php index 65a28e3a82..5ac2a388dd 100644 --- a/src/applications/macro/controller/PhabricatorMacroListController.php +++ b/src/applications/macro/controller/PhabricatorMacroListController.php @@ -120,8 +120,8 @@ final class PhabricatorMacroListController $item = new PhabricatorPinboardItemView(); if ($file) { - $item->setImageURI($file->getThumb220x165URI()); - $item->setImageSize(220, 165); + $item->setImageURI($file->getThumb280x210URI()); + $item->setImageSize(280, 210); if ($file->getAuthorPHID()) { $author_handle = $this->getHandle($file->getAuthorPHID()); $item->appendChild( diff --git a/src/applications/pholio/controller/PholioMockListController.php b/src/applications/pholio/controller/PholioMockListController.php index 70d8733ec2..e379aa1181 100644 --- a/src/applications/pholio/controller/PholioMockListController.php +++ b/src/applications/pholio/controller/PholioMockListController.php @@ -52,8 +52,8 @@ final class PholioMockListController extends PholioController { $item = new PhabricatorPinboardItemView(); $item->setHeader('M'.$mock->getID().' '.$mock->getName()) ->setURI('/M'.$mock->getID()) - ->setImageURI($mock->getCoverFile()->getThumb220x165URI()) - ->setImageSize(220, 165); + ->setImageURI($mock->getCoverFile()->getThumb280x210URI()) + ->setImageSize(280, 210); if ($mock->getAuthorPHID()) { $author_handle = $this->getHandle($mock->getAuthorPHID()); diff --git a/webroot/rsrc/css/layout/phabricator-pinboard-view.css b/webroot/rsrc/css/layout/phabricator-pinboard-view.css index f13979f259..71f1afe00a 100644 --- a/webroot/rsrc/css/layout/phabricator-pinboard-view.css +++ b/webroot/rsrc/css/layout/phabricator-pinboard-view.css @@ -8,6 +8,10 @@ margin: 1em 0; } +.device-phone .phabricator-pinboard-view { + padding: 0; +} + .phabricator-pinboard-item-view { margin: 0 16px 16px 0; border: 1px solid #d5d9df; @@ -15,7 +19,7 @@ border-radius: 3px; float: left; - width: 240px; + width: 300px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); text-align: left; } @@ -28,7 +32,7 @@ /* On phones, show a single column of items. */ .device-phone .phabricator-pinboard-item-view { float: none; - margin: 0 auto 10px; + margin: 0 auto 16px; } .phabricator-pinboard-item-header {