diff --git a/resources/celerity/map.php b/resources/celerity/map.php --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -94,10 +94,7 @@ 'rsrc/css/application/policy/policy-edit.css' => '815c66f7', 'rsrc/css/application/policy/policy-transaction-detail.css' => '82100a43', 'rsrc/css/application/policy/policy.css' => '957ea14c', - 'rsrc/css/application/ponder/comments.css' => '865a67e6', - 'rsrc/css/application/ponder/feed.css' => 'e62615b6', - 'rsrc/css/application/ponder/post.css' => '9d415218', - 'rsrc/css/application/ponder/vote.css' => 'aea452b0', + 'rsrc/css/application/ponder/ponder-view.css' => 'fcd6b398', 'rsrc/css/application/projects/project-icon.css' => '4e3eaa5a', 'rsrc/css/application/releeph/releeph-core.css' => '9b3c5733', 'rsrc/css/application/releeph/releeph-preview-branch.css' => 'b7a6f4a5', @@ -816,10 +813,7 @@ 'policy-css' => '957ea14c', 'policy-edit-css' => '815c66f7', 'policy-transaction-detail-css' => '82100a43', - 'ponder-comment-table-css' => '865a67e6', - 'ponder-feed-view-css' => 'e62615b6', - 'ponder-post-css' => '9d415218', - 'ponder-vote-css' => 'aea452b0', + 'ponder-view-css' => 'fcd6b398', 'project-icon-css' => '4e3eaa5a', 'raphael-core' => '51ee6b43', 'raphael-g' => '40dde778', diff --git a/src/applications/ponder/controller/PonderAnswerHistoryController.php b/src/applications/ponder/controller/PonderAnswerHistoryController.php --- a/src/applications/ponder/controller/PonderAnswerHistoryController.php +++ b/src/applications/ponder/controller/PonderAnswerHistoryController.php @@ -24,6 +24,7 @@ $aid = $answer->getID(); $crumbs = $this->buildApplicationCrumbs(); + $crumbs->setBorder(true); $crumbs->addTextCrumb("Q{$qid}", "/Q{$qid}"); $crumbs->addTextCrumb("A{$aid}", "/Q{$qid}#{$aid}"); $crumbs->addTextCrumb(pht('History')); diff --git a/src/applications/ponder/controller/PonderQuestionHistoryController.php b/src/applications/ponder/controller/PonderQuestionHistoryController.php --- a/src/applications/ponder/controller/PonderQuestionHistoryController.php +++ b/src/applications/ponder/controller/PonderQuestionHistoryController.php @@ -22,6 +22,7 @@ $qid = $question->getID(); $crumbs = $this->buildApplicationCrumbs(); + $crumbs->setBorder(true); $crumbs->addTextCrumb("Q{$qid}", "/Q{$qid}"); $crumbs->addTextCrumb(pht('History')); diff --git a/src/applications/ponder/controller/PonderQuestionViewController.php b/src/applications/ponder/controller/PonderQuestionViewController.php --- a/src/applications/ponder/controller/PonderQuestionViewController.php +++ b/src/applications/ponder/controller/PonderQuestionViewController.php @@ -3,11 +3,11 @@ final class PonderQuestionViewController extends PonderController { public function handleRequest(AphrontRequest $request) { - $user = $request->getViewer(); + $viewer = $request->getViewer(); $id = $request->getURIData('id'); $question = id(new PonderQuestionQuery()) - ->setViewer($user) + ->setViewer($viewer) ->withIDs(array($id)) ->needAnswers(true) ->needViewerVotes(true) @@ -16,15 +16,15 @@ return new Aphront404Response(); } - $question->attachVotes($user->getPHID()); + $question->attachVotes($viewer->getPHID()); $question_xactions = $this->buildQuestionTransactions($question); $answers = $this->buildAnswers($question->getAnswers()); $authors = mpull($question->getAnswers(), null, 'getAuthorPHID'); - if (isset($authors[$user->getPHID()])) { + if (isset($authors[$viewer->getPHID()])) { $answer_add_panel = id(new PHUIInfoView()) - ->setSeverity(PHUIInfoView::SEVERITY_NODATA) + ->setSeverity(PHUIInfoView::SEVERITY_NOTICE) ->appendChild( pht( 'You have already answered this question. You can not answer '. @@ -33,14 +33,14 @@ $answer_add_panel = new PonderAddAnswerView(); $answer_add_panel ->setQuestion($question) - ->setUser($user) + ->setUser($viewer) ->setActionURI('/ponder/answer/add/'); } - $header = id(new PHUIHeaderView()) - ->setHeader($question->getTitle()) - ->setUser($user) - ->setPolicyObject($question); + $header = new PHUIHeaderView(); + $header->setHeader($question->getTitle()); + $header->setUser($viewer); + $header->setPolicyObject($question); if ($question->getStatus() == PonderQuestionStatus::STATUS_OPEN) { $header->setStatus('fa-square-o', 'bluegrey', pht('Open')); @@ -58,13 +58,22 @@ $crumbs = $this->buildApplicationCrumbs($this->buildSideNavView()); $crumbs->addTextCrumb('Q'.$id, '/Q'.$id); - return $this->buildApplicationPage( + $ponder_view = phutil_tag( + 'div', + array( + 'class' => 'ponder-question-view', + ), array( $crumbs, $object_box, $question_xactions, $answers, $answer_add_panel, + )); + + return $this->buildApplicationPage( + array( + $ponder_view, ), array( 'title' => 'Q'.$question->getID().' '.$question->getTitle(), @@ -75,9 +84,8 @@ } private function buildActionListView(PonderQuestion $question) { + $viewer = $this->getViewer(); $request = $this->getRequest(); - $viewer = $request->getUser(); - $id = $question->getID(); $can_edit = PhabricatorPolicyFilter::hasCapability( @@ -86,7 +94,7 @@ PhabricatorPolicyCapability::CAN_EDIT); $view = id(new PhabricatorActionListView()) - ->setUser($request->getUser()) + ->setUser($viewer) ->setObject($question) ->setObjectURI($request->getRequestURI()); @@ -130,17 +138,13 @@ PonderQuestion $question, PhabricatorActionListView $actions) { - $viewer = $this->getRequest()->getUser(); + $viewer = $this->getViewer(); $view = id(new PHUIPropertyListView()) ->setUser($viewer) ->setObject($question) ->setActionList($actions); $view->addProperty( - pht('Status'), - PonderQuestionStatus::getQuestionStatusFullName($question->getStatus())); - - $view->addProperty( pht('Author'), $viewer->renderHandle($question->getAuthorPHID())); @@ -209,8 +213,7 @@ * standard fashion. This is necessary to scale this application. */ private function buildAnswers(array $answers) { - $request = $this->getRequest(); - $viewer = $request->getUser(); + $viewer = $this->getViewer(); $out = array(); @@ -283,9 +286,8 @@ } private function buildAnswerActions(PonderAnswer $answer) { + $viewer = $this->getViewer(); $request = $this->getRequest(); - $viewer = $request->getUser(); - $id = $answer->getID(); $can_edit = PhabricatorPolicyFilter::hasCapability( @@ -294,7 +296,7 @@ PhabricatorPolicyCapability::CAN_EDIT); $view = id(new PhabricatorActionListView()) - ->setUser($request->getUser()) + ->setUser($viewer) ->setObject($answer) ->setObjectURI($request->getRequestURI()); @@ -319,7 +321,7 @@ PonderAnswer $answer, PhabricatorActionListView $actions) { - $viewer = $this->getRequest()->getUser(); + $viewer = $this->getViewer(); $view = id(new PHUIPropertyListView()) ->setUser($viewer) ->setObject($answer) @@ -366,7 +368,7 @@ $hide_id = celerity_generate_unique_node_id(); Javelin::initBehavior('phabricator-reveal-content'); - require_celerity_resource('ponder-comment-table-css'); + require_celerity_resource('ponder-view-css'); $show = phutil_tag( 'div', @@ -389,6 +391,7 @@ $hide = phutil_tag( 'div', array( + 'class' => 'ponder-comments-view', 'id' => $hide_id, 'style' => 'display: none', ), diff --git a/src/applications/ponder/view/PonderVotableView.php b/src/applications/ponder/view/PonderVotableView.php --- a/src/applications/ponder/view/PonderVotableView.php +++ b/src/applications/ponder/view/PonderVotableView.php @@ -28,7 +28,7 @@ } public function render() { - require_celerity_resource('ponder-vote-css'); + require_celerity_resource('ponder-view-css'); require_celerity_resource('javelin-behavior-ponder-votebox'); Javelin::initBehavior('ponder-votebox', array()); diff --git a/webroot/rsrc/css/application/ponder/comments.css b/webroot/rsrc/css/application/ponder/comments.css deleted file mode 100644 --- a/webroot/rsrc/css/application/ponder/comments.css +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @provides ponder-comment-table-css - */ - -.ponder-show-comments { - text-align: center; - padding: 8px; - margin: 0 16px; - float: right; - font-weight: bold; - background: #fff; - border-bottom: 1px solid {$blueborder}; - border-left: 1px solid {$lightblueborder}; - border-right: 1px solid {$lightblueborder}; -} - -.ponder-comments { - width: 480px; - margin: 5px 0 0 60px; -} - -.device .ponder-comments { - width: 100%; - margin: 5px 0 0 0; -} - -.ponder-comments th { - width: 0px; - height: 0px; -} - -.ponder-comments td { - vertical-align: top; - padding: 6px; - border-bottom: 1px solid {$thinblueborder}; - background: #fff; -} - -.ponder-datestamp { - font-size: {$smallestfontsize}; - color: {$greytext}; -} - -.ponder-label { - display: block; - width: 100%; - font-weight: bold; - color: #333; - text-align: left; - margin: 0px 0px 6px; - padding: 6px 4px; - background: #ccc; - border-bottom: 1px solid #aaa; - cursor: pointer; -} - -td .aphront-form-control { - padding: 0; -} - -td .aphront-form-control-submit { - display: block; -} - -td .aphront-form-input { - margin: 0; - width: 100%; -} - -td .aphront-form-control textarea { - height: 50px; -} - -.ponder-comment-markup p { - margin: 0 0 5px 0; -} - -.ponder-comment-markup h2, -.ponder-comment-markup h3, -.ponder-comment-markup h4, -.ponder-comment-markup h5 { - margin: 0; - font-size: inherit; - font-weight: normal; -} diff --git a/webroot/rsrc/css/application/ponder/feed.css b/webroot/rsrc/css/application/ponder/feed.css deleted file mode 100644 --- a/webroot/rsrc/css/application/ponder/feed.css +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @provides ponder-feed-view-css - */ - -.ponder-question-summary { - width: 100%; - background: #DFDFE3; - float: left; - clear: both; - margin-top: 1px; - padding: 1px; -} - -.ponder-answer-summary { - width : 100%; - background : #DFDFE3; - float : left; - clear : both; - margin-top : 1px; - padding : 1px; -} - -.ponder-summary-votes { - width : 50px; - height : 36pt; - font-size : 18pt; - text-align : center; - background : #EEE; - border : 1px solid #BBB; - float : left; - margin : 2px; - padding-top : 2px; -} - -.ponder-summary-answers { - width : 50px; - height : 36pt; - font-size : 18pt; - text-align : center; - background : #EEE; - border : 1px solid #BBB; - float : left; - margin : 2px; - padding-top : 2px; -} - -.ponder-question-label { - font-size : 6pt; -} - -h2.ponder-question-title { - font-size : 12pt; - margin : 2px; - padding : 0; -} - -h2.ponder-answer-title { - font-size : 12pt; - margin : 2px; - padding : 0; -} - -.ponder-metadata { - padding-left : 5px; - width : 650px; - float : left; -} - -.ponder-small-metadata { - font-size : 7.5pt; - color : #555; - margin : 0; - text-align : right; -} diff --git a/webroot/rsrc/css/application/ponder/vote.css b/webroot/rsrc/css/application/ponder/ponder-view.css rename from webroot/rsrc/css/application/ponder/vote.css rename to webroot/rsrc/css/application/ponder/ponder-view.css --- a/webroot/rsrc/css/application/ponder/vote.css +++ b/webroot/rsrc/css/application/ponder/ponder-view.css @@ -1,5 +1,5 @@ /** - * @provides ponder-vote-css + * @provides ponder-view-css */ .ponder-votable { @@ -40,3 +40,20 @@ line-height: 20px; font-weight: bold; } + +.ponder-show-comments { + text-align: center; + padding: 8px; + margin: 0 16px; + float: right; + font-weight: bold; + background: #fff; + border-bottom: 1px solid {$blueborder}; + border-left: 1px solid {$lightblueborder}; + border-right: 1px solid {$lightblueborder}; +} + +.device-desktop .ponder-comments-view { + width: 90%; + margin: 0 auto; +} diff --git a/webroot/rsrc/css/application/ponder/post.css b/webroot/rsrc/css/application/ponder/post.css deleted file mode 100644 --- a/webroot/rsrc/css/application/ponder/post.css +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @provides ponder-post-css - */ - -.ponder-post-list { - max-width: 1162px; -} - -.ponder-add-answer-panel { - max-width: 1162px; -} - -.ponder-post-list .anchor-target { - background-color: #ffffdd; - border-color: #ffff00; -} - -.ponder-post-core .phabricator-remarkup .remarkup-code-block { - width: 88ex; - width: 81ch; -} - -.ponder-question { - background: white; -}