From 19ed6a1ad60aa04366827098a5cd9d2573373265 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sun, 15 Jun 2014 07:56:07 -0700 Subject: [PATCH] Show inline counts on the thumb grid in Pholio Summary: This is a little rough visually but the actual number works fine. Test Plan: {F166844} Reviewers: chad Reviewed By: chad Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D9547 --- .../controller/PholioMockViewController.php | 2 +- .../pholio/view/PholioMockThumbGridView.php | 15 ++++++++++++++- webroot/rsrc/css/application/pholio/pholio.css | 15 +++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/applications/pholio/controller/PholioMockViewController.php b/src/applications/pholio/controller/PholioMockViewController.php index 00d003baca..92016d0a63 100644 --- a/src/applications/pholio/controller/PholioMockViewController.php +++ b/src/applications/pholio/controller/PholioMockViewController.php @@ -31,7 +31,7 @@ final class PholioMockViewController extends PholioController { ->setViewer($user) ->withIDs(array($this->id)) ->needImages(true) - ->needCoverFiles(true) + ->needInlineComments(true) ->executeOne(); if (!$mock) { diff --git a/src/applications/pholio/view/PholioMockThumbGridView.php b/src/applications/pholio/view/PholioMockThumbGridView.php index 662a43447c..ced0fe73b0 100644 --- a/src/applications/pholio/view/PholioMockThumbGridView.php +++ b/src/applications/pholio/view/PholioMockThumbGridView.php @@ -120,6 +120,16 @@ final class PholioMockThumbGridView extends AphrontView { $classes[] = 'pholio-mock-thumb-grid-item-obsolete'; } + $inline_count = null; + if ($image->getInlineComments()) { + $inline_count[] = phutil_tag( + 'span', + array( + 'class' => 'pholio-mock-thumb-grid-comment-count', + ), + pht('%s', new PhutilNumber(count($image->getInlineComments())))); + } + return javelin_tag( 'a', array( @@ -130,7 +140,10 @@ final class PholioMockThumbGridView extends AphrontView { 'imageID' => $image->getID(), ), ), - $tag); + array( + $tag, + $inline_count, + )); } } diff --git a/webroot/rsrc/css/application/pholio/pholio.css b/webroot/rsrc/css/application/pholio/pholio.css index ba56163eb6..5efdd987bd 100644 --- a/webroot/rsrc/css/application/pholio/pholio.css +++ b/webroot/rsrc/css/application/pholio/pholio.css @@ -152,3 +152,18 @@ font-weight: bold; color: {$bluetext}; } + +.pholio-mock-thumb-grid-comment-count { + position: absolute; + right: 4px; + bottom: 4px; + width: 20px; + height: 20px; + text-align: center; + line-height: 20px; + border-radius: 10px; + font-weight: bold; + color: #fff; + text-decoration: none; + background: {$indigo}; +}