3 final class PhabricatorCountdownView
extends AphrontView
{
7 public function setCountdown(PhabricatorCountdown
$countdown) {
8 $this->countdown
= $countdown;
12 public function render() {
13 $countdown = $this->countdown
;
14 require_celerity_resource('phabricator-countdown-css');
17 $countdown->getMonogram(),
22 'href' => $countdown->getURI(),
24 $countdown->getTitle()),
27 $header = id(new PHUIHeaderView())
28 ->setHeader($header_text);
31 phutil_tag('th', array(), pht('Days')),
32 phutil_tag('th', array(), pht('Hours')),
33 phutil_tag('th', array(), pht('Minutes')),
34 phutil_tag('th', array(), pht('Seconds')),
38 javelin_tag('td', array('sigil' => 'phabricator-timer-days'), '-'),
39 javelin_tag('td', array('sigil' => 'phabricator-timer-hours'), '-'),
40 javelin_tag('td', array('sigil' => 'phabricator-timer-minutes'), '-'),
41 javelin_tag('td', array('sigil' => 'phabricator-timer-seconds'), '-'),
44 $epoch = $countdown->getEpoch();
45 $launch_date = phabricator_datetime($epoch, $this->getUser());
50 'class' => 'phabricator-timer-foot',
54 $description = $countdown->getDescription();
55 if (strlen($description)) {
56 $description = new PHUIRemarkupView($this->getUser(), $description);
57 $description = phutil_tag(
60 'class' => 'countdown-description phabricator-remarkup',
65 $container = celerity_generate_unique_node_id();
66 $content = phutil_tag(
68 array('class' => 'phabricator-timer', 'id' => $container),
71 phutil_tag('table', array('class' => 'phabricator-timer-table'), array(
72 phutil_tag('tr', array(), $ths),
73 phutil_tag('tr', array(), $dashes),
74 phutil_tag('tr', array(), $foot),
78 Javelin
::initBehavior('countdown-timer', array(
79 'timestamp' => $countdown->getEpoch(),
80 'container' => $container,
83 return id(new PHUIObjectBoxView())
85 ->setBackground(PHUIObjectBoxView
::BLUE_PROPERTY
)
86 ->addClass('phabricator-timer-view')
87 ->appendChild($content);