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->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'])) {
$item->addStateIcon(
@ -208,8 +196,22 @@ final class DifferentialRevisionListView extends AphrontView {
$item->addStateIcon('none');
}
// Updated on
$item->addIcon('none', $rev_fields['Updated']);
$time_icon = 'none';
$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
$count = 7;

View file

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

View file

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

View file

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