1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-03 11:21:01 +01:00

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')) ->setName(pht('Applications'))
->setHref($this->getApplicationURI())); ->setHref($this->getApplicationURI()));
$properties = $this->buildPropertyView($selected); $header = id(new PhabricatorHeaderView())
$actions = $this->buildActionView($user, $selected); ->setHeader($title);
return $this->buildApplicationPage( $status_tag = id(new PhabricatorTagView())
array( ->setType(PhabricatorTagView::TYPE_STATE);
$crumbs,
id(new PhabricatorHeaderView())->setHeader($title), if ($selected->isInstalled()) {
$actions, $status_tag->setName(pht('Installed'));
$properties, $status_tag->setBackgroundColor(PhabricatorTagView::COLOR_GREEN);
),
array( } else {
'title' => $title, $status_tag->setName(pht('Uninstalled'));
'device' => true, $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) { private function buildPropertyView(PhabricatorApplication $selected) {
$properties = new PhabricatorPropertyListView(); $properties = id(new PhabricatorPropertyListView())
->addProperty(
if ($selected->isInstalled()) { pht('Description'), $selected->getShortDescription()
$properties->addProperty( );
pht('Status'), pht('Installed'));
} else {
$properties->addProperty(
pht('Status'), pht('Uninstalled'));
}
$properties->addProperty(
pht('Description'), $selected->getShortDescription());
return $properties; return $properties;
} }

View file

@ -53,7 +53,16 @@ final class PhabricatorApplicationsListController
->setHref('/applications/view/'.get_class($application).'/') ->setHref('/applications/view/'.get_class($application).'/')
->addAttribute( ->addAttribute(
phutil_escape_html($application->getShortDescription())); phutil_escape_html($application->getShortDescription()));
if (!$application->isInstalled()) {
$item->addIcon('delete', pht('Uninstalled'));
}
if ($application->isBeta()) {
$item->addIcon('lint-warning', pht('Beta'));
}
$list->addItem($item); $list->addItem($item);
} }
return $list; return $list;
} }