Use header status/policy elements in Applications meta-application
Summary: Ref T603. Use more modern elements. Test Plan: See screenshot. Reviewers: chad, btrahan Reviewed By: chad CC: aran Maniphest Tasks: T603 Differential Revision: https://secure.phabricator.com/D7264
This commit is contained in:
@@ -29,29 +29,16 @@ final class PhabricatorApplicationDetailViewController
|
|||||||
->setName($selected->getName()));
|
->setName($selected->getName()));
|
||||||
|
|
||||||
$header = id(new PHUIHeaderView())
|
$header = id(new PHUIHeaderView())
|
||||||
->setHeader($title);
|
->setHeader($title)
|
||||||
|
->setUser($user)
|
||||||
$status_tag = id(new PhabricatorTagView())
|
->setPolicyObject($selected);
|
||||||
->setType(PhabricatorTagView::TYPE_STATE);
|
|
||||||
|
|
||||||
if ($selected->isInstalled()) {
|
if ($selected->isInstalled()) {
|
||||||
$status_tag->setName(pht('Installed'));
|
$header->setStatus('open', 'green', pht('Installed'));
|
||||||
$status_tag->setBackgroundColor(PhabricatorTagView::COLOR_GREEN);
|
|
||||||
} else {
|
} else {
|
||||||
$status_tag->setName(pht('Uninstalled'));
|
$header->setStatus('open', 'red', 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);
|
||||||
|
|
||||||
@@ -77,6 +64,12 @@ final class PhabricatorApplicationDetailViewController
|
|||||||
$properties = id(new PhabricatorPropertyListView())
|
$properties = id(new PhabricatorPropertyListView())
|
||||||
->addProperty(pht('Description'), $application->getShortDescription());
|
->addProperty(pht('Description'), $application->getShortDescription());
|
||||||
|
|
||||||
|
if ($application->isBeta()) {
|
||||||
|
$properties->addProperty(
|
||||||
|
pht('Release'),
|
||||||
|
pht('Beta'));
|
||||||
|
}
|
||||||
|
|
||||||
$descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions(
|
$descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions(
|
||||||
$viewer,
|
$viewer,
|
||||||
$application);
|
$application);
|
||||||
|
|||||||
Reference in New Issue
Block a user