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,13 +27,39 @@ final class PhabricatorApplicationDetailViewController
->setName(pht('Applications')) ->setName(pht('Applications'))
->setHref($this->getApplicationURI())); ->setHref($this->getApplicationURI()));
$header = id(new PhabricatorHeaderView())
->setHeader($title);
$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); $properties = $this->buildPropertyView($selected);
$actions = $this->buildActionView($user, $selected); $actions = $this->buildActionView($user, $selected);
return $this->buildApplicationPage( return $this->buildApplicationPage(
array( array(
$crumbs, $crumbs,
id(new PhabricatorHeaderView())->setHeader($title), $header,
$actions, $actions,
$properties, $properties,
), ),
@ -44,19 +70,10 @@ final class PhabricatorApplicationDetailViewController
} }
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;
} }