1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 23:02:42 +01:00

Move "Stale" / "Old" to date icon in Differential list view

Summary: Ref T3485. Moves "Stale" / "Old" to the right.

Test Plan: {F48653}

Reviewers: chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T3485

Differential Revision: https://secure.phabricator.com/D6354
This commit is contained in:
epriestley 2013-07-03 08:52:46 -07:00
parent 66450698ba
commit 0407b22ea2
4 changed files with 47 additions and 23 deletions

View file

@ -181,18 +181,6 @@ final class DifferentialRevisionListView extends AphrontView {
$item->addAttribute(pht('Reviewers: %s', $rev_fields['Reviewers'])); $item->addAttribute(pht('Reviewers: %s', $rev_fields['Reviewers']));
$item->setStateIconColumns(1); $item->setStateIconColumns(1);
if ($this->highlightAge) {
$item->setStateIconColumns(2);
$do_not_display_age = array(
ArcanistDifferentialRevisionStatus::CLOSED => true,
ArcanistDifferentialRevisionStatus::ABANDONED => true,
);
if (isset($icons['age']) && !isset($do_not_display_age[$status])) {
$item->addStateIcon($icons['age']['icon'], $icons['age']['label']);
} else {
$item->addStateIcon('none');
}
}
if (isset($icons['draft'])) { if (isset($icons['draft'])) {
$item->addStateIcon( $item->addStateIcon(
@ -208,8 +196,22 @@ final class DifferentialRevisionListView extends AphrontView {
$item->addStateIcon('none'); $item->addStateIcon('none');
} }
// Updated on $time_icon = 'none';
$item->addIcon('none', $rev_fields['Updated']); $time_attr = array();
if ($this->highlightAge) {
$do_not_display_age = array(
ArcanistDifferentialRevisionStatus::CLOSED => true,
ArcanistDifferentialRevisionStatus::ABANDONED => true,
);
if (isset($icons['age']) && !isset($do_not_display_age[$status])) {
$time_icon = $icons['age']['icon'];
$time_attr = array(
'tip' => $icons['age']['label'],
);
}
}
$item->addIcon($time_icon, $rev_fields['Updated'], $time_attr);
// First remove the fields we already have // First remove the fields we already have
$count = 7; $count = 7;

View file

@ -107,14 +107,24 @@ final class PhrictionHistoryController
} }
if ($vs_previous) { if ($vs_previous) {
$item->addIcon('arrow_left', pht('Show Change'), $vs_previous); $item->addIcon(
'arrow_left',
pht('Show Change'),
array(
'href' => $vs_previous,
));
} else { } else {
$item->addIcon('arrow_left-grey', $item->addIcon('arrow_left-grey',
phutil_tag('em', array(), pht('No previous change'))); phutil_tag('em', array(), pht('No previous change')));
} }
if ($vs_head) { if ($vs_head) {
$item->addIcon('merge', pht('Show Later Changes'), $vs_head); $item->addIcon(
'merge',
pht('Show Later Changes'),
array(
'href' => $vs_head,
));
} else { } else {
$item->addIcon('merge-grey', $item->addIcon('merge-grey',
phutil_tag('em', array(), pht('No later changes'))); phutil_tag('em', array(), pht('No later changes')));

View file

@ -114,7 +114,7 @@ final class PhabricatorProjectListController
->setHeader($row[0]) ->setHeader($row[0])
->setHref($row[1]) ->setHref($row[1])
->addIcon($row[3], $row[2]) ->addIcon($row[3], $row[2])
->addIcon('edit', pht('Edit Project'), $row[7]); ->addIcon('edit', pht('Edit Project'), array('href' => $row[7]));
if ($row[4]) { if ($row[4]) {
$item->addAttribute($row[4]); $item->addAttribute($row[4]);
} }

View file

@ -104,11 +104,11 @@ final class PhabricatorObjectItemView extends AphrontTagView {
return $this; return $this;
} }
public function addIcon($icon, $label = null, $href = null) { public function addIcon($icon, $label = null, $attributes = array()) {
$this->icons[] = array( $this->icons[] = array(
'icon' => $icon, 'icon' => $icon,
'label' => $label, 'label' => $label,
'href' => $href, 'attributes' => $attributes,
); );
return $this; return $this;
} }
@ -254,11 +254,23 @@ final class PhabricatorObjectItemView extends AphrontTagView {
foreach ($this->icons as $spec) { foreach ($this->icons as $spec) {
$icon = $spec['icon']; $icon = $spec['icon'];
$icon = phutil_tag( $sigil = null;
$meta = null;
if (isset($spec['attributes']['tip'])) {
$sigil = 'has-tooltip';
$meta = array(
'tip' => $spec['attributes']['tip'],
'align' => 'W',
);
}
$icon = javelin_tag(
'span', 'span',
array( array(
'class' => 'phabricator-object-item-icon-image '. 'class' => 'phabricator-object-item-icon-image '.
'sprite-icons icons-'.$icon, 'sprite-icons icons-'.$icon,
'sigil' => $sigil,
'meta' => $meta,
), ),
''); '');
@ -269,10 +281,10 @@ final class PhabricatorObjectItemView extends AphrontTagView {
), ),
$spec['label']); $spec['label']);
if ($spec['href']) { if (isset($spec['attributes']['href'])) {
$icon_href = phutil_tag( $icon_href = phutil_tag(
'a', 'a',
array('href' => $spec['href']), array('href' => $spec['attributes']['href']),
array($label, $icon)); array($label, $icon));
} else { } else {
$icon_href = array($label, $icon); $icon_href = array($label, $icon);
@ -284,7 +296,7 @@ final class PhabricatorObjectItemView extends AphrontTagView {
$classes[] = 'phabricator-object-item-icon-none'; $classes[] = 'phabricator-object-item-icon-none';
} }
$icon_list[] = phutil_tag( $icon_list[] = javelin_tag(
'li', 'li',
array( array(
'class' => implode(' ', $classes), 'class' => implode(' ', $classes),