3 abstract class PhabricatorBadgesProfileController
4 extends PhabricatorController
{
8 public function setBadge(PhabricatorBadgesBadge
$badge) {
13 public function getBadge() {
17 public function buildApplicationMenu() {
18 return $this->buildSideNavView()->getMenu();
21 protected function buildHeaderView() {
22 $viewer = $this->getViewer();
23 $badge = $this->getBadge();
24 $id = $badge->getID();
26 if ($badge->isArchived()) {
27 $status_icon = 'fa-ban';
28 $status_color = 'dark';
30 $status_icon = 'fa-check';
31 $status_color = 'bluegrey';
34 PhabricatorBadgesBadge
::getStatusNameMap(),
37 return id(new PHUIHeaderView())
38 ->setHeader($badge->getName())
40 ->setPolicyObject($badge)
41 ->setStatus($status_icon, $status_color, $status_name)
42 ->setHeaderIcon('fa-trophy');
45 protected function buildApplicationCrumbs() {
46 $badge = $this->getBadge();
47 $id = $badge->getID();
48 $badge_uri = $this->getApplicationURI("/view/{$id}/");
50 $crumbs = parent
::buildApplicationCrumbs();
51 $crumbs->addTextCrumb($badge->getName(), $badge_uri);
52 $crumbs->setBorder(true);
56 protected function buildSideNavView($filter = null) {
57 $viewer = $this->getViewer();
58 $badge = $this->getBadge();
59 $id = $badge->getID();
61 $can_edit = PhabricatorPolicyFilter
::hasCapability(
64 PhabricatorPolicyCapability
::CAN_EDIT
);
66 $nav = id(new AphrontSideNavFilterView())
67 ->setBaseURI(new PhutilURI($this->getApplicationURI()));
69 $nav->addLabel(pht('Badge'));
74 $this->getApplicationURI("/view/{$id}/"),
79 pht('View Recipients'),
80 $this->getApplicationURI("/recipients/{$id}/"),
83 $nav->selectFilter($filter);