mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-02 01:48:23 +01:00
Hide Ponder add comment behind link
Summary: Does what it says on the tin Test Plan: Viewed ponder question, expanded link, added comment Reviewers: pieter, epriestley Reviewed By: pieter CC: vrana, aran, Korvin Maniphest Tasks: T1775 Differential Revision: https://secure.phabricator.com/D3485
This commit is contained in:
parent
a1df1f2b70
commit
09d8120b79
3 changed files with 16 additions and 6 deletions
|
@ -57,7 +57,6 @@ final class PonderAnswerSaveController extends PonderController {
|
|||
|
||||
return id(new AphrontRedirectResponse())
|
||||
->setURI(id(new PhutilURI('/Q'. $question->getID()))
|
||||
->setFragment('A'.$res->getID()));
|
||||
->setFragment('A'.$res->getID()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -65,6 +65,11 @@ final class PonderAddCommentView extends AphrontView {
|
|||
id(new AphrontFormSubmitControl())
|
||||
->setValue($is_serious ? 'Submit' : 'Editorialize'));
|
||||
|
||||
return $form->render();
|
||||
$view = id(new AphrontMoreView())
|
||||
->setSome(id(new AphrontNullView())->render())
|
||||
->setMore($form->render())
|
||||
->setExpandText('Add Comment');
|
||||
|
||||
return $view->render();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ final class AphrontMoreView extends AphrontView {
|
|||
|
||||
private $some;
|
||||
private $more;
|
||||
private $expandtext;
|
||||
|
||||
public function setSome($some) {
|
||||
$this->some = $some;
|
||||
|
@ -31,9 +32,16 @@ final class AphrontMoreView extends AphrontView {
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function setExpandText($text) {
|
||||
$this->expandtext = $text;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function render() {
|
||||
$some = $this->some;
|
||||
|
||||
$text = $this->expandtext === null ?: "(Show More\xE2\x80\xA6)";
|
||||
|
||||
$link = null;
|
||||
if ($this->more && $this->more != $this->some) {
|
||||
Javelin::initBehavior('aphront-more');
|
||||
|
@ -47,7 +55,7 @@ final class AphrontMoreView extends AphrontView {
|
|||
'more' => $this->more,
|
||||
),
|
||||
),
|
||||
"(Show More\xE2\x80\xA6)");
|
||||
$text);
|
||||
}
|
||||
|
||||
return javelin_render_tag(
|
||||
|
@ -57,6 +65,4 @@ final class AphrontMoreView extends AphrontView {
|
|||
),
|
||||
$some.$link);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue