1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-30 09:20:58 +01:00

Display two numbers in launch view

Summary: Also don't display title if it's already written.

Test Plan: {F33604, size=full}

Reviewers: chad

Reviewed By: chad

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D5087
This commit is contained in:
vrana 2013-02-22 14:13:26 -08:00
parent c864a73ad2
commit 7d7fa11870
2 changed files with 18 additions and 8 deletions

View file

@ -32,7 +32,7 @@ final class PhabricatorApplicationFlags extends PhabricatorApplication {
->execute();
$count = count($flags);
$type = PhabricatorApplicationStatusView::TYPE_WARNING;
$type = PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION;
$status[] = id(new PhabricatorApplicationStatusView())
->setType($type)
->setText(pht('%d Flagged Object(s)', $count))

View file

@ -56,21 +56,26 @@ final class PhabricatorApplicationLaunchView extends AphrontView {
$application->getShortDescription());
}
$count = 0;
$counts = array();
$text = array();
if ($this->status) {
$info = PhabricatorApplicationStatusView::TYPE_INFO;
foreach ($this->status as $status) {
if ($status->getType() != $info) {
$count += $status->getCount();
}
$type = $status->getType();
$counts[$type] = idx($counts, $type, 0) + $status->getCount();
if ($status->getCount()) {
$text[] = $status->getText();
}
}
}
if ($count) {
$attention = PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION;
$warning = PhabricatorApplicationStatusView::TYPE_WARNING;
if (!empty($counts[$attention]) || !empty($counts[$warning])) {
$count = idx($counts, $attention, 0);
if (!empty($counts[$warning])) {
$count .= '/'.$counts[$warning];
}
Javelin::initBehavior('phabricator-tooltips');
$content[] = javelin_tag(
'span',
@ -134,12 +139,17 @@ final class PhabricatorApplicationLaunchView extends AphrontView {
$classes[] = 'application-tile-full';
}
$title = null;
if ($application && !$this->fullWidth) {
$title = $application->getShortDescription();
}
$app_button = phutil_tag(
$application ? 'a' : 'div',
array(
'class' => implode(' ', $classes),
'href' => $application ? $application->getBaseURI() : null,
'title' => $application ? $application->getShortDescription() : null,
'title' => $title,
),
$this->renderSingleView(
array(