@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

adding comments to ponder

Summary: This is pretty spartan, but it does the job.

Test Plan:
Patch, update storage, add some comment
to your favorite question or answer.

Reviewers: nh, vrana, epriestley

Reviewed By: epriestley

CC: aran, Korvin, starruler, syrneus, me.here, victorzarate7

Maniphest Tasks: T1645

Differential Revision: https://secure.phabricator.com/D3471

+630 -20
+11
resources/sql/patches/ponder-comments.sql
··· 1 + CREATE TABLE `{$NAMESPACE}_ponder`.`ponder_comment` ( 2 + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 3 + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, 4 + `targetPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, 5 + `content` longtext CHARACTER SET utf8 NOT NULL, 6 + `dateCreated` int(10) unsigned NOT NULL, 7 + `dateModified` int(10) unsigned NOT NULL, 8 + PRIMARY KEY (`id`), 9 + KEY `authorPHID` (`authorPHID`), 10 + KEY `targetPHID` (`targetPHID`) 11 + ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+12 -3
src/__celerity_resource_map__.php
··· 2851 2851 ), 2852 2852 'disk' => '/rsrc/css/application/phriction/phriction-document-css.css', 2853 2853 ), 2854 + 'ponder-comment-table-css' => 2855 + array( 2856 + 'uri' => '/res/a1bb9056/rsrc/css/application/ponder/comments.css', 2857 + 'type' => 'css', 2858 + 'requires' => 2859 + array( 2860 + ), 2861 + 'disk' => '/rsrc/css/application/ponder/comments.css', 2862 + ), 2854 2863 'ponder-core-view-css' => 2855 2864 array( 2856 - 'uri' => '/res/4a6e2fc7/rsrc/css/application/ponder/core.css', 2865 + 'uri' => '/res/3a2d5e18/rsrc/css/application/ponder/core.css', 2857 2866 'type' => 'css', 2858 2867 'requires' => 2859 2868 array( ··· 2871 2880 ), 2872 2881 'ponder-post-css' => 2873 2882 array( 2874 - 'uri' => '/res/32c960df/rsrc/css/application/ponder/post.css', 2883 + 'uri' => '/res/013b9e2c/rsrc/css/application/ponder/post.css', 2875 2884 'type' => 'css', 2876 2885 'requires' => 2877 2886 array( ··· 2880 2889 ), 2881 2890 'ponder-vote-css' => 2882 2891 array( 2883 - 'uri' => '/res/923bcf97/rsrc/css/application/ponder/vote.css', 2892 + 'uri' => '/res/d4dff9ba/rsrc/css/application/ponder/vote.css', 2884 2893 'type' => 'css', 2885 2894 'requires' => 2886 2895 array(
+16 -2
src/__phutil_library_map__.php
··· 1164 1164 'PhrictionHistoryController' => 'applications/phriction/controller/PhrictionHistoryController.php', 1165 1165 'PhrictionListController' => 'applications/phriction/controller/PhrictionListController.php', 1166 1166 'PonderAddAnswerView' => 'applications/ponder/view/PonderAddAnswerView.php', 1167 + 'PonderAddCommentView' => 'applications/ponder/view/PonderAddCommentView.php', 1167 1168 'PonderAnswer' => 'applications/ponder/storage/PonderAnswer.php', 1168 1169 'PonderAnswerEditor' => 'applications/ponder/editor/PonderAnswerEditor.php', 1169 1170 'PonderAnswerListView' => 'applications/ponder/view/PonderAnswerListView.php', ··· 1172 1173 'PonderAnswerSaveController' => 'applications/ponder/controller/PonderAnswerSaveController.php', 1173 1174 'PonderAnswerSummaryView' => 'applications/ponder/view/PonderAnswerSummaryView.php', 1174 1175 'PonderAnswerViewController' => 'applications/ponder/controller/PonderAnswerViewController.php', 1175 - 'PonderCommentBodyView' => 'applications/ponder/view/PonderCommentBodyView.php', 1176 + 'PonderComment' => 'applications/ponder/storage/PonderComment.php', 1177 + 'PonderCommentListView' => 'applications/ponder/view/PonderCommentListView.php', 1178 + 'PonderCommentQuery' => 'applications/ponder/query/PonderCommentQuery.php', 1179 + 'PonderCommentSaveController' => 'applications/ponder/controller/PonderCommentSaveController.php', 1176 1180 'PonderConstants' => 'applications/ponder/PonderConstants.php', 1177 1181 'PonderController' => 'applications/ponder/controller/PonderController.php', 1178 1182 'PonderDAO' => 'applications/ponder/storage/PonderDAO.php', 1179 1183 'PonderFeedController' => 'applications/ponder/controller/PonderFeedController.php', 1184 + 'PonderPostBodyView' => 'applications/ponder/view/PonderPostBodyView.php', 1180 1185 'PonderQuestion' => 'applications/ponder/storage/PonderQuestion.php', 1181 1186 'PonderQuestionAskController' => 'applications/ponder/controller/PonderQuestionAskController.php', 1182 1187 'PonderQuestionDetailView' => 'applications/ponder/view/PonderQuestionDetailView.php', ··· 2248 2253 'PhrictionHistoryController' => 'PhrictionController', 2249 2254 'PhrictionListController' => 'PhrictionController', 2250 2255 'PonderAddAnswerView' => 'AphrontView', 2256 + 'PonderAddCommentView' => 'AphrontView', 2251 2257 'PonderAnswer' => 2252 2258 array( 2253 2259 0 => 'PonderDAO', ··· 2260 2266 'PonderAnswerSaveController' => 'PonderController', 2261 2267 'PonderAnswerSummaryView' => 'AphrontView', 2262 2268 'PonderAnswerViewController' => 'PonderController', 2263 - 'PonderCommentBodyView' => 'AphrontView', 2269 + 'PonderComment' => 2270 + array( 2271 + 0 => 'PonderDAO', 2272 + 1 => 'PhabricatorMarkupInterface', 2273 + ), 2274 + 'PonderCommentListView' => 'AphrontView', 2275 + 'PonderCommentQuery' => 'PhabricatorQuery', 2276 + 'PonderCommentSaveController' => 'PonderController', 2264 2277 'PonderController' => 'PhabricatorController', 2265 2278 'PonderDAO' => 'PhabricatorLiskDAO', 2266 2279 'PonderFeedController' => 'PonderController', 2280 + 'PonderPostBodyView' => 'AphrontView', 2267 2281 'PonderQuestion' => 2268 2282 array( 2269 2283 0 => 'PonderDAO',
+1
src/applications/ponder/application/PhabricatorApplicationPonder.php
··· 53 53 'answer/preview/' => 'PonderAnswerPreviewController', 54 54 'question/ask/' => 'PonderQuestionAskController', 55 55 'question/preview/' => 'PonderQuestionPreviewController', 56 + 'comment/add/' => 'PonderCommentSaveController', 56 57 '(?P<kind>question)/vote/' => 'PonderVoteSaveController', 57 58 '(?P<kind>answer)/vote/' => 'PonderVoteSaveController' 58 59 ));
+1 -1
src/applications/ponder/controller/PonderAnswerPreviewController.php
··· 38 38 $answer->setContent($request->getStr('content')); 39 39 $answer->setAuthorPHID($author_phid); 40 40 41 - $view = new PonderCommentBodyView(); 41 + $view = new PonderPostBodyView(); 42 42 $view 43 43 ->setQuestion($question) 44 44 ->setTarget($answer)
+58
src/applications/ponder/controller/PonderCommentSaveController.php
··· 1 + <?php 2 + 3 + /* 4 + * Copyright 2012 Facebook, Inc. 5 + * 6 + * Licensed under the Apache License, Version 2.0 (the "License"); 7 + * you may not use this file except in compliance with the License. 8 + * You may obtain a copy of the License at 9 + * 10 + * http://www.apache.org/licenses/LICENSE-2.0 11 + * 12 + * Unless required by applicable law or agreed to in writing, software 13 + * distributed under the License is distributed on an "AS IS" BASIS, 14 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 + * See the License for the specific language governing permissions and 16 + * limitations under the License. 17 + */ 18 + 19 + final class PonderCommentSaveController extends PonderController { 20 + 21 + public function processRequest() { 22 + $request = $this->getRequest(); 23 + if (!$request->isFormPost()) { 24 + return new Aphront400Response(); 25 + } 26 + 27 + $user = $request->getUser(); 28 + $question_id = $request->getInt('question_id'); 29 + $question = PonderQuestionQuery::loadSingle($user, $question_id); 30 + 31 + if (!$question) { 32 + return new Aphront404Response(); 33 + } 34 + 35 + $target = $request->getStr('target'); 36 + $objects = id(new PhabricatorObjectHandleData(array($target))) 37 + ->loadHandles(); 38 + if (!$objects) { 39 + return new Aphront404Response(); 40 + } 41 + $content = $request->getStr('content'); 42 + 43 + $res = new PonderComment(); 44 + $res 45 + ->setContent($content) 46 + ->setAuthorPHID($user->getPHID()) 47 + ->setTargetPHID($target) 48 + ->save(); 49 + 50 + PhabricatorSearchPonderIndexer::indexQuestion($question); 51 + 52 + return id(new AphrontRedirectResponse()) 53 + ->setURI( 54 + id(new PhutilURI('/Q'. $question->getID())) 55 + ->setFragment('comment-' . $res->getID())); 56 + } 57 + 58 + }
+1 -1
src/applications/ponder/controller/PonderQuestionPreviewController.php
··· 35 35 $question->setContent($request->getStr('content')); 36 36 $question->setAuthorPHID($author_phid); 37 37 38 - $view = new PonderCommentBodyView(); 38 + $view = new PonderPostBodyView(); 39 39 $view 40 40 ->setQuestion($question) 41 41 ->setTarget($question)
+11 -1
src/applications/ponder/controller/PonderQuestionViewController.php
··· 34 34 return new Aphront404Response(); 35 35 } 36 36 $question->attachRelated($user->getPHID()); 37 + $object_phids = array($user->getPHID(), $question->getAuthorPHID()); 38 + 37 39 $answers = $question->getAnswers(); 40 + $comments = $question->getComments(); 41 + foreach ($comments as $comment) { 42 + $object_phids[] = $comment->getAuthorPHID(); 43 + } 38 44 39 - $object_phids = array($user->getPHID(), $question->getAuthorPHID()); 40 45 foreach ($answers as $answer) { 41 46 $object_phids[] = $answer->getAuthorPHID(); 47 + 48 + $comments = $answer->getComments(); 49 + foreach ($comments as $comment) { 50 + $object_phids[] = $comment->getAuthorPHID(); 51 + } 42 52 } 43 53 44 54 $handles = $this->loadViewerHandles($object_phids);
+81
src/applications/ponder/query/PonderCommentQuery.php
··· 1 + <?php 2 + 3 + /* 4 + * Copyright 2012 Facebook, Inc. 5 + * 6 + * Licensed under the Apache License, Version 2.0 (the "License"); 7 + * you may not use this file except in compliance with the License. 8 + * You may obtain a copy of the License at 9 + * 10 + * http://www.apache.org/licenses/LICENSE-2.0 11 + * 12 + * Unless required by applicable law or agreed to in writing, software 13 + * distributed under the License is distributed on an "AS IS" BASIS, 14 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 + * See the License for the specific language governing permissions and 16 + * limitations under the License. 17 + */ 18 + 19 + final class PonderCommentQuery extends PhabricatorQuery { 20 + 21 + private $ids; 22 + private $authorPHID; 23 + private $targetPHIDs; 24 + 25 + public function withIDs($qids) { 26 + $this->ids = $qids; 27 + return $this; 28 + } 29 + 30 + public function withTargetPHIDs($phids) { 31 + $this->targetPHIDs = $phids; 32 + return $this; 33 + } 34 + 35 + public function withAuthorPHID($phid) { 36 + $this->authorPHID = $phid; 37 + return $this; 38 + } 39 + 40 + private function buildWhereClause($conn_r) { 41 + $where = array(); 42 + if ($this->ids) { 43 + $where[] = qsprintf($conn_r, 'id in (%Ls)', $this->ids); 44 + } 45 + if ($this->authorPHID) { 46 + $where[] = qsprintf($conn_r, 'authorPHID = %s', $this->authorPHID); 47 + } 48 + if ($this->targetPHIDs) { 49 + $where[] = qsprintf($conn_r, 'targetPHID in (%Ls)', $this->targetPHIDs); 50 + } 51 + 52 + return $this->formatWhereClause($where); 53 + } 54 + 55 + private function buildOrderByClause($conn_r) { 56 + return 'ORDER BY id'; 57 + } 58 + 59 + public function execute() { 60 + $comment = new PonderComment(); 61 + $conn_r = $comment->establishConnection('r'); 62 + 63 + $select = qsprintf( 64 + $conn_r, 65 + 'SELECT r.* FROM %T r', 66 + $comment->getTableName()); 67 + 68 + $where = $this->buildWhereClause($conn_r); 69 + $order_by = $this->buildOrderByClause($conn_r); 70 + 71 + return $comment->loadAllFromArray( 72 + queryfx_all( 73 + $conn_r, 74 + '%Q %Q %Q', 75 + $select, 76 + $where, 77 + $order_by)); 78 + } 79 + 80 + 81 + }
+10
src/applications/ponder/storage/PonderAnswer.php
··· 31 31 protected $voteCount; 32 32 private $vote; 33 33 private $question = null; 34 + private $comments; 34 35 35 36 public function setQuestion($question) { 36 37 $this->question = $question; ··· 51 52 52 53 public function getUserVote() { 53 54 return $this->vote; 55 + } 56 + 57 + public function setComments($comments) { 58 + $this->comments = $comments; 59 + return $this; 60 + } 61 + 62 + public function getComments() { 63 + return $this->comments; 54 64 } 55 65 56 66 public function getConfiguration() {
+57
src/applications/ponder/storage/PonderComment.php
··· 1 + <?php 2 + 3 + /* 4 + * Copyright 2012 Facebook, Inc. 5 + * 6 + * Licensed under the Apache License, Version 2.0 (the "License"); 7 + * you may not use this file except in compliance with the License. 8 + * You may obtain a copy of the License at 9 + * 10 + * http://www.apache.org/licenses/LICENSE-2.0 11 + * 12 + * Unless required by applicable law or agreed to in writing, software 13 + * distributed under the License is distributed on an "AS IS" BASIS, 14 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 + * See the License for the specific language governing permissions and 16 + * limitations under the License. 17 + */ 18 + 19 + final class PonderComment extends PonderDAO 20 + implements PhabricatorMarkupInterface { 21 + 22 + const MARKUP_FIELD_CONTENT = 'markup:content'; 23 + 24 + protected $targetPHID; 25 + protected $authorPHID; 26 + protected $content; 27 + 28 + public function getMarkupFieldKey($field) { 29 + $hash = PhabricatorHash::digest($this->getMarkupText($field)); 30 + $id = $this->getID(); 31 + return "ponder:c{$id}:{$field}:{$hash}"; 32 + } 33 + 34 + public function getMarkupText($field) { 35 + return $this->getContent(); 36 + } 37 + 38 + public function newMarkupEngine($field) { 39 + return PhabricatorMarkupEngine::newPonderMarkupEngine(); 40 + } 41 + 42 + public function didMarkupText( 43 + $field, 44 + $output, 45 + PhutilMarkupEngine $engine) { 46 + return $output; 47 + } 48 + 49 + public function shouldUseMarkupCache($field) { 50 + return (bool)$this->getID(); 51 + } 52 + 53 + public function getMarkupField() { 54 + return self::MARKUP_FIELD_CONTENT; 55 + } 56 + } 57 +
+23
src/applications/ponder/storage/PonderQuestion.php
··· 34 34 35 35 private $answers; 36 36 private $vote; 37 + private $comments; 37 38 38 39 public function getConfiguration() { 39 40 return array( ··· 76 77 $edges[$user_phid][PhabricatorEdgeConfig::TYPE_VOTING_USER_HAS_ANSWER]; 77 78 $edges = null; 78 79 80 + if ($qa_phids) { 81 + $comments = id(new PonderCommentQuery()) 82 + ->withTargetPHIDs($qa_phids) 83 + ->execute(); 84 + 85 + $comments = mgroup($comments, 'getTargetPHID'); 86 + } 87 + else { 88 + $comments = array(); 89 + } 90 + 79 91 $this->setUserVote(idx($question_edge, $this->getPHID())); 92 + $this->setComments(idx($comments, $this->getPHID(), array())); 80 93 foreach ($this->answers as $answer) { 81 94 $answer->setQuestion($this); 82 95 $answer->setUserVote(idx($answer_edges, $answer->getPHID())); 96 + $answer->setComments(idx($comments, $answer->getPHID(), array())); 83 97 } 84 98 } 85 99 ··· 93 107 94 108 public function getUserVote() { 95 109 return $this->vote; 110 + } 111 + 112 + public function setComments($comments) { 113 + $this->comments = $comments; 114 + return $this; 115 + } 116 + 117 + public function getComments() { 118 + return $this->comments; 96 119 } 97 120 98 121 public function getAnswers() {
+70
src/applications/ponder/view/PonderAddCommentView.php
··· 1 + <?php 2 + 3 + /* 4 + * Copyright 2012 Facebook, Inc. 5 + * 6 + * Licensed under the Apache License, Version 2.0 (the "License"); 7 + * you may not use this file except in compliance with the License. 8 + * You may obtain a copy of the License at 9 + * 10 + * http://www.apache.org/licenses/LICENSE-2.0 11 + * 12 + * Unless required by applicable law or agreed to in writing, software 13 + * distributed under the License is distributed on an "AS IS" BASIS, 14 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 + * See the License for the specific language governing permissions and 16 + * limitations under the License. 17 + */ 18 + 19 + final class PonderAddCommentView extends AphrontView { 20 + 21 + private $target; 22 + private $user; 23 + private $actionURI; 24 + private $questionID; 25 + 26 + public function setTarget($target) { 27 + $this->target = $target; 28 + return $this; 29 + } 30 + 31 + public function setUser(PhabricatorUser $user) { 32 + $this->user = $user; 33 + return $this; 34 + } 35 + 36 + public function setQuestionID($id) { 37 + $this->questionID = $id; 38 + return $this; 39 + } 40 + 41 + public function setActionURI($uri) { 42 + $this->actionURI = $uri; 43 + return $this; 44 + } 45 + 46 + public function render() { 47 + require_celerity_resource('ponder-comment-table-css'); 48 + 49 + $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); 50 + 51 + $questionID = $this->questionID; 52 + $target = $this->target; 53 + 54 + $form = new AphrontFormView(); 55 + $form 56 + ->setUser($this->user) 57 + ->setAction($this->actionURI) 58 + ->addHiddenInput('target', $target) 59 + ->addHiddenInput('question_id', $questionID) 60 + ->appendChild( 61 + id(new AphrontFormTextAreaControl()) 62 + ->setName('content') 63 + ->setEnableDragAndDropFileUploads(false)) 64 + ->appendChild( 65 + id(new AphrontFormSubmitControl()) 66 + ->setValue($is_serious ? 'Submit' : 'Editorialize')); 67 + 68 + return $form->render(); 69 + } 70 + }
+13 -1
src/applications/ponder/view/PonderAnswerListView.php
··· 73 73 ->setHeader("Responses:"); 74 74 75 75 foreach ($this->answers as $cur_answer) { 76 - $view = new PonderCommentBodyView(); 76 + $view = new PonderPostBodyView(); 77 77 $view 78 78 ->setQuestion($question) 79 79 ->setTarget($cur_answer) ··· 81 81 ->setHandles($handles) 82 82 ->setUser($user); 83 83 84 + $commentview = new PonderCommentListView(); 85 + $commentview 86 + ->setUser($user) 87 + ->setHandles($handles) 88 + ->setComments($cur_answer->getComments()) 89 + ->setTarget($cur_answer->getPHID()) 90 + ->setQuestionID($question->getID()) 91 + ->setActionURI(new PhutilURI('/ponder/comment/add/')); 92 + 84 93 $panel->appendChild($view); 94 + $panel->appendChild($commentview); 95 + $panel->appendChild('<div style="height: 40px; clear : both"></div>'); 96 + 85 97 } 86 98 87 99 return $panel->render();
+1 -1
src/applications/ponder/view/PonderCommentBodyView.php src/applications/ponder/view/PonderPostBodyView.php
··· 16 16 * limitations under the License. 17 17 */ 18 18 19 - final class PonderCommentBodyView extends AphrontView { 19 + final class PonderPostBodyView extends AphrontView { 20 20 21 21 private $target; 22 22 private $question;
+120
src/applications/ponder/view/PonderCommentListView.php
··· 1 + <?php 2 + 3 + /* 4 + * Copyright 2012 Facebook, Inc. 5 + * 6 + * Licensed under the Apache License, Version 2.0 (the "License"); 7 + * you may not use this file except in compliance with the License. 8 + * You may obtain a copy of the License at 9 + * 10 + * http://www.apache.org/licenses/LICENSE-2.0 11 + * 12 + * Unless required by applicable law or agreed to in writing, software 13 + * distributed under the License is distributed on an "AS IS" BASIS, 14 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 + * See the License for the specific language governing permissions and 16 + * limitations under the License. 17 + */ 18 + 19 + final class PonderCommentListView extends AphrontView { 20 + private $user; 21 + private $handles; 22 + private $comments; 23 + private $target; 24 + private $actionURI; 25 + private $questionID; 26 + 27 + public function setUser(PhabricatorUser $user) { 28 + $this->user = $user; 29 + return $this; 30 + } 31 + 32 + public function setHandles(array $handles) { 33 + assert_instances_of($handles, 'PhabricatorObjectHandle'); 34 + $this->handles = $handles; 35 + return $this; 36 + } 37 + 38 + public function setComments(array $comments) { 39 + assert_instances_of($comments, 'PonderComment'); 40 + $this->comments = $comments; 41 + return $this; 42 + } 43 + 44 + public function setQuestionID($id) { 45 + $this->questionID = $id; 46 + return $this; 47 + } 48 + 49 + public function setActionURI($uri) { 50 + $this->actionURI = $uri; 51 + return $this; 52 + } 53 + 54 + public function setTarget($target) { 55 + $this->target = $target; 56 + return $this; 57 + } 58 + 59 + public function render() { 60 + require_celerity_resource('phabricator-remarkup-css'); 61 + require_celerity_resource('ponder-comment-table-css'); 62 + 63 + $user = $this->user; 64 + $handles = $this->handles; 65 + $comments = $this->comments; 66 + 67 + $comment_markup = array(); 68 + 69 + foreach ($comments as $comment) { 70 + $handle = $handles[$comment->getAuthorPHID()]; 71 + $body = PhabricatorMarkupEngine::renderOneObject( 72 + $comment, 73 + $comment->getMarkupField(), 74 + $this->user); 75 + 76 + $comment_anchor = '<a name="comment-' . $comment->getID() . '" />'; 77 + $comment_markup[] = 78 + '<tr>'. 79 + '<th>'. 80 + $comment_anchor. 81 + '</th>'. 82 + '<td>'. 83 + '<div class="phabricator-remarkup ponder-comment-markup">'. 84 + $body. 85 + '&nbsp;&mdash;'. 86 + $handle->renderLink(). 87 + '&nbsp;'. 88 + '<span class="ponder-datestamp">'. 89 + phabricator_datetime($comment->getDateCreated(), $user). 90 + '</span>'. 91 + '</div>'. 92 + '</td>'. 93 + '</tr>'; 94 + } 95 + 96 + $addview = id(new PonderAddCommentView) 97 + ->setTarget($this->target) 98 + ->setUser($user) 99 + ->setQuestionID($this->questionID) 100 + ->setActionURI($this->actionURI); 101 + 102 + $comment_markup[] = 103 + '<tr>'. 104 + '<th>&nbsp;</th>'. 105 + '<td>'.$addview->render().'</td>'. 106 + '</tr>'; 107 + 108 + $comment_markup = phutil_render_tag( 109 + 'table', 110 + array( 111 + 'class' => 'ponder-comments', 112 + ), 113 + implode("\n", $comment_markup) 114 + ); 115 + 116 + 117 + return $comment_markup; 118 + } 119 + 120 + }
+11 -1
src/applications/ponder/view/PonderQuestionDetailView.php
··· 48 48 ->addClass("ponder-panel") 49 49 ->setHeader($this->renderObjectLink().' '.$question->getTitle()); 50 50 51 - $contentview = new PonderCommentBodyView(); 51 + $contentview = new PonderPostBodyView(); 52 52 $contentview 53 53 ->setTarget($question) 54 54 ->setQuestion($question) ··· 56 56 ->setHandles($handles) 57 57 ->setAction(PonderConstants::ASKED_LITERAL); 58 58 59 + $commentview = new PonderCommentListView(); 60 + $commentview 61 + ->setUser($user) 62 + ->setHandles($handles) 63 + ->setComments($question->getComments()) 64 + ->setTarget($question->getPHID()) 65 + ->setQuestionID($question->getID()) 66 + ->setActionURI(new PhutilURI('/ponder/comment/add/')); 67 + 59 68 $panel->appendChild($contentview); 69 + $panel->appendChild($commentview); 60 70 61 71 return $panel->render(); 62 72 }
-1
src/applications/ponder/view/PonderVotableView.php
··· 61 61 '<div id="'.phutil_escape_html($this->phid).'" class="ponder-votebox"> 62 62 </div>'. 63 63 $this->renderChildren(). 64 - '<div class="ponder-votable-bottom"></div>'. 65 64 '</div>'; 66 65 67 66 return $content;
+4
src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
··· 972 972 'type' => 'sql', 973 973 'name' => $this->getPatchPath('edgetype.sql'), 974 974 ), 975 + 'ponder-comments.sql' => array( 976 + 'type' => 'sql', 977 + 'name' => $this->getPatchPath('ponder-comments.sql'), 978 + ), 975 979 ); 976 980 } 977 981
+104
webroot/rsrc/css/application/ponder/comments.css
··· 1 + /** 2 + * @provides ponder-comment-table-css 3 + */ 4 + 5 + 6 + .ponder-comments { 7 + width: 600px; 8 + margin : 0; 9 + margin-left : 120px; 10 + } 11 + 12 + .ponder-comments th { 13 + width : 0px; 14 + height : 0px; 15 + } 16 + 17 + .ponder-comments td { 18 + vertical-align: top; 19 + padding: 6px 2px; 20 + border-bottom: 1px dotted #d0d0d0; 21 + background : #FFF; 22 + } 23 + 24 + .ponder-datestamp { 25 + font-size: 9px; 26 + font-family: "Verdana"; 27 + color: #666666; 28 + } 29 + 30 + .ponder-label { 31 + display: block; 32 + width: 100%; 33 + font-size: 14px; 34 + font-weight: bold; 35 + color: #222222; 36 + text-align: left; 37 + margin: 0px 0px 6px; 38 + padding: 6px 4px; 39 + background: #cccccc; 40 + border-bottom: 1px solid #aaaaaa; 41 + cursor: pointer; 42 + } 43 + 44 + td .aphront-form-control { 45 + padding : 0; 46 + } 47 + 48 + td .aphront-form-control-submit { 49 + float : right; 50 + margin : 0; 51 + padding : 0; 52 + } 53 + 54 + .aphront-form-control-submit button { 55 + margin : 0; 56 + } 57 + 58 + 59 + td .aphront-form-input { 60 + margin : 0; 61 + width : 100%; 62 + } 63 + 64 + td .aphront-form-control textarea { 65 + height : 40px; 66 + width : 560px; 67 + padding : 0; 68 + margin : 0; 69 + background : #EEE; 70 + border : 1px solid #CCC; 71 + } 72 + 73 + div.ponder-comment-markup { 74 + padding-left : 5px; 75 + } 76 + 77 + 78 + .ponder-comment-markup p { 79 + margin : 0; 80 + } 81 + 82 + .ponder-comment-markup h2 { 83 + margin : 0; 84 + font-size : inherit; 85 + font-weight : normal; 86 + } 87 + 88 + .ponder-comment-markup h3 { 89 + margin : 0; 90 + font-size : inherit; 91 + font-weight : normal; 92 + } 93 + 94 + .ponder-comment-markup h4 { 95 + margin : 0; 96 + font-size : inherit; 97 + font-weight : normal; 98 + } 99 + 100 + .ponder-comment-markup h5 { 101 + margin : 0; 102 + font-size : inherit; 103 + font-weight : normal; 104 + }
+8 -3
webroot/rsrc/css/application/ponder/core.css
··· 10 10 11 11 .ponder-panel { 12 12 max-width: 800px; 13 - font-family : antiqua, verdana, arial; 13 + padding-left : 30px; 14 + border : none; 15 + background : white; 14 16 } 15 17 16 18 .ponder-panel h1 { 17 - padding-bottom: 8px; 18 - margin-bottom: 8px; 19 + margin-left : -30px; 20 + margin-right : -50px; 21 + margin-bottom: 0px; 22 + padding-bottom : 4px; 19 23 font-size : 1.5em; 24 + border-bottom : 1px solid #AAA; 20 25 } 21 26 22 27 .ponder-panel .aphront-form-view {
+12 -3
webroot/rsrc/css/application/ponder/post.css
··· 20 20 width: 81ch; 21 21 } 22 22 23 + .ponder-question { 24 + background : white; 25 + } 26 + 23 27 .phabricator-transaction-view .ponder-question { 24 - border-color: #777; 28 + background : white; 25 29 } 26 30 27 31 .phabricator-transaction-detail .ponder-question { 28 - border-color: #777; 32 + border : none; 29 33 } 30 34 31 35 32 36 .phabricator-transaction-view .ponder-answer { 33 - /* border-color: #203791; */ 37 + background : white; 38 + margin-bottom : 0; 39 + } 40 + 41 + .phabricator-transaction-content { 42 + background : white; 34 43 }
+5 -2
webroot/rsrc/css/application/ponder/vote.css
··· 2 2 * @provides ponder-vote-css 3 3 */ 4 4 5 - .ponder-votable { 6 - min-height : 120px; 5 + 6 + 7 + .ponder-votable .phabricator-transaction-view { 8 + margin : 0; 9 + padding : 0; 7 10 } 8 11 9 12 .ponder-votable .phabricator-transaction-detail {