@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.

Move flag icon inline with header in Differential revision list

Summary: Ref T3485. Moves flag icon inline in the header.

Test Plan: {F48654}

Reviewers: chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T3485

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

+18 -13
+9 -11
src/applications/differential/view/DifferentialRevisionListView.php
··· 121 121 122 122 $phid = $revision->getPHID(); 123 123 if (isset($flagged[$phid])) { 124 - $icons['flag'] = array( 125 - 'icon' => 'flag-'.$flagged[$phid]->getColor(), 126 - ); 124 + $flag = $flagged[$phid]; 125 + $flag_class = PhabricatorFlagColor::getCSSClass($flag->getColor()); 126 + $icons['flag'] = phutil_tag( 127 + 'div', 128 + array( 129 + 'class' => 'phabricator-flag-icon '.$flag_class, 130 + ), 131 + ''); 127 132 } 128 133 if (array_key_exists($revision->getID(), $this->drafts)) { 129 134 $icons['draft'] = array( ··· 162 167 $status_name = 163 168 ArcanistDifferentialRevisionStatus::getNameForRevisionStatus($status); 164 169 165 - $flag_icon = null; 166 170 if (isset($icons['flag'])) { 167 - $flag_icon = $icons['flag']['icon']; 171 + $item->addHeadIcon($icons['flag']); 168 172 } 169 173 170 174 $item->setObjectName('D'.$revision->getID()); ··· 186 190 $item->addStateIcon( 187 191 $icons['draft']['icon'], 188 192 pht('Saved Comments')); 189 - } else { 190 - $item->addStateIcon('none'); 191 - } 192 - 193 - if ($flag_icon) { 194 - $item->addStateIcon($flag_icon, pht('Flagged')); 195 193 } else { 196 194 $item->addStateIcon('none'); 197 195 }
+2 -2
src/applications/flag/view/PhabricatorFlagListView.php
··· 57 57 $item->addIcon('edit', $edit_link); 58 58 $item->addIcon('delete', $remove_link); 59 59 60 - $item->setHeader(hsprintf('%s %s', 61 - $flag_icon, $flag->getHandle()->renderLink())); 60 + $item->addHeadIcon($flag_icon); 61 + $item->setHeader($flag->getHandle()->renderLink()); 62 62 63 63 $item->addAttribute(phabricator_datetime($flag->getDateCreated(), $user)); 64 64
+7
src/view/layout/PhabricatorObjectItemView.php
··· 18 18 private $actions = array(); 19 19 private $stateIconColumns = 0; 20 20 private $stateIcons = array(); 21 + private $headIcons = array(); 21 22 22 23 public function setStateIconColumns($state_icon_columns) { 23 24 $this->stateIconColumns = $state_icon_columns; ··· 33 34 if (!$this->stateIconColumns) { 34 35 $this->stateIconColumns = 1; 35 36 } 37 + return $this; 38 + } 39 + 40 + public function addHeadIcon($icon) { 41 + $this->headIcons[] = $icon; 36 42 return $this; 37 43 } 38 44 ··· 244 250 'sigil' => 'slippery', 245 251 ), 246 252 array( 253 + $this->headIcons, 247 254 $header_name, 248 255 $header_link, 249 256 ));