@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.

Remove two unused Ponder views

Summary: Ref T3578. No callsites.

Test Plan: grep

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3578

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

-174
-4
src/__phutil_library_map__.php
··· 1903 1903 'PonderQuestionSearchEngine' => 'applications/ponder/query/PonderQuestionSearchEngine.php', 1904 1904 'PonderQuestionStatus' => 'applications/ponder/constants/PonderQuestionStatus.php', 1905 1905 'PonderQuestionStatusController' => 'applications/ponder/controller/PonderQuestionStatusController.php', 1906 - 'PonderQuestionSummaryView' => 'applications/ponder/view/PonderQuestionSummaryView.php', 1907 1906 'PonderQuestionViewController' => 'applications/ponder/controller/PonderQuestionViewController.php', 1908 1907 'PonderRemarkupRule' => 'applications/ponder/remarkup/PonderRemarkupRule.php', 1909 1908 'PonderReplyHandler' => 'applications/ponder/mail/PonderReplyHandler.php', 1910 1909 'PonderSearchIndexer' => 'applications/ponder/search/PonderSearchIndexer.php', 1911 - 'PonderUserProfileView' => 'applications/ponder/view/PonderUserProfileView.php', 1912 1910 'PonderVotableInterface' => 'applications/ponder/storage/PonderVotableInterface.php', 1913 1911 'PonderVotableView' => 'applications/ponder/view/PonderVotableView.php', 1914 1912 'PonderVote' => 'applications/ponder/constants/PonderVote.php', ··· 4035 4033 'PonderQuestionSearchEngine' => 'PhabricatorApplicationSearchEngine', 4036 4034 'PonderQuestionStatus' => 'PonderConstants', 4037 4035 'PonderQuestionStatusController' => 'PonderController', 4038 - 'PonderQuestionSummaryView' => 'AphrontView', 4039 4036 'PonderQuestionViewController' => 'PonderController', 4040 4037 'PonderRemarkupRule' => 'PhabricatorRemarkupRuleObject', 4041 4038 'PonderReplyHandler' => 'PhabricatorMailReplyHandler', 4042 4039 'PonderSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 4043 - 'PonderUserProfileView' => 'AphrontView', 4044 4040 'PonderVotableView' => 'AphrontView', 4045 4041 'PonderVote' => 'PonderConstants', 4046 4042 'PonderVoteEditor' => 'PhabricatorEditor',
-72
src/applications/ponder/view/PonderQuestionSummaryView.php
··· 1 - <?php 2 - 3 - final class PonderQuestionSummaryView extends AphrontView { 4 - private $question; 5 - private $handles; 6 - 7 - public function setQuestion($question) { 8 - $this->question = $question; 9 - return $this; 10 - } 11 - 12 - public function setHandles($handles) { 13 - $this->handles = $handles; 14 - return $this; 15 - } 16 - 17 - public function render() { 18 - require_celerity_resource('ponder-feed-view-css'); 19 - 20 - $user = $this->user; 21 - $question = $this->question; 22 - $author_phid = $question->getAuthorPHID(); 23 - $handles = $this->handles; 24 - 25 - $authorlink = $handles[$author_phid] 26 - ->renderLink(); 27 - 28 - $votecount = hsprintf( 29 - '<div class="ponder-summary-votes">'. 30 - '%s'. 31 - '<div class="ponder-question-label">votes</div>'. 32 - '</div>', 33 - $question->getVoteCount()); 34 - 35 - $answerclass = "ponder-summary-answers"; 36 - if ($question->getAnswercount() == 0) { 37 - $answerclass .= " ponder-not-answered"; 38 - } 39 - $answercount = hsprintf( 40 - '<div class="ponder-summary-answers">'. 41 - '%s'. 42 - '<div class="ponder-question-label">answers</div>'. 43 - '</div>', 44 - $question->getAnswerCount()); 45 - 46 - $title = hsprintf('<h2 class="ponder-question-title">%s</h2>', 47 - phutil_tag( 48 - 'a', 49 - array( 50 - "href" => '/Q' . $question->getID(), 51 - ), 52 - 'Q' . $question->getID() . 53 - ' ' . $question->getTitle())); 54 - 55 - $rhs = hsprintf( 56 - '<div class="ponder-metadata">'. 57 - '%s <span class="ponder-small-metadata">asked on %s by %s</span>'. 58 - '</div>', 59 - $title, 60 - phabricator_datetime($question->getDateCreated(), $user), 61 - $authorlink); 62 - 63 - $summary = hsprintf( 64 - '<div class="ponder-question-summary">%s%s%s</div>', 65 - $votecount, 66 - $answercount, 67 - $rhs); 68 - 69 - 70 - return $summary; 71 - } 72 - }
-98
src/applications/ponder/view/PonderUserProfileView.php
··· 1 - <?php 2 - 3 - final class PonderUserProfileView extends AphrontView { 4 - private $questionoffset; 5 - private $answeroffset; 6 - private $answers; 7 - private $pagesize; 8 - private $uri; 9 - private $aparam; 10 - 11 - public function setQuestionOffset($offset) { 12 - $this->questionoffset = $offset; 13 - return $this; 14 - } 15 - 16 - public function setAnswerOffset($offset) { 17 - $this->answeroffset = $offset; 18 - return $this; 19 - } 20 - 21 - public function setAnswers($data) { 22 - $this->answers = $data; 23 - return $this; 24 - } 25 - 26 - public function setPageSize($pagesize) { 27 - $this->pagesize = $pagesize; 28 - return $this; 29 - } 30 - 31 - public function setURI($uri, $aparam) { 32 - $this->uri = $uri; 33 - $this->aparam = $aparam; 34 - return $this; 35 - } 36 - 37 - public function render() { 38 - require_celerity_resource('ponder-feed-view-css'); 39 - 40 - $user = $this->user; 41 - $aoffset = $this->answeroffset; 42 - $answers = $this->answers; 43 - $uri = $this->uri; 44 - $aparam = $this->aparam; 45 - $pagesize = $this->pagesize; 46 - 47 - $apagebuttons = id(new AphrontPagerView()) 48 - ->setPageSize($pagesize) 49 - ->setOffset($aoffset) 50 - ->setURI( 51 - $uri 52 - ->setFragment('answers'), 53 - $aparam); 54 - $answers = $apagebuttons->sliceResults($answers); 55 - 56 - $view = new PhabricatorObjectItemListView(); 57 - $view->setUser($user); 58 - $view->setNoDataString(pht('No matching answers.')); 59 - 60 - foreach ($answers as $answer) { 61 - $question = $answer->getQuestion(); 62 - $author_phid = $question->getAuthorPHID(); 63 - 64 - $item = new PhabricatorObjectItemView(); 65 - $item->setObject($answer); 66 - $href = id(new PhutilURI('/Q' . $question->getID())) 67 - ->setFragment('A' . $answer->getID()); 68 - $item->setHeader( 69 - 'A'.$answer->getID().' '.self::abbreviate($answer->getContent())); 70 - $item->setHref($href); 71 - 72 - $item->addAttribute( 73 - pht('Created %s', phabricator_date($answer->getDateCreated(), $user))); 74 - 75 - $item->addAttribute(pht('%d Vote(s)', $answer->getVoteCount())); 76 - 77 - $item->addAttribute( 78 - pht( 79 - 'Answer to %s', 80 - phutil_tag( 81 - 'a', 82 - array( 83 - 'href' => '/Q'.$question->getID(), 84 - ), 85 - self::abbreviate($question->getTitle())))); 86 - 87 - $view->addItem($item); 88 - } 89 - 90 - $view->appendChild($apagebuttons); 91 - 92 - return $view->render(); 93 - } 94 - 95 - private function abbreviate($w) { 96 - return phutil_utf8_shorten($w, 60); 97 - } 98 - }