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

More Ponder Answer polish

Summary: Fixes T9099, I think this is as much as I can come up with for unbeta. Cleans up the answer header (profile image, smaller font, smaller header). Cleans up voting (new, with color), and makes it a bit more readable.

Test Plan:
Review a number of answers in ponder with and without votes, comments.

{F720189}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9099

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

+63 -20
+2 -2
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' => '6a399881', 96 + 'rsrc/css/application/ponder/ponder-view.css' => '870153f4', 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', ··· 811 811 'policy-css' => '957ea14c', 812 812 'policy-edit-css' => '815c66f7', 813 813 'policy-transaction-detail-css' => '82100a43', 814 - 'ponder-view-css' => '6a399881', 814 + 'ponder-view-css' => '870153f4', 815 815 'project-icon-css' => '4e3eaa5a', 816 816 'raphael-core' => '51ee6b43', 817 817 'raphael-g' => '40dde778',
+4
src/applications/ponder/controller/PonderQuestionViewController.php
··· 223 223 $engine->process(); 224 224 225 225 $xaction_groups = mgroup($xactions, 'getObjectPHID'); 226 + $author_phids = mpull($answers, 'getAuthorPHID'); 227 + $handles = $this->loadViewerHandles($author_phids); 226 228 227 229 $view = array(); 228 230 foreach ($answers as $answer) { 229 231 $xactions = idx($xaction_groups, $answer->getPHID(), array()); 230 232 $id = $answer->getID(); 233 + $handle = $handles[$answer->getAuthorPHID()]; 231 234 232 235 $view[] = id(new PonderAnswerView()) 233 236 ->setUser($viewer) 234 237 ->setAnswer($answer) 235 238 ->setTransactions($xactions) 239 + ->setHandle($handle) 236 240 ->setMarkupEngine($engine); 237 241 238 242 }
+23 -12
src/applications/ponder/view/PonderAnswerView.php
··· 5 5 private $answer; 6 6 private $transactions; 7 7 private $engine; 8 + private $handle; 8 9 9 10 public function setAnswer($answer) { 10 11 $this->answer = $answer; ··· 21 22 return $this; 22 23 } 23 24 25 + public function setHandle($handle) { 26 + $this->handle = $handle; 27 + return $this; 28 + } 29 + 24 30 protected function getTagAttributes() { 25 31 return array( 26 32 'class' => 'ponder-answer-view', ··· 34 40 $status = $answer->getStatus(); 35 41 $author_phid = $answer->getAuthorPHID(); 36 42 $actions = $this->buildAnswerActions(); 43 + $handle = $this->handle; 37 44 $id = $answer->getID(); 38 45 39 46 if ($status == PonderAnswerStatus::ANSWER_STATUS_HIDDEN) { ··· 73 80 $header = id(new PHUIHeaderView()) 74 81 ->setUser($viewer) 75 82 ->setEpoch($answer->getDateCreated()) 76 - ->setHeader($viewer->renderHandle($author_phid)) 77 - ->addActionLink($action_button); 83 + ->setHeader($handle->getName()) 84 + ->addActionLink($action_button) 85 + ->setImage($handle->getImageURI()) 86 + ->setImageURL($handle->getURI()); 78 87 79 88 $content = phutil_tag( 80 89 'div', ··· 95 104 ->setCount(count($this->transactions)); 96 105 97 106 $votes = $answer->getVoteCount(); 98 - if ($votes) { 99 - $icon = id(new PHUIIconView()) 100 - ->setIconFont('fa-thumbs-up'); 101 - $helpful = phutil_tag( 102 - 'span', 103 - array( 104 - 'class' => 'ponder-footer-action', 105 - ), 106 - array($votes, $icon)); 107 - $footer->addAction($helpful); 107 + $vote_class = null; 108 + if ($votes > 0) { 109 + $vote_class = 'ponder-footer-action-helpful'; 108 110 } 111 + $icon = id(new PHUIIconView()) 112 + ->setIconFont('fa-thumbs-up msr'); 113 + $helpful = phutil_tag( 114 + 'span', 115 + array( 116 + 'class' => 'ponder-footer-action '.$vote_class, 117 + ), 118 + array($icon, $votes)); 119 + $footer->addAction($helpful); 109 120 110 121 $answer_view = id(new PHUIObjectBoxView()) 111 122 ->setHeader($header)
+8 -4
src/applications/ponder/view/PonderFooterView.php
··· 36 36 $content_id = $this->contentID; 37 37 38 38 if ($this->count == 0) { 39 + $icon = id(new PHUIIconView()) 40 + ->setIconFont('fa-plus-circle msr'); 39 41 $text = pht('Add a Comment'); 40 42 } else { 41 - $text = pht('Show %s Comments', new PhutilNumber($this->count)); 43 + $icon = id(new PHUIIconView()) 44 + ->setIconFont('fa-comments msr'); 45 + $text = pht('Show %d Comment(s)', new PhutilNumber($this->count)); 42 46 } 43 47 44 48 $actions = array(); ··· 54 58 'hideIDs' => array($hide_action_id), 55 59 ), 56 60 ), 57 - $text); 61 + array($icon, $text)); 58 62 59 63 $show_action = javelin_tag( 60 64 'a', ··· 69 73 'hideIDs' => array($content_id, $show_action_id), 70 74 ), 71 75 ), 72 - pht('Hide Comments')); 76 + array($icon, pht('Hide Comments'))); 73 77 74 78 $actions[] = $hide_action; 75 79 $actions[] = $show_action; 76 80 77 - return array($actions, $this->actions); 81 + return array($this->actions, $actions); 78 82 } 79 83 80 84 }
+1
src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php
··· 33 33 '%d diff(s)' => array('%d diff', '%d diffs'), 34 34 35 35 '%d Answer(s)' => array('%d Answer', '%d Answers'), 36 + 'Show %d Comment(s)' => array('Show %d Comment', 'Show %d Comments'), 36 37 37 38 '%s DIFF LINK(S)' => array('DIFF LINK', 'DIFF LINKS'), 38 39 'You successfully created %d diff(s).' => array(
+25 -2
webroot/rsrc/css/application/ponder/ponder-view.css
··· 31 31 margin-left: 12px; 32 32 } 33 33 34 + .ponder-answer-view .phui-header-shell { 35 + padding-bottom: 8px; 36 + } 37 + 38 + .ponder-answer-view .phui-header-view .phui-header-header { 39 + font-size: 16px; 40 + } 41 + 42 + .ponder-answer-view .phui-header-col1 { 43 + width: 45px; 44 + } 45 + 46 + .ponder-answer-view .phui-header-image { 47 + height: 35px; 48 + width: 35px; 49 + border-radius: 3px; 50 + } 51 + 34 52 .ponder-footer-view { 35 53 margin: 0 4px -4px; 54 + text-align: right; 36 55 } 37 56 38 57 .ponder-footer-view .ponder-footer-action { 39 58 padding: 4px 8px; 40 - margin-right: 8px; 59 + margin-left: 8px; 41 60 color: {$bluetext}; 42 61 display: inline-block; 43 62 background-color: rgba(71, 87, 120, 0.06); 44 63 font-size: {$smallerfontsize}; 45 64 } 46 65 66 + .ponder-footer-view .ponder-footer-action.ponder-footer-action-helpful { 67 + background-color: {$lightyellow}; 68 + } 69 + 47 70 .ponder-footer-view .ponder-footer-action .phui-icon-view { 48 71 color: {$bluetext}; 49 - margin-left: 4px; 72 + font-size: {$smallerfontsize}; 50 73 } 51 74 52 75 .ponder-footer-view a:hover {