3 final class AlmanacNamespaceViewController
4 extends AlmanacNamespaceController
{
6 public function shouldAllowPublic() {
10 public function handleRequest(AphrontRequest
$request) {
11 $viewer = $request->getViewer();
13 $id = $request->getURIData('id');
14 $namespace = id(new AlmanacNamespaceQuery())
19 return new Aphront404Response();
22 $title = pht('Namespace %s', $namespace->getName());
24 $curtain = $this->buildCurtain($namespace);
26 $header = id(new PHUIHeaderView())
28 ->setHeader($namespace->getName())
29 ->setPolicyObject($namespace)
30 ->setHeaderIcon('fa-asterisk');
32 $crumbs = $this->buildApplicationCrumbs();
33 $crumbs->addTextCrumb($namespace->getName());
34 $crumbs->setBorder(true);
36 $timeline = $this->buildTransactionTimeline(
38 new AlmanacNamespaceTransactionQuery());
39 $timeline->setShouldTerminate(true);
41 $view = id(new PHUITwoColumnView())
43 ->setCurtain($curtain)
44 ->setMainColumn(array(
48 return $this->newPage()
57 private function buildCurtain(AlmanacNamespace
$namespace) {
58 $viewer = $this->getViewer();
60 $can_edit = PhabricatorPolicyFilter
::hasCapability(
63 PhabricatorPolicyCapability
::CAN_EDIT
);
65 $id = $namespace->getID();
66 $edit_uri = $this->getApplicationURI("namespace/edit/{$id}/");
68 $curtain = $this->newCurtainView($namespace);
71 id(new PhabricatorActionView())
72 ->setIcon('fa-pencil')
73 ->setName(pht('Edit Namespace'))
75 ->setWorkflow(!$can_edit)
76 ->setDisabled(!$can_edit));