mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 13:30:55 +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:
parent
c1e9b20d78
commit
3e5fb09b80
2 changed files with 52 additions and 26 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -53,7 +53,16 @@ final class PhabricatorApplicationsListController
|
|||
->setHref('/applications/view/'.get_class($application).'/')
|
||||
->addAttribute(
|
||||
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);
|
||||
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue