@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add a flag column to Differential revision lists

Summary:
Put a flag icon to the left of each flagged revision in the
Differential summary tables. Flag is colored correctly and when hovered
reveals the note in a tooltip.

As epriestley specifically notes that the Flagged Revisions table should
only be shown when a user is looking at their own revisions, maybe this
ought to be limited by what controller is using this view, or something.

Test Plan:
View Differential main page. Check that flags appear
correctly if some revisions are flagged.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, avivey

Maniphest Tasks: T1557

Differential Revision: https://secure.phabricator.com/D3125

+21 -3
+21 -3
src/applications/differential/view/DifferentialRevisionListView.php
··· 67 67 throw new Exception("Call setUser() before render()!"); 68 68 } 69 69 70 + $flags = id(new PhabricatorFlagQuery()) 71 + ->withObjectPHIDs(mpull($this->revisions, 'getPHID')) 72 + ->execute(); 73 + $flagged = mpull($flags, null, 'getObjectPHID'); 74 + 70 75 foreach ($this->fields as $field) { 71 76 $field->setUser($this->user); 72 77 $field->setHandles($this->handles); ··· 74 79 75 80 $rows = array(); 76 81 foreach ($this->revisions as $revision) { 77 - $row = array(); 82 + $phid = $revision->getPHID(); 83 + $flag = ''; 84 + if (isset($flagged[$phid])) { 85 + $class = PhabricatorFlagColor::getCSSClass($flagged[$phid]->getColor()); 86 + $note = $flagged[$phid]->getNote(); 87 + $flag = phutil_render_tag( 88 + 'div', 89 + array( 90 + 'class' => 'phabricator-flag-icon '.$class, 91 + 'title' => $note, 92 + ), 93 + ''); 94 + } 95 + $row = array($flag); 78 96 foreach ($this->fields as $field) { 79 97 $row[] = $field->renderValueForRevisionList($revision); 80 98 } 81 99 $rows[] = $row; 82 100 } 83 101 84 - $headers = array(); 85 - $classes = array(); 102 + $headers = array(''); 103 + $classes = array(''); 86 104 foreach ($this->fields as $field) { 87 105 $headers[] = $field->renderHeaderForRevisionList(); 88 106 $classes[] = $field->getColumnClassForRevisionList();