Page MenuHomePhabricator

D17878.id43000.diff
No OneTemporary

D17878.id43000.diff

diff --git a/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php b/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php
--- a/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php
+++ b/src/applications/slowvote/controller/PhabricatorSlowvoteEditController.php
@@ -68,7 +68,13 @@
}
if ($is_new) {
- $responses = array_filter($responses);
+ // NOTE: Make sure common and useful response "0" is preserved.
+ foreach ($responses as $key => $response) {
+ if (!strlen($response)) {
+ unset($responses[$key]);
+ }
+ }
+
if (empty($responses)) {
$errors[] = pht('You must offer at least one response.');
$e_response = pht('Required');
@@ -139,13 +145,14 @@
}
return id(new AphrontRedirectResponse())
- ->setURI('/V'.$poll->getID());
+ ->setURI($poll->getURI());
} else {
$poll->setViewPolicy($v_view_policy);
}
}
$form = id(new AphrontFormView())
+ ->setAction($request->getrequestURI())
->setUser($viewer)
->appendChild(
id(new AphrontFormTextControl())
diff --git a/src/applications/slowvote/controller/PhabricatorSlowvotePollController.php b/src/applications/slowvote/controller/PhabricatorSlowvotePollController.php
--- a/src/applications/slowvote/controller/PhabricatorSlowvotePollController.php
+++ b/src/applications/slowvote/controller/PhabricatorSlowvotePollController.php
@@ -35,9 +35,9 @@
));
}
- $header_icon = $poll->getIsClosed() ? 'fa-ban' : 'fa-circle-o';
+ $header_icon = $poll->getIsClosed() ? 'fa-ban' : 'fa-square-o';
$header_name = $poll->getIsClosed() ? pht('Closed') : pht('Open');
- $header_color = $poll->getIsClosed() ? 'dark' : 'bluegrey';
+ $header_color = $poll->getIsClosed() ? 'indigo' : 'bluegrey';
$header = id(new PHUIHeaderView())
->setHeader($poll->getQuestion())
@@ -89,7 +89,7 @@
$is_closed = $poll->getIsClosed();
$close_poll_text = $is_closed ? pht('Reopen Poll') : pht('Close Poll');
- $close_poll_icon = $is_closed ? 'fa-play-circle-o' : 'fa-ban';
+ $close_poll_icon = $is_closed ? 'fa-check' : 'fa-ban';
$curtain->addAction(
id(new PhabricatorActionView())
diff --git a/src/applications/slowvote/editor/PhabricatorSlowvoteEditor.php b/src/applications/slowvote/editor/PhabricatorSlowvoteEditor.php
--- a/src/applications/slowvote/editor/PhabricatorSlowvoteEditor.php
+++ b/src/applications/slowvote/editor/PhabricatorSlowvoteEditor.php
@@ -11,6 +11,14 @@
return pht('Slowvote');
}
+ public function getCreateObjectTitle($author, $object) {
+ return pht('%s created this poll.', $author);
+ }
+
+ public function getCreateObjectTitleForFeed($author, $object) {
+ return pht('%s created %s.', $author, $object);
+ }
+
public function getTransactionTypes() {
$types = parent::getTransactionTypes();
$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;
diff --git a/src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php b/src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php
--- a/src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php
+++ b/src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php
@@ -55,6 +55,7 @@
id(new PhabricatorSearchCheckboxesField())
->setKey('statuses')
+ ->setLabel(pht('Statuses'))
->setOptions(array(
'open' => pht('Open'),
'closed' => pht('Closed'),
diff --git a/src/applications/slowvote/storage/PhabricatorSlowvotePoll.php b/src/applications/slowvote/storage/PhabricatorSlowvotePoll.php
--- a/src/applications/slowvote/storage/PhabricatorSlowvotePoll.php
+++ b/src/applications/slowvote/storage/PhabricatorSlowvotePoll.php
@@ -112,6 +112,10 @@
return 'V'.$this->getID();
}
+ public function getURI() {
+ return '/'.$this->getMonogram();
+ }
+
public function save() {
if (!$this->getMailKey()) {
$this->setMailKey(Filesystem::readRandomCharacters(20));

File Metadata

Mime Type
text/plain
Expires
Sat, May 11, 4:10 AM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6284567
Default Alt Text
D17878.id43000.diff (4 KB)

Event Timeline