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

Make a handful of minor Slowvote behaviors more consistent with other applications

Summary:
Ref T12685.

- Better icon/color/label consistency.
- Make "0" a valid response.
- Fix a bug where creating a poll with Quicksand enabled led to bad times (form submitted back to the search screen).

Test Plan: {F4956412}

Reviewers: chad, amckinley

Reviewed By: chad

Maniphest Tasks: T12685

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

+25 -5
+9 -2
src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php
··· 68 68 } 69 69 70 70 if ($is_new) { 71 - $responses = array_filter($responses); 71 + // NOTE: Make sure common and useful response "0" is preserved. 72 + foreach ($responses as $key => $response) { 73 + if (!strlen($response)) { 74 + unset($responses[$key]); 75 + } 76 + } 77 + 72 78 if (empty($responses)) { 73 79 $errors[] = pht('You must offer at least one response.'); 74 80 $e_response = pht('Required'); ··· 139 145 } 140 146 141 147 return id(new AphrontRedirectResponse()) 142 - ->setURI('/V'.$poll->getID()); 148 + ->setURI($poll->getURI()); 143 149 } else { 144 150 $poll->setViewPolicy($v_view_policy); 145 151 } 146 152 } 147 153 148 154 $form = id(new AphrontFormView()) 155 + ->setAction($request->getrequestURI()) 149 156 ->setUser($viewer) 150 157 ->appendChild( 151 158 id(new AphrontFormTextControl())
+3 -3
src/applications/slowvote/controller/PhabricatorSlowvotePollController.php
··· 35 35 )); 36 36 } 37 37 38 - $header_icon = $poll->getIsClosed() ? 'fa-ban' : 'fa-circle-o'; 38 + $header_icon = $poll->getIsClosed() ? 'fa-ban' : 'fa-square-o'; 39 39 $header_name = $poll->getIsClosed() ? pht('Closed') : pht('Open'); 40 - $header_color = $poll->getIsClosed() ? 'dark' : 'bluegrey'; 40 + $header_color = $poll->getIsClosed() ? 'indigo' : 'bluegrey'; 41 41 42 42 $header = id(new PHUIHeaderView()) 43 43 ->setHeader($poll->getQuestion()) ··· 89 89 90 90 $is_closed = $poll->getIsClosed(); 91 91 $close_poll_text = $is_closed ? pht('Reopen Poll') : pht('Close Poll'); 92 - $close_poll_icon = $is_closed ? 'fa-play-circle-o' : 'fa-ban'; 92 + $close_poll_icon = $is_closed ? 'fa-check' : 'fa-ban'; 93 93 94 94 $curtain->addAction( 95 95 id(new PhabricatorActionView())
+8
src/applications/slowvote/editor/PhabricatorSlowvoteEditor.php
··· 11 11 return pht('Slowvote'); 12 12 } 13 13 14 + public function getCreateObjectTitle($author, $object) { 15 + return pht('%s created this poll.', $author); 16 + } 17 + 18 + public function getCreateObjectTitleForFeed($author, $object) { 19 + return pht('%s created %s.', $author, $object); 20 + } 21 + 14 22 public function getTransactionTypes() { 15 23 $types = parent::getTransactionTypes(); 16 24 $types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
+1
src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php
··· 55 55 56 56 id(new PhabricatorSearchCheckboxesField()) 57 57 ->setKey('statuses') 58 + ->setLabel(pht('Statuses')) 58 59 ->setOptions(array( 59 60 'open' => pht('Open'), 60 61 'closed' => pht('Closed'),
+4
src/applications/slowvote/storage/PhabricatorSlowvotePoll.php
··· 112 112 return 'V'.$this->getID(); 113 113 } 114 114 115 + public function getURI() { 116 + return '/'.$this->getMonogram(); 117 + } 118 + 115 119 public function save() { 116 120 if (!$this->getMailKey()) { 117 121 $this->setMailKey(Filesystem::readRandomCharacters(20));