1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-26 15:30:58 +01:00

Remove Similar Questions column from Ponder

Summary: Not terribly useful. Also removed close your stuff reminder.

Test Plan: View question I asked and strangers question. Both layout more normal like.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15312
This commit is contained in:
Chad Little 2016-02-19 14:45:05 -08:00
parent 7b1b146620
commit 929b4ccb5c
3 changed files with 7 additions and 81 deletions

View file

@ -92,7 +92,7 @@ return array(
'rsrc/css/application/policy/policy-edit.css' => '815c66f7',
'rsrc/css/application/policy/policy-transaction-detail.css' => '82100a43',
'rsrc/css/application/policy/policy.css' => '957ea14c',
'rsrc/css/application/ponder/ponder-view.css' => '4486434b',
'rsrc/css/application/ponder/ponder-view.css' => 'b40dc156',
'rsrc/css/application/project/project-card-view.css' => '9418c97d',
'rsrc/css/application/project/project-view.css' => '83bb6654',
'rsrc/css/application/releeph/releeph-core.css' => '9b3c5733',
@ -855,7 +855,7 @@ return array(
'policy-css' => '957ea14c',
'policy-edit-css' => '815c66f7',
'policy-transaction-detail-css' => '82100a43',
'ponder-view-css' => '4486434b',
'ponder-view-css' => 'b40dc156',
'project-card-view-css' => '9418c97d',
'project-view-css' => '83bb6654',
'releeph-core' => '9b3c5733',

View file

@ -44,7 +44,6 @@ final class PonderQuestionViewController extends PonderController {
$actions = $this->buildActionListView($question);
$properties = $this->buildPropertyListView($question, $actions);
$sidebar = $this->buildSidebar($question);
$content_id = celerity_generate_unique_node_id();
$timeline = $this->buildTransactionTimeline(
@ -81,20 +80,6 @@ final class PonderQuestionViewController extends PonderController {
->addPropertyList($properties)
->appendChild($footer);
if ($viewer->getPHID() == $question->getAuthorPHID()) {
$status = $question->getStatus();
$answers_list = $question->getAnswers();
if ($answers_list && ($status == PonderQuestionStatus::STATUS_OPEN)) {
$info_view = id(new PHUIInfoView())
->setSeverity(PHUIInfoView::SEVERITY_WARNING)
->appendChild(
pht(
'If this question has been resolved, please consider closing
the question and marking the answer as helpful.'));
$object_box->setInfoView($info_view);
}
}
$crumbs = $this->buildApplicationCrumbs($this->buildSideNavView());
$crumbs->addTextCrumb('Q'.$id, '/Q'.$id);
@ -107,21 +92,14 @@ final class PonderQuestionViewController extends PonderController {
->appendChild($answer);
}
$ponder_view = id(new PHUITwoColumnView())
->setMainColumn(array(
$object_box,
$comment_view,
$answer_wiki,
$answers,
$answer_add_panel,
))
->setSideColumn($sidebar)
->addClass('ponder-question-view');
return $this->buildApplicationPage(
array(
$crumbs,
$ponder_view,
$object_box,
$comment_view,
$answer_wiki,
$answers,
$answer_add_panel,
),
array(
'title' => 'Q'.$question->getID().' '.$question->getTitle(),
@ -261,48 +239,4 @@ final class PonderQuestionViewController extends PonderController {
return $view;
}
private function buildSidebar(PonderQuestion $question) {
$viewer = $this->getViewer();
$status = $question->getStatus();
$id = $question->getID();
$questions = id(new PonderQuestionQuery())
->setViewer($viewer)
->withStatuses(array($status))
->withEdgeLogicPHIDs(
PhabricatorProjectObjectHasProjectEdgeType::EDGECONST,
PhabricatorQueryConstraint::OPERATOR_OR,
$question->getProjectPHIDs())
->setLimit(10)
->execute();
$list = id(new PHUIObjectItemListView())
->setUser($viewer)
->setNoDataString(pht('No similar questions found.'));
foreach ($questions as $question) {
if ($id == $question->getID()) {
continue;
}
$item = new PHUIObjectItemView();
$item->setObjectName('Q'.$question->getID());
$item->setHeader($question->getTitle());
$item->setHref('/Q'.$question->getID());
$item->setObject($question);
$item->addAttribute(
pht(
'%s Answer(s)',
new PhutilNumber($question->getAnswerCount())));
$list->addItem($item);
}
$box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Similar Questions'))
->setObjectList($list);
return $box;
}
}

View file

@ -14,14 +14,6 @@
border-right: 1px solid {$lightblueborder};
}
.ponder-question-view .phui-property-list-properties-wrap {
width: 66%;
}
.ponder-question-view .phui-property-list-actions {
width: 30%;
}
.ponder-answer-view {
margin-top: 16px;
}