mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-10 03:14:48 +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
|
@ -59,5 +59,4 @@ final class PonderAnswerSaveController extends PonderController {
|
||||||
->setURI(id(new PhutilURI('/Q'. $question->getID()))
|
->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())
|
id(new AphrontFormSubmitControl())
|
||||||
->setValue($is_serious ? 'Submit' : 'Editorialize'));
|
->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 $some;
|
||||||
private $more;
|
private $more;
|
||||||
|
private $expandtext;
|
||||||
|
|
||||||
public function setSome($some) {
|
public function setSome($some) {
|
||||||
$this->some = $some;
|
$this->some = $some;
|
||||||
|
@ -31,9 +32,16 @@ final class AphrontMoreView extends AphrontView {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setExpandText($text) {
|
||||||
|
$this->expandtext = $text;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
public function render() {
|
public function render() {
|
||||||
$some = $this->some;
|
$some = $this->some;
|
||||||
|
|
||||||
|
$text = $this->expandtext === null ?: "(Show More\xE2\x80\xA6)";
|
||||||
|
|
||||||
$link = null;
|
$link = null;
|
||||||
if ($this->more && $this->more != $this->some) {
|
if ($this->more && $this->more != $this->some) {
|
||||||
Javelin::initBehavior('aphront-more');
|
Javelin::initBehavior('aphront-more');
|
||||||
|
@ -47,7 +55,7 @@ final class AphrontMoreView extends AphrontView {
|
||||||
'more' => $this->more,
|
'more' => $this->more,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
"(Show More\xE2\x80\xA6)");
|
$text);
|
||||||
}
|
}
|
||||||
|
|
||||||
return javelin_render_tag(
|
return javelin_render_tag(
|
||||||
|
@ -57,6 +65,4 @@ final class AphrontMoreView extends AphrontView {
|
||||||
),
|
),
|
||||||
$some.$link);
|
$some.$link);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue