1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 09:12:41 +01:00

Remove two unused Ponder views

Summary: Ref T3578. No callsites.

Test Plan: grep

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3578

Differential Revision: https://secure.phabricator.com/D6583
This commit is contained in:
epriestley 2013-07-26 13:33:33 -07:00
parent ce16369f8e
commit d07d52645f
3 changed files with 0 additions and 174 deletions

View file

@ -1903,12 +1903,10 @@ phutil_register_library_map(array(
'PonderQuestionSearchEngine' => 'applications/ponder/query/PonderQuestionSearchEngine.php',
'PonderQuestionStatus' => 'applications/ponder/constants/PonderQuestionStatus.php',
'PonderQuestionStatusController' => 'applications/ponder/controller/PonderQuestionStatusController.php',
'PonderQuestionSummaryView' => 'applications/ponder/view/PonderQuestionSummaryView.php',
'PonderQuestionViewController' => 'applications/ponder/controller/PonderQuestionViewController.php',
'PonderRemarkupRule' => 'applications/ponder/remarkup/PonderRemarkupRule.php',
'PonderReplyHandler' => 'applications/ponder/mail/PonderReplyHandler.php',
'PonderSearchIndexer' => 'applications/ponder/search/PonderSearchIndexer.php',
'PonderUserProfileView' => 'applications/ponder/view/PonderUserProfileView.php',
'PonderVotableInterface' => 'applications/ponder/storage/PonderVotableInterface.php',
'PonderVotableView' => 'applications/ponder/view/PonderVotableView.php',
'PonderVote' => 'applications/ponder/constants/PonderVote.php',
@ -4035,12 +4033,10 @@ phutil_register_library_map(array(
'PonderQuestionSearchEngine' => 'PhabricatorApplicationSearchEngine',
'PonderQuestionStatus' => 'PonderConstants',
'PonderQuestionStatusController' => 'PonderController',
'PonderQuestionSummaryView' => 'AphrontView',
'PonderQuestionViewController' => 'PonderController',
'PonderRemarkupRule' => 'PhabricatorRemarkupRuleObject',
'PonderReplyHandler' => 'PhabricatorMailReplyHandler',
'PonderSearchIndexer' => 'PhabricatorSearchDocumentIndexer',
'PonderUserProfileView' => 'AphrontView',
'PonderVotableView' => 'AphrontView',
'PonderVote' => 'PonderConstants',
'PonderVoteEditor' => 'PhabricatorEditor',

View file

@ -1,72 +0,0 @@
<?php
final class PonderQuestionSummaryView extends AphrontView {
private $question;
private $handles;
public function setQuestion($question) {
$this->question = $question;
return $this;
}
public function setHandles($handles) {
$this->handles = $handles;
return $this;
}
public function render() {
require_celerity_resource('ponder-feed-view-css');
$user = $this->user;
$question = $this->question;
$author_phid = $question->getAuthorPHID();
$handles = $this->handles;
$authorlink = $handles[$author_phid]
->renderLink();
$votecount = hsprintf(
'<div class="ponder-summary-votes">'.
'%s'.
'<div class="ponder-question-label">votes</div>'.
'</div>',
$question->getVoteCount());
$answerclass = "ponder-summary-answers";
if ($question->getAnswercount() == 0) {
$answerclass .= " ponder-not-answered";
}
$answercount = hsprintf(
'<div class="ponder-summary-answers">'.
'%s'.
'<div class="ponder-question-label">answers</div>'.
'</div>',
$question->getAnswerCount());
$title = hsprintf('<h2 class="ponder-question-title">%s</h2>',
phutil_tag(
'a',
array(
"href" => '/Q' . $question->getID(),
),
'Q' . $question->getID() .
' ' . $question->getTitle()));
$rhs = hsprintf(
'<div class="ponder-metadata">'.
'%s <span class="ponder-small-metadata">asked on %s by %s</span>'.
'</div>',
$title,
phabricator_datetime($question->getDateCreated(), $user),
$authorlink);
$summary = hsprintf(
'<div class="ponder-question-summary">%s%s%s</div>',
$votecount,
$answercount,
$rhs);
return $summary;
}
}

View file

@ -1,98 +0,0 @@
<?php
final class PonderUserProfileView extends AphrontView {
private $questionoffset;
private $answeroffset;
private $answers;
private $pagesize;
private $uri;
private $aparam;
public function setQuestionOffset($offset) {
$this->questionoffset = $offset;
return $this;
}
public function setAnswerOffset($offset) {
$this->answeroffset = $offset;
return $this;
}
public function setAnswers($data) {
$this->answers = $data;
return $this;
}
public function setPageSize($pagesize) {
$this->pagesize = $pagesize;
return $this;
}
public function setURI($uri, $aparam) {
$this->uri = $uri;
$this->aparam = $aparam;
return $this;
}
public function render() {
require_celerity_resource('ponder-feed-view-css');
$user = $this->user;
$aoffset = $this->answeroffset;
$answers = $this->answers;
$uri = $this->uri;
$aparam = $this->aparam;
$pagesize = $this->pagesize;
$apagebuttons = id(new AphrontPagerView())
->setPageSize($pagesize)
->setOffset($aoffset)
->setURI(
$uri
->setFragment('answers'),
$aparam);
$answers = $apagebuttons->sliceResults($answers);
$view = new PhabricatorObjectItemListView();
$view->setUser($user);
$view->setNoDataString(pht('No matching answers.'));
foreach ($answers as $answer) {
$question = $answer->getQuestion();
$author_phid = $question->getAuthorPHID();
$item = new PhabricatorObjectItemView();
$item->setObject($answer);
$href = id(new PhutilURI('/Q' . $question->getID()))
->setFragment('A' . $answer->getID());
$item->setHeader(
'A'.$answer->getID().' '.self::abbreviate($answer->getContent()));
$item->setHref($href);
$item->addAttribute(
pht('Created %s', phabricator_date($answer->getDateCreated(), $user)));
$item->addAttribute(pht('%d Vote(s)', $answer->getVoteCount()));
$item->addAttribute(
pht(
'Answer to %s',
phutil_tag(
'a',
array(
'href' => '/Q'.$question->getID(),
),
self::abbreviate($question->getTitle()))));
$view->addItem($item);
}
$view->appendChild($apagebuttons);
return $view->render();
}
private function abbreviate($w) {
return phutil_utf8_shorten($w, 60);
}
}