From 25db3f44a028fdbd69f4c3620edb15d3aa2b00f9 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Sun, 22 Jun 2014 11:09:05 -0700 Subject: [PATCH] Replace 'Embed' hint on Pholio Summary: Replaces Embed hint with where the heck you are hint. Test Plan: Tested current and previous mock images. Reviewers: epriestley Reviewed By: epriestley Subscribers: epriestley, Korvin Maniphest Tasks: T5384 Differential Revision: https://secure.phabricator.com/D9658 --- resources/celerity/map.php | 10 +++++----- .../pholio/view/PholioMockImagesView.php | 8 +++++++- webroot/rsrc/css/application/pholio/pholio.css | 4 ++++ .../pholio/behavior-pholio-mock-view.js | 16 +++++++++++----- 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index aa6df7f798..69a3ef44b9 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -81,7 +81,7 @@ return array( 'rsrc/css/application/phame/phame.css' => '19ecc703', 'rsrc/css/application/pholio/pholio-edit.css' => '3ad9d1ee', 'rsrc/css/application/pholio/pholio-inline-comments.css' => '2703fdb9', - 'rsrc/css/application/pholio/pholio.css' => '5591f1e9', + 'rsrc/css/application/pholio/pholio.css' => '209b1f08', 'rsrc/css/application/phortune/phortune-credit-card-form.css' => 'b25b4beb', 'rsrc/css/application/phrequent/phrequent.css' => 'ffc185ad', 'rsrc/css/application/phriction/phriction-document-css.css' => '7d7f0071', @@ -401,7 +401,7 @@ return array( 'rsrc/js/application/passphrase/phame-credential-control.js' => '1e1c8a59', 'rsrc/js/application/phame/phame-post-preview.js' => '61d927ec', 'rsrc/js/application/pholio/behavior-pholio-mock-edit.js' => '1e1e8bb0', - 'rsrc/js/application/pholio/behavior-pholio-mock-view.js' => '929d95eb', + 'rsrc/js/application/pholio/behavior-pholio-mock-view.js' => '91a166c7', 'rsrc/js/application/phortune/behavior-balanced-payment-form.js' => '3b3e1664', 'rsrc/js/application/phortune/behavior-stripe-payment-form.js' => '1693a296', 'rsrc/js/application/phortune/behavior-test-payment-form.js' => 'b3e5ee60', @@ -626,7 +626,7 @@ return array( 'javelin-behavior-phabricator-watch-anchor' => '06e05112', 'javelin-behavior-phame-post-preview' => '61d927ec', 'javelin-behavior-pholio-mock-edit' => '1e1e8bb0', - 'javelin-behavior-pholio-mock-view' => '929d95eb', + 'javelin-behavior-pholio-mock-view' => '91a166c7', 'javelin-behavior-phui-object-box-tabs' => 'a3e2244e', 'javelin-behavior-phui-timeline-dropdown-menu' => '4d94d9c3', 'javelin-behavior-policy-control' => 'f3fef818', @@ -752,7 +752,7 @@ return array( 'phabricator-uiexample-reactor-sendproperties' => '551add57', 'phabricator-zindex-css' => 'efb673ac', 'phame-css' => '19ecc703', - 'pholio-css' => '5591f1e9', + 'pholio-css' => '209b1f08', 'pholio-edit-css' => '3ad9d1ee', 'pholio-inline-comments-css' => '2703fdb9', 'phortune-credit-card-form' => '2290aeef', @@ -1520,7 +1520,7 @@ return array( 3 => 'javelin-mask', 4 => 'phabricator-drag-and-drop-file-upload', ), - '929d95eb' => + '91a166c7' => array( 0 => 'javelin-behavior', 1 => 'javelin-util', diff --git a/src/applications/pholio/view/PholioMockImagesView.php b/src/applications/pholio/view/PholioMockImagesView.php index b6ddca8182..efd41529e2 100644 --- a/src/applications/pholio/view/PholioMockImagesView.php +++ b/src/applications/pholio/view/PholioMockImagesView.php @@ -73,13 +73,18 @@ final class PholioMockImagesView extends AphrontView { $engine->addObject($image, 'default'); } $engine->process(); - + $current_set = 0; foreach ($mock->getAllImages() as $image) { $file = $image->getFile(); $metadata = $file->getMetadata(); $x = idx($metadata, PhabricatorFile::METADATA_IMAGE_WIDTH); $y = idx($metadata, PhabricatorFile::METADATA_IMAGE_HEIGHT); + $is_obs = (bool)$image->getIsObsolete(); + if (!$is_obs) { + $current_set++; + } + $history_uri = '/pholio/image/history/'.$image->getID().'/'; $images[] = array( 'id' => $image->getID(), @@ -129,6 +134,7 @@ final class PholioMockImagesView extends AphrontView { 'navsequence' => $navsequence, 'fullIcon' => hsprintf('%s', $full_icon), 'downloadIcon' => hsprintf('%s', $download_icon), + 'currentSetSize' => $current_set, ); Javelin::initBehavior('pholio-mock-view', $config); diff --git a/webroot/rsrc/css/application/pholio/pholio.css b/webroot/rsrc/css/application/pholio/pholio.css index e73920b30f..23ce307a1a 100644 --- a/webroot/rsrc/css/application/pholio/pholio.css +++ b/webroot/rsrc/css/application/pholio/pholio.css @@ -240,6 +240,10 @@ button.pholio-image-button-link:active { border-top: 1px solid {$thinblueborder}; } +.pholio-image-revision { + color: {$bluetext}; +} + .pholio-history-header { vertical-align: middle; color: {$lightbluetext}; diff --git a/webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js b/webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js index 657c84a789..22aac04962 100644 --- a/webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js +++ b/webroot/rsrc/js/application/pholio/behavior-pholio-mock-view.js @@ -644,12 +644,18 @@ JX.behavior('pholio-mock-view', function(config) { info.push(title); if (!image.isObsolete) { - var embed = JX.$N( + var img_len = config.currentSetSize; + var rev = JX.$N( 'div', - {className: 'pholio-image-embedding'}, - JX.$H('Embed this image: {M' + config.mockID + - ', image=' + image.id + '}')); - info.push(embed); + {className: 'pholio-image-revision'}, + JX.$H('Current Revision (' + img_len + ' images)')); + info.push(rev); + } else { + var prev = JX.$N( + 'div', + {className: 'pholio-image-revision'}, + JX.$H('(Previous Revision)')); + info.push(prev); } for (var ii = 0; ii < info.length; ii++) {