mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-31 18:01:00 +01:00
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
This commit is contained in:
parent
0407b22ea2
commit
197aa43648
3 changed files with 18 additions and 13 deletions
|
@ -121,9 +121,14 @@ final class DifferentialRevisionListView extends AphrontView {
|
|||
|
||||
$phid = $revision->getPHID();
|
||||
if (isset($flagged[$phid])) {
|
||||
$icons['flag'] = array(
|
||||
'icon' => 'flag-'.$flagged[$phid]->getColor(),
|
||||
);
|
||||
$flag = $flagged[$phid];
|
||||
$flag_class = PhabricatorFlagColor::getCSSClass($flag->getColor());
|
||||
$icons['flag'] = phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'phabricator-flag-icon '.$flag_class,
|
||||
),
|
||||
'');
|
||||
}
|
||||
if (array_key_exists($revision->getID(), $this->drafts)) {
|
||||
$icons['draft'] = array(
|
||||
|
@ -162,9 +167,8 @@ final class DifferentialRevisionListView extends AphrontView {
|
|||
$status_name =
|
||||
ArcanistDifferentialRevisionStatus::getNameForRevisionStatus($status);
|
||||
|
||||
$flag_icon = null;
|
||||
if (isset($icons['flag'])) {
|
||||
$flag_icon = $icons['flag']['icon'];
|
||||
$item->addHeadIcon($icons['flag']);
|
||||
}
|
||||
|
||||
$item->setObjectName('D'.$revision->getID());
|
||||
|
@ -190,12 +194,6 @@ final class DifferentialRevisionListView extends AphrontView {
|
|||
$item->addStateIcon('none');
|
||||
}
|
||||
|
||||
if ($flag_icon) {
|
||||
$item->addStateIcon($flag_icon, pht('Flagged'));
|
||||
} else {
|
||||
$item->addStateIcon('none');
|
||||
}
|
||||
|
||||
$time_icon = 'none';
|
||||
$time_attr = array();
|
||||
if ($this->highlightAge) {
|
||||
|
|
|
@ -57,8 +57,8 @@ final class PhabricatorFlagListView extends AphrontView {
|
|||
$item->addIcon('edit', $edit_link);
|
||||
$item->addIcon('delete', $remove_link);
|
||||
|
||||
$item->setHeader(hsprintf('%s %s',
|
||||
$flag_icon, $flag->getHandle()->renderLink()));
|
||||
$item->addHeadIcon($flag_icon);
|
||||
$item->setHeader($flag->getHandle()->renderLink());
|
||||
|
||||
$item->addAttribute(phabricator_datetime($flag->getDateCreated(), $user));
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ final class PhabricatorObjectItemView extends AphrontTagView {
|
|||
private $actions = array();
|
||||
private $stateIconColumns = 0;
|
||||
private $stateIcons = array();
|
||||
private $headIcons = array();
|
||||
|
||||
public function setStateIconColumns($state_icon_columns) {
|
||||
$this->stateIconColumns = $state_icon_columns;
|
||||
|
@ -36,6 +37,11 @@ final class PhabricatorObjectItemView extends AphrontTagView {
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function addHeadIcon($icon) {
|
||||
$this->headIcons[] = $icon;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setObjectName($name) {
|
||||
$this->objectName = $name;
|
||||
return $this;
|
||||
|
@ -244,6 +250,7 @@ final class PhabricatorObjectItemView extends AphrontTagView {
|
|||
'sigil' => 'slippery',
|
||||
),
|
||||
array(
|
||||
$this->headIcons,
|
||||
$header_name,
|
||||
$header_link,
|
||||
));
|
||||
|
|
Loading…
Reference in a new issue