mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 23:02:42 +01:00
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
This commit is contained in:
parent
21651c6bc6
commit
8fc5817f65
2 changed files with 22 additions and 0 deletions
|
@ -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 =
|
||||
'<a href="/D'.$revision->getID().'#comment-preview">'.
|
||||
phutil_render_tag(
|
||||
'img',
|
||||
array(
|
||||
'src' => celerity_get_resource_uri($src),
|
||||
'width' => 16,
|
||||
'height' => 16,
|
||||
'alt' => 'Draft',
|
||||
'title' => 'Draft Comment',
|
||||
)).
|
||||
'</a>';
|
||||
}
|
||||
|
||||
$row = array($flag);
|
||||
|
||||
$modified = $revision->getDateModified();
|
||||
|
|
BIN
webroot/rsrc/image/icon/fatcow/page_white_edit.png
Normal file
BIN
webroot/rsrc/image/icon/fatcow/page_white_edit.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 719 B |
Loading…
Reference in a new issue