3 final class PonderFooterView
extends AphrontTagView
{
7 private $actions = array();
9 public function setContentID($content_id) {
10 $this->contentID
= $content_id;
14 public function setCount($count) {
15 $this->count
= $count;
19 public function addAction($action) {
20 $this->actions
[] = $action;
24 protected function getTagAttributes() {
26 'class' => 'ponder-footer-view',
30 protected function getTagContent() {
31 require_celerity_resource('ponder-view-css');
32 Javelin
::initBehavior('phabricator-reveal-content');
34 $hide_action_id = celerity_generate_unique_node_id();
35 $show_action_id = celerity_generate_unique_node_id();
36 $content_id = $this->contentID
;
38 if ($this->count
== 0) {
39 $text = pht('Add a Comment');
41 $text = pht('Show %d Comment(s)', new PhutilNumber($this->count
));
45 $hide_action = javelin_tag(
48 'sigil' => 'reveal-content',
49 'class' => 'ponder-footer-action',
50 'id' => $hide_action_id,
53 'showIDs' => array($content_id, $show_action_id),
54 'hideIDs' => array($hide_action_id),
59 $show_action = javelin_tag(
62 'sigil' => 'reveal-content',
63 'style' => 'display: none;',
64 'class' => 'ponder-footer-action',
65 'id' => $show_action_id,
68 'showIDs' => array($hide_action_id),
69 'hideIDs' => array($content_id, $show_action_id),
72 array(pht('Hide Comments')));
74 $actions[] = $hide_action;
75 $actions[] = $show_action;
77 return array($actions, $this->actions
);