From 8fc5817f65e851c871770cbaf2ba8bb2996e190b Mon Sep 17 00:00:00 2001 From: vrana Date: Thu, 16 Aug 2012 23:35:50 -0700 Subject: [PATCH] Display draft reviews in revision lists Summary: We have /differential/filter/drafts/ but nobody knows about it. This diff displays the draft only if there is no flag to not waste space. Test Plan: /differential/filter/revisions/ Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin, alanh Differential Revision: https://secure.phabricator.com/D3324 --- .../view/DifferentialRevisionListView.php | 22 ++++++++++++++++++ .../image/icon/fatcow/page_white_edit.png | Bin 0 -> 719 bytes 2 files changed, 22 insertions(+) create mode 100644 webroot/rsrc/image/icon/fatcow/page_white_edit.png diff --git a/src/applications/differential/view/DifferentialRevisionListView.php b/src/applications/differential/view/DifferentialRevisionListView.php index e5015b0bee..2c73686fa2 100644 --- a/src/applications/differential/view/DifferentialRevisionListView.php +++ b/src/applications/differential/view/DifferentialRevisionListView.php @@ -23,6 +23,7 @@ final class DifferentialRevisionListView extends AphrontView { private $revisions; private $flags = array(); + private $drafts = array(); private $handles; private $user; private $fields; @@ -84,6 +85,11 @@ final class DifferentialRevisionListView extends AphrontView { ->withObjectPHIDs(mpull($this->revisions, 'getPHID')) ->execute(); + $this->drafts = id(new DifferentialRevisionQuery()) + ->withIDs(mpull($this->revisions, 'getID')) + ->withDraftRepliesByAuthors(array($user->getPHID())) + ->execute(); + return $this; } @@ -135,7 +141,23 @@ final class DifferentialRevisionListView extends AphrontView { 'class' => 'phabricator-flag-icon '.$class, ), ''); + + } else if (array_key_exists($revision->getID(), $this->drafts)) { + $src = '/rsrc/image/icon/fatcow/page_white_edit.png'; + $flag = + ''. + phutil_render_tag( + 'img', + array( + 'src' => celerity_get_resource_uri($src), + 'width' => 16, + 'height' => 16, + 'alt' => 'Draft', + 'title' => 'Draft Comment', + )). + ''; } + $row = array($flag); $modified = $revision->getDateModified(); diff --git a/webroot/rsrc/image/icon/fatcow/page_white_edit.png b/webroot/rsrc/image/icon/fatcow/page_white_edit.png new file mode 100644 index 0000000000000000000000000000000000000000..8bc294fa6aa3bfc0ce34c49467cba979d25d1c32 GIT binary patch literal 719 zcmV;=0xgnd2L87CW2|f zDq^aLLRT?hRDxSqMTpes#+^irNI=O#aN)+4(1iu1B2`j!Q7aX-(k_Ywn@apFR8Wd- ziAwV^iA`JIpKcltO(GyjB@dO#Ddm!+ zrfiz!^*!C)crh^n)uYpXKMa_@{WCV0TvP-^)d5w_s#}xZmX-@R;Bu8%h1w#Btec3k z!FmGQK*l(VE2~JRGqQxA$Yk@SeKWB*+V<_j(x!H~kBXXrs+lpmf#tq%v{)>#v~5Nx zd==*dLEQT?j9elMJ)Oi~9hAs4FwF{Pwc_37?YMHL2ZKWo;C3Cvb2U;Atw&`oUpwQp>J;<(2-1_9Y5Dv$YGQjI4@Y?tiX