diff --git a/src/applications/differential/view/DifferentialRevisionListView.php b/src/applications/differential/view/DifferentialRevisionListView.php index 1a0c5d77fd..f1c39ed0b2 100644 --- a/src/applications/differential/view/DifferentialRevisionListView.php +++ b/src/applications/differential/view/DifferentialRevisionListView.php @@ -67,6 +67,11 @@ final class DifferentialRevisionListView extends AphrontView { throw new Exception("Call setUser() before render()!"); } + $flags = id(new PhabricatorFlagQuery()) + ->withObjectPHIDs(mpull($this->revisions, 'getPHID')) + ->execute(); + $flagged = mpull($flags, null, 'getObjectPHID'); + foreach ($this->fields as $field) { $field->setUser($this->user); $field->setHandles($this->handles); @@ -74,15 +79,28 @@ final class DifferentialRevisionListView extends AphrontView { $rows = array(); foreach ($this->revisions as $revision) { - $row = array(); + $phid = $revision->getPHID(); + $flag = ''; + if (isset($flagged[$phid])) { + $class = PhabricatorFlagColor::getCSSClass($flagged[$phid]->getColor()); + $note = $flagged[$phid]->getNote(); + $flag = phutil_render_tag( + 'div', + array( + 'class' => 'phabricator-flag-icon '.$class, + 'title' => $note, + ), + ''); + } + $row = array($flag); foreach ($this->fields as $field) { $row[] = $field->renderValueForRevisionList($revision); } $rows[] = $row; } - $headers = array(); - $classes = array(); + $headers = array(''); + $classes = array(''); foreach ($this->fields as $field) { $headers[] = $field->renderHeaderForRevisionList(); $classes[] = $field->getColumnClassForRevisionList();