diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php index 2c07ace96f..28530b28fe 100644 --- a/src/__celerity_resource_map__.php +++ b/src/__celerity_resource_map__.php @@ -3920,7 +3920,7 @@ celerity_register_resource_map(array( ), 'ponder-vote-css' => array( - 'uri' => '/res/28b71b13/rsrc/css/application/ponder/vote.css', + 'uri' => '/res/6bbe8538/rsrc/css/application/ponder/vote.css', 'type' => 'css', 'requires' => array( diff --git a/src/applications/phid/handle/PhabricatorObjectHandleData.php b/src/applications/phid/handle/PhabricatorObjectHandleData.php index 25b5581d95..706a7fd63b 100644 --- a/src/applications/phid/handle/PhabricatorObjectHandleData.php +++ b/src/applications/phid/handle/PhabricatorObjectHandleData.php @@ -56,7 +56,22 @@ final class PhabricatorObjectHandleData { $xactions = array(); foreach ($subtypes as $subtype => $subtype_phids) { // TODO: Do this magically. + // TODO: ^^^ Really do that ^^^ switch ($subtype) { + case PonderPHIDTypeQuestion::TYPECONST: + $results = id(new PonderQuestionTransactionQuery()) + ->setViewer($this->viewer) + ->withPHIDs($subtype_phids) + ->execute(); + $xactions += mpull($results, null, 'getPHID'); + break; + case PonderPHIDTypeAnswer::TYPECONST: + $results = id(new PonderAnswerTransactionQuery()) + ->setViewer($this->viewer) + ->withPHIDs($subtype_phids) + ->execute(); + $xactions += mpull($results, null, 'getPHID'); + break; case PholioPHIDTypeMock::TYPECONST: $results = id(new PholioTransactionQuery()) ->setViewer($this->viewer) diff --git a/src/applications/ponder/editor/PonderAnswerEditor.php b/src/applications/ponder/editor/PonderAnswerEditor.php index e7c03d7688..6daeca17c6 100644 --- a/src/applications/ponder/editor/PonderAnswerEditor.php +++ b/src/applications/ponder/editor/PonderAnswerEditor.php @@ -62,5 +62,13 @@ final class PonderAnswerEditor return parent::mergeTransactions($u, $v); } + protected function supportsFeed() { + return true; + } + + protected function getMailTo(PhabricatorLiskDAO $object) { + return array($object->getAuthorPHID()); + } + } diff --git a/src/applications/ponder/editor/PonderQuestionEditor.php b/src/applications/ponder/editor/PonderQuestionEditor.php index 2971a8a5c5..b72dafba32 100644 --- a/src/applications/ponder/editor/PonderQuestionEditor.php +++ b/src/applications/ponder/editor/PonderQuestionEditor.php @@ -145,7 +145,14 @@ final class PonderQuestionEditor return parent::mergeTransactions($u, $v); } - // TODO: Feed support + protected function supportsFeed() { + return true; + } + + protected function getMailTo(PhabricatorLiskDAO $object) { + return array($object->getAuthorPHID()); + } + // TODO: Mail support } diff --git a/src/applications/ponder/storage/PonderAnswerTransaction.php b/src/applications/ponder/storage/PonderAnswerTransaction.php index 288c803774..d29ec89821 100644 --- a/src/applications/ponder/storage/PonderAnswerTransaction.php +++ b/src/applications/ponder/storage/PonderAnswerTransaction.php @@ -25,6 +25,24 @@ final class PonderAnswerTransaction return pht('answer'); } + public function getTitleForFeed() { + $author_phid = $this->getAuthorPHID(); + $object_phid = $this->getObjectPHID(); + + $old = $this->getOldValue(); + $new = $this->getNewValue(); + + switch ($this->getTransactionType()) { + case self::TYPE_CONTENT: + // TODO: This is not so good. + return pht( + '%s edited their answer to %s', + $this->renderHandleLink($author_phid), + $this->renderHandleLink($object_phid)); + } + + return $this->getTitle(); + } } diff --git a/src/applications/ponder/storage/PonderQuestionTransaction.php b/src/applications/ponder/storage/PonderQuestionTransaction.php index 4ab7d9bb49..3406c011e8 100644 --- a/src/applications/ponder/storage/PonderQuestionTransaction.php +++ b/src/applications/ponder/storage/PonderQuestionTransaction.php @@ -134,7 +134,55 @@ final class PonderQuestionTransaction return $view->render(); } + public function getTitleForFeed() { + $author_phid = $this->getAuthorPHID(); + $object_phid = $this->getObjectPHID(); + $old = $this->getOldValue(); + $new = $this->getNewValue(); + + switch ($this->getTransactionType()) { + case self::TYPE_TITLE: + if ($old === null) { + return pht( + '%s asked a question: %s', + $this->renderHandleLink($author_phid), + $this->renderHandleLink($object_phid)); + } else { + return pht( + '%s edited the title of %s (was "%s")', + $this->renderHandleLink($author_phid), + $this->renderHandleLink($object_phid), + $old); + } + case self::TYPE_CONTENT: + return pht( + '%s edited the description of %s', + $this->renderHandleLink($author_phid), + $this->renderHandleLink($object_phid)); + case self::TYPE_ANSWERS: + // TODO: This could be richer, too. + return pht( + '%s answered %s', + $this->renderHandleLink($author_phid), + $this->renderHandleLink($object_phid)); + case self::TYPE_STATUS: + switch ($new) { + case PonderQuestionStatus::STATUS_OPEN: + return pht( + '%s reopened %s', + $this->renderHandleLink($author_phid), + $this->renderHandleLink($object_phid)); + case PonderQuestionStatus::STATUS_CLOSED: + return pht( + '%s closed %s', + $this->renderHandleLink($author_phid), + $this->renderHandleLink($object_phid)); + } + } + + return $this->getTitle(); + } } diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php index 88a88282e1..e96c679c3f 100644 --- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php +++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php @@ -1307,7 +1307,7 @@ abstract class PhabricatorApplicationTransactionEditor } -/* -( Custom Fields )------------------------------------------------------- */ +/* -( Custom Fields )------------------------------------------------------ */ /**