diff --git a/src/applications/ponder/controller/PonderQuestionViewController.php b/src/applications/ponder/controller/PonderQuestionViewController.php index 420d4b01c1..5b412e86b2 100644 --- a/src/applications/ponder/controller/PonderQuestionViewController.php +++ b/src/applications/ponder/controller/PonderQuestionViewController.php @@ -52,6 +52,7 @@ final class PonderQuestionViewController extends PonderController { } $handles = $this->loadViewerHandles($object_phids); + $this->loadHandles($object_phids); $detail_panel = new PonderQuestionDetailView(); $detail_panel @@ -72,9 +73,19 @@ final class PonderQuestionViewController extends PonderController { ->setUser($user) ->setActionURI("/ponder/answer/add/"); + $header = id(new PhabricatorHeaderView()) + ->setObjectName('Q'.$question->getID()) + ->setHeader($question->getTitle()); + + $actions = $this->buildActionListView($question); + $properties = $this->buildPropertyListView($question); + $nav = $this->buildSideNavView($question); $nav->appendChild( array( + $header, + $actions, + $properties, $detail_panel, $responses_panel, $answer_add_panel @@ -89,4 +100,29 @@ final class PonderQuestionViewController extends PonderController { 'title' => 'Q'.$question->getID().' '.$question->getTitle() )); } + + private function buildActionListView(PonderQuestion $question) { + $viewer = $this->getRequest()->getUser(); + $view = new PhabricatorActionListView(); + + $view->setUser($viewer); + $view->setObject($question); + + return $view; + } + + private function buildPropertyListView(PonderQuestion $question) { + $viewer = $this->getRequest()->getUser(); + $view = new PhabricatorPropertyListView(); + + $view->addProperty( + pht('Author'), + $this->getHandle($question->getAuthorPHID())->renderLink()); + + $view->addProperty( + pht('Created'), + phabricator_datetime($question->getDateCreated(), $viewer)); + + return $view; + } } diff --git a/src/applications/ponder/view/PonderQuestionDetailView.php b/src/applications/ponder/view/PonderQuestionDetailView.php index a9326e724a..9ff5c3dda3 100644 --- a/src/applications/ponder/view/PonderQuestionDetailView.php +++ b/src/applications/ponder/view/PonderQuestionDetailView.php @@ -45,10 +45,7 @@ final class PonderQuestionDetailView extends AphrontView { $user = $this->user; $panel = id(new AphrontPanelView()) - ->addClass("ponder-panel") - ->setHeader( - $this->renderObjectLink().' '. - phutil_escape_html($question->getTitle())); + ->addClass("ponder-panel"); $contentview = new PonderPostBodyView(); $contentview @@ -73,12 +70,4 @@ final class PonderQuestionDetailView extends AphrontView { return $panel->render(); } - private function renderObjectLink() { - return phutil_render_tag( - 'a', - array('href' => '/Q' . $this->question->getID()), - "Q". phutil_escape_html($this->question->getID()) - ); - } - } diff --git a/src/view/layout/PhabricatorActionListView.php b/src/view/layout/PhabricatorActionListView.php index b80ba779ef..e5fbd1e45f 100644 --- a/src/view/layout/PhabricatorActionListView.php +++ b/src/view/layout/PhabricatorActionListView.php @@ -53,6 +53,10 @@ final class PhabricatorActionListView extends AphrontView { $actions = $event->getValue('actions'); + if (!$actions) { + return null; + } + require_celerity_resource('phabricator-action-list-view-css'); return phutil_render_tag( 'ul',