Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / ponder / controller / PonderAnswerHistoryController.php
blob9d7b96335a3bfce74b315bb8ffda7a24313d1ae0
1 <?php
3 final class PonderAnswerHistoryController extends PonderController {
5 public function shouldAllowPublic() {
6 return true;
9 public function handleRequest(AphrontRequest $request) {
10 $viewer = $request->getViewer();
11 $id = $request->getURIData('id');
13 $answer = id(new PonderAnswerQuery())
14 ->setViewer($viewer)
15 ->withIDs(array($id))
16 ->executeOne();
17 if (!$answer) {
18 return new Aphront404Response();
21 $timeline = $this->buildTransactionTimeline(
22 $answer,
23 new PonderAnswerTransactionQuery());
24 $timeline->setShouldTerminate(true);
26 $qid = $answer->getQuestion()->getID();
27 $aid = $answer->getID();
29 $crumbs = $this->buildApplicationCrumbs();
30 $crumbs->setBorder(true);
31 $crumbs->addTextCrumb("Q{$qid}", "/Q{$qid}");
32 $crumbs->addTextCrumb("A{$aid}", "/Q{$qid}#{$aid}");
33 $crumbs->addTextCrumb(pht('History'));
34 $crumbs->setBorder(true);
36 $header = id(new PHUIHeaderView())
37 ->setHeader(pht('Answer History'))
38 ->setHeaderIcon('fa-history');
40 $view = id(new PHUITwoColumnView())
41 ->setHeader($header)
42 ->setFooter($timeline);
44 return $this->newPage()
45 ->setTitle(pht('Answer History'))
46 ->setCrumbs($crumbs)
47 ->appendChild($view);