Move roles and status into properties on profile view

Summary: See discussion in D6403.

Test Plan: {F49488}

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D6409
This commit is contained in:
epriestley
2013-07-10 12:34:09 -07:00
parent a77ab312f0
commit a55089e628
7 changed files with 119 additions and 40 deletions

View File

@@ -36,41 +36,6 @@ final class PhabricatorPeopleProfileController
->setSubheader($profile->getTitle())
->setImage($picture);
if ($user->getIsDisabled()) {
$header->addTag(
id(new PhabricatorTagView())
->setType(PhabricatorTagView::TYPE_STATE)
->setBackgroundColor(PhabricatorTagView::COLOR_GREY)
->setName(pht('Disabled')));
}
if ($user->getIsAdmin()) {
$header->addTag(
id(new PhabricatorTagView())
->setType(PhabricatorTagView::TYPE_STATE)
->setBackgroundColor(PhabricatorTagView::COLOR_RED)
->setName(pht('Administrator')));
}
if ($user->getIsSystemAgent()) {
$header->addTag(
id(new PhabricatorTagView())
->setType(PhabricatorTagView::TYPE_STATE)
->setBackgroundColor(PhabricatorTagView::COLOR_BLUE)
->setName(pht('Bot')));
}
$statuses = id(new PhabricatorUserStatus())
->loadCurrentStatuses(array($user->getPHID()));
if ($statuses) {
$header->addTag(
id(new PhabricatorTagView())
->setType(PhabricatorTagView::TYPE_STATE)
->setBackgroundColor(PhabricatorTagView::COLOR_ORANGE)
->setName(head($statuses)->getTerseSummary($viewer)));
}
$actions = id(new PhabricatorActionListView())
->setObject($user)
->setUser($viewer);