More information on Applications

Summary: More Information on Applications on Applications List View. Also, added tags in Applications Details view to show their status.

Test Plan: Manual Checking

Reviewers: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4759
This commit is contained in:
Afaque Hussain
2013-01-31 06:22:06 -08:00
committed by epriestley
parent c1e9b20d78
commit 3e5fb09b80
2 changed files with 52 additions and 26 deletions

View File

@@ -27,36 +27,53 @@ final class PhabricatorApplicationDetailViewController
->setName(pht('Applications'))
->setHref($this->getApplicationURI()));
$properties = $this->buildPropertyView($selected);
$actions = $this->buildActionView($user, $selected);
$header = id(new PhabricatorHeaderView())
->setHeader($title);
return $this->buildApplicationPage(
array(
$crumbs,
id(new PhabricatorHeaderView())->setHeader($title),
$actions,
$properties,
),
array(
'title' => $title,
'device' => true,
));
$status_tag = id(new PhabricatorTagView())
->setType(PhabricatorTagView::TYPE_STATE);
if ($selected->isInstalled()) {
$status_tag->setName(pht('Installed'));
$status_tag->setBackgroundColor(PhabricatorTagView::COLOR_GREEN);
} else {
$status_tag->setName(pht('Uninstalled'));
$status_tag->setBackgroundColor(PhabricatorTagView::COLOR_RED);
}
if ($selected->isBeta()) {
$beta_tag = id(new PhabricatorTagView())
->setType(PhabricatorTagView::TYPE_STATE)
->setName(pht('Beta'))
->setBackgroundColor(PhabricatorTagView::COLOR_GREY);
$header->addTag($beta_tag);
}
$header->addTag($status_tag);
$properties = $this->buildPropertyView($selected);
$actions = $this->buildActionView($user, $selected);
return $this->buildApplicationPage(
array(
$crumbs,
$header,
$actions,
$properties,
),
array(
'title' => $title,
'device' => true,
));
}
private function buildPropertyView(PhabricatorApplication $selected) {
$properties = new PhabricatorPropertyListView();
if ($selected->isInstalled()) {
$properties->addProperty(
pht('Status'), pht('Installed'));
} else {
$properties->addProperty(
pht('Status'), pht('Uninstalled'));
}
$properties->addProperty(
pht('Description'), $selected->getShortDescription());
$properties = id(new PhabricatorPropertyListView())
->addProperty(
pht('Description'), $selected->getShortDescription()
);
return $properties;
}