mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-14 19:02:41 +01:00
c29fe2deb6
Summary: Also splits blocking and active revisions. This could display 0 with non-empty tip over it. It's intentional meaning that 0 objects need your attention but there is still some work to do. Test Plan: Hovered over number. Reviewers: epriestley, chad Reviewed By: chad CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5049
61 lines
1.1 KiB
PHP
61 lines
1.1 KiB
PHP
<?php
|
|
|
|
final class PhabricatorApplicationStatusView extends AphrontView {
|
|
|
|
private $count;
|
|
private $text;
|
|
private $type;
|
|
|
|
const TYPE_NEEDS_ATTENTION = 'needs';
|
|
const TYPE_INFO = 'info';
|
|
const TYPE_OKAY = 'okay';
|
|
const TYPE_WARNING = 'warning';
|
|
const TYPE_EMPTY = 'empty';
|
|
|
|
public function setType($type) {
|
|
$this->type = $type;
|
|
return $this;
|
|
}
|
|
|
|
public function getType() {
|
|
return $this->type;
|
|
}
|
|
|
|
public function setText($text) {
|
|
$this->text = $text;
|
|
return $this;
|
|
}
|
|
|
|
public function getText() {
|
|
return $this->text;
|
|
}
|
|
|
|
public function setCount($count) {
|
|
$this->count = $count;
|
|
return $this;
|
|
}
|
|
|
|
public function getCount() {
|
|
return $this->count;
|
|
}
|
|
|
|
public function render() {
|
|
$type = $this->type;
|
|
if (!$this->count) {
|
|
$type = self::TYPE_EMPTY;
|
|
}
|
|
|
|
$classes = array(
|
|
'phabricator-application-status',
|
|
'phabricator-application-status-type-'.$type,
|
|
);
|
|
|
|
return phutil_tag(
|
|
'span',
|
|
array(
|
|
'class' => implode(' ', $classes),
|
|
),
|
|
$this->text);
|
|
}
|
|
|
|
}
|