@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 Ponder voting UI

Summary: Ref T6920, This just removes the old voting UI from Ponder.

Test Plan: Visit a Question, no voting UI

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T6920

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

+2 -215
+2 -11
resources/celerity/map.php
··· 93 93 'rsrc/css/application/policy/policy-edit.css' => '815c66f7', 94 94 'rsrc/css/application/policy/policy-transaction-detail.css' => '82100a43', 95 95 'rsrc/css/application/policy/policy.css' => '957ea14c', 96 - 'rsrc/css/application/ponder/ponder-view.css' => 'fcd6b398', 96 + 'rsrc/css/application/ponder/ponder-view.css' => '4e557c89', 97 97 'rsrc/css/application/projects/project-icon.css' => '4e3eaa5a', 98 98 'rsrc/css/application/releeph/releeph-core.css' => '9b3c5733', 99 99 'rsrc/css/application/releeph/releeph-preview-branch.css' => 'b7a6f4a5', ··· 400 400 'rsrc/js/application/phortune/phortune-credit-card-form.js' => '2290aeef', 401 401 'rsrc/js/application/policy/behavior-policy-control.js' => '7d470398', 402 402 'rsrc/js/application/policy/behavior-policy-rule-editor.js' => '5e9f347c', 403 - 'rsrc/js/application/ponder/behavior-votebox.js' => '4e9b766b', 404 403 'rsrc/js/application/projects/behavior-project-boards.js' => 'ba4fa35c', 405 404 'rsrc/js/application/projects/behavior-project-create.js' => '065227cc', 406 405 'rsrc/js/application/projects/behavior-reorder-columns.js' => 'e1d25dfb', ··· 632 631 'javelin-behavior-phui-object-box-tabs' => '2bfa2836', 633 632 'javelin-behavior-policy-control' => '7d470398', 634 633 'javelin-behavior-policy-rule-editor' => '5e9f347c', 635 - 'javelin-behavior-ponder-votebox' => '4e9b766b', 636 634 'javelin-behavior-project-boards' => 'ba4fa35c', 637 635 'javelin-behavior-project-create' => '065227cc', 638 636 'javelin-behavior-quicksand-blacklist' => '7927a7d3', ··· 811 809 'policy-css' => '957ea14c', 812 810 'policy-edit-css' => '815c66f7', 813 811 'policy-transaction-detail-css' => '82100a43', 814 - 'ponder-view-css' => 'fcd6b398', 812 + 'ponder-view-css' => '4e557c89', 815 813 'project-icon-css' => '4e3eaa5a', 816 814 'raphael-core' => '51ee6b43', 817 815 'raphael-g' => '40dde778', ··· 1141 1139 'javelin-behavior', 1142 1140 'javelin-stratcom', 1143 1141 'javelin-dom', 1144 - ), 1145 - '4e9b766b' => array( 1146 - 'javelin-behavior', 1147 - 'javelin-dom', 1148 - 'javelin-util', 1149 - 'javelin-stratcom', 1150 - 'javelin-request', 1151 1142 ), 1152 1143 '4fdb476d' => array( 1153 1144 'javelin-behavior',
-2
src/__phutil_library_map__.php
··· 3428 3428 'PonderSearchIndexer' => 'applications/ponder/search/PonderSearchIndexer.php', 3429 3429 'PonderTransactionFeedStory' => 'applications/ponder/feed/PonderTransactionFeedStory.php', 3430 3430 'PonderVotableInterface' => 'applications/ponder/storage/PonderVotableInterface.php', 3431 - 'PonderVotableView' => 'applications/ponder/view/PonderVotableView.php', 3432 3431 'PonderVote' => 'applications/ponder/constants/PonderVote.php', 3433 3432 'PonderVoteEditor' => 'applications/ponder/editor/PonderVoteEditor.php', 3434 3433 'PonderVoteSaveController' => 'applications/ponder/controller/PonderVoteSaveController.php', ··· 7628 7627 'PonderSchemaSpec' => 'PhabricatorConfigSchemaSpec', 7629 7628 'PonderSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 7630 7629 'PonderTransactionFeedStory' => 'PhabricatorApplicationTransactionFeedStory', 7631 - 'PonderVotableView' => 'AphrontView', 7632 7630 'PonderVote' => 'PonderConstants', 7633 7631 'PonderVoteEditor' => 'PhabricatorEditor', 7634 7632 'PonderVoteSaveController' => 'PonderController',
-14
src/applications/ponder/controller/PonderQuestionViewController.php
··· 155 155 156 156 $view->invokeWillRenderEvent(); 157 157 158 - $votable = id(new PonderVotableView()) 159 - ->setPHID($question->getPHID()) 160 - ->setURI($this->getApplicationURI('vote/')) 161 - ->setCount($question->getVoteCount()) 162 - ->setVote($question->getUserVote()); 163 - 164 158 $view->addSectionHeader(pht('Question')); 165 159 $view->addTextContent( 166 160 array( 167 - $votable, 168 161 phutil_tag( 169 162 'div', 170 163 array( ··· 334 327 335 328 $view->invokeWillRenderEvent(); 336 329 337 - $votable = id(new PonderVotableView()) 338 - ->setPHID($answer->getPHID()) 339 - ->setURI($this->getApplicationURI('vote/')) 340 - ->setCount($answer->getVoteCount()) 341 - ->setVote($answer->getUserVote()); 342 - 343 330 $view->addSectionHeader(pht('Answer')); 344 331 $view->addTextContent( 345 332 array( 346 - $votable, 347 333 phutil_tag( 348 334 'div', 349 335 array(
-92
src/applications/ponder/view/PonderVotableView.php
··· 1 - <?php 2 - 3 - final class PonderVotableView extends AphrontView { 4 - 5 - private $phid; 6 - private $uri; 7 - private $count; 8 - private $vote; 9 - 10 - public function setPHID($phid) { 11 - $this->phid = $phid; 12 - return $this; 13 - } 14 - 15 - public function setURI($uri) { 16 - $this->uri = $uri; 17 - return $this; 18 - } 19 - 20 - public function setCount($count) { 21 - $this->count = $count; 22 - return $this; 23 - } 24 - 25 - public function setVote($vote) { 26 - $this->vote = $vote; 27 - return $this; 28 - } 29 - 30 - public function render() { 31 - require_celerity_resource('ponder-view-css'); 32 - require_celerity_resource('javelin-behavior-ponder-votebox'); 33 - 34 - Javelin::initBehavior('ponder-votebox', array()); 35 - 36 - $uri = id(new PhutilURI($this->uri))->alter('phid', $this->phid); 37 - 38 - $up = javelin_tag( 39 - 'a', 40 - array( 41 - 'href' => (string)$uri, 42 - 'sigil' => 'upvote', 43 - 'mustcapture' => true, 44 - 'class' => ($this->vote > 0) ? 'ponder-vote-active' : null, 45 - ), 46 - "\xE2\x96\xB2"); 47 - 48 - $down = javelin_tag( 49 - 'a', 50 - array( 51 - 'href' => (string)$uri, 52 - 'sigil' => 'downvote', 53 - 'mustcapture' => true, 54 - 'class' => ($this->vote < 0) ? 'ponder-vote-active' : null, 55 - ), 56 - "\xE2\x96\xBC"); 57 - 58 - $count = javelin_tag( 59 - 'div', 60 - array( 61 - 'class' => 'ponder-vote-count', 62 - 'sigil' => 'ponder-vote-count', 63 - ), 64 - $this->count); 65 - 66 - return javelin_tag( 67 - 'div', 68 - array( 69 - 'class' => 'ponder-votable', 70 - 'sigil' => 'ponder-votable', 71 - 'meta' => array( 72 - 'count' => (int)$this->count, 73 - 'vote' => (int)$this->vote, 74 - ), 75 - ), 76 - array( 77 - javelin_tag( 78 - 'div', 79 - array( 80 - 'class' => 'ponder-votebox', 81 - ), 82 - array($up, $count, $down)), 83 - phutil_tag( 84 - 'div', 85 - array( 86 - 'class' => 'ponder-votebox-content', 87 - ), 88 - $this->renderChildren()), 89 - )); 90 - } 91 - 92 - }
-39
webroot/rsrc/css/application/ponder/ponder-view.css
··· 2 2 * @provides ponder-view-css 3 3 */ 4 4 5 - .ponder-votable { 6 - float: right; 7 - margin: 4px 0 4px 24px; 8 - } 9 - 10 - .ponder-votebox { 11 - border-radius: 4px; 12 - background: #f3f3f3; 13 - border: 1px solid {$blueborder}; 14 - text-align: center; 15 - width: 24px; 16 - } 17 - 18 - .ponder-votebox a { 19 - font-size: 20px; 20 - line-height: 24px; 21 - display: block; 22 - 23 - text-decoration: none; 24 - color: #aaaaaa; 25 - font-weight: normal; 26 - } 27 - 28 - .ponder-votebox a.ponder-vote-active { 29 - color: {$blue}; 30 - } 31 - 32 - .ponder-votebox a:hover { 33 - color: #ffffff; 34 - background: {$blue}; 35 - } 36 - 37 - .ponder-vote-count { 38 - color: {$darkbluetext}; 39 - font-size: {$biggerfontsize}; 40 - line-height: 20px; 41 - font-weight: bold; 42 - } 43 - 44 5 .ponder-show-comments { 45 6 text-align: center; 46 7 padding: 8px;
-57
webroot/rsrc/js/application/ponder/behavior-votebox.js
··· 1 - /** 2 - * @provides javelin-behavior-ponder-votebox 3 - * @requires javelin-behavior 4 - * javelin-dom 5 - * javelin-util 6 - * javelin-stratcom 7 - * javelin-request 8 - */ 9 - 10 - JX.behavior('ponder-votebox', function() { 11 - 12 - function handle_vote(e, vote) { 13 - e.kill(); 14 - 15 - var root = e.getNode('ponder-votable'); 16 - var data = e.getNodeData('ponder-votable'); 17 - 18 - if (data.vote != vote) { 19 - // Remove the user's current vote, if they have one. 20 - data.count -= data.vote; 21 - data.vote = vote; 22 - data.count += vote; 23 - } else { 24 - // User is undoing their vote. 25 - data.vote = 0; 26 - data.count -= vote; 27 - } 28 - 29 - var upv = JX.DOM.find(root, 'a', 'upvote'); 30 - JX.DOM.alterClass(upv, 'ponder-vote-active', (data.vote > 0)); 31 - 32 - var downv = JX.DOM.find(root, 'a', 'downvote'); 33 - JX.DOM.alterClass(downv, 'ponder-vote-active', (data.vote < 0)); 34 - 35 - JX.DOM.setContent( 36 - JX.DOM.find(root, 'div', 'ponder-vote-count'), 37 - data.count); 38 - 39 - new JX.Request(e.getTarget().href, JX.bag) 40 - .setData({vote: data.vote}) 41 - .send(); 42 - } 43 - 44 - JX.Stratcom.listen( 45 - 'click', 46 - 'downvote', 47 - function(e) { 48 - handle_vote(e, -1); 49 - }); 50 - 51 - JX.Stratcom.listen( 52 - 'click', 53 - 'upvote', 54 - function(e) { 55 - handle_vote(e, 1); 56 - }); 57 - });