Page MenuHomePhabricator

D13742.diff
No OneTemporary

D13742.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -7,7 +7,7 @@
*/
return array(
'names' => array(
- 'core.pkg.css' => 'b7d43de8',
+ 'core.pkg.css' => 'af140e11',
'core.pkg.js' => 'a590b451',
'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => '9451634c',
@@ -142,7 +142,7 @@
'rsrc/css/phui/phui-info-view.css' => '5b16bac6',
'rsrc/css/phui/phui-list.css' => '125599df',
'rsrc/css/phui/phui-object-box.css' => '407eaf5a',
- 'rsrc/css/phui/phui-object-item-list-view.css' => 'a1b990b7',
+ 'rsrc/css/phui/phui-object-item-list-view.css' => '36ce366c',
'rsrc/css/phui/phui-pager.css' => 'bea33d23',
'rsrc/css/phui/phui-pinboard-view.css' => '2495140e',
'rsrc/css/phui/phui-property-list-view.css' => 'aeb09581',
@@ -797,7 +797,7 @@
'phui-inline-comment-view-css' => '9fadd6b8',
'phui-list-view-css' => '125599df',
'phui-object-box-css' => '407eaf5a',
- 'phui-object-item-list-view-css' => 'a1b990b7',
+ 'phui-object-item-list-view-css' => '36ce366c',
'phui-pager-css' => 'bea33d23',
'phui-pinboard-view-css' => '2495140e',
'phui-property-list-view-css' => 'aeb09581',
diff --git a/src/applications/countdown/query/PhabricatorCountdownSearchEngine.php b/src/applications/countdown/query/PhabricatorCountdownSearchEngine.php
--- a/src/applications/countdown/query/PhabricatorCountdownSearchEngine.php
+++ b/src/applications/countdown/query/PhabricatorCountdownSearchEngine.php
@@ -102,13 +102,9 @@
foreach ($countdowns as $countdown) {
$id = $countdown->getID();
$ended = false;
- $icon = 'fa-clock-o';
- $color = 'green';
$epoch = $countdown->getEpoch();
if ($epoch <= PhabricatorTime::getNow()) {
$ended = true;
- $icon = 'fa-check-square-o';
- $color = 'grey';
}
$item = id(new PHUIObjectItemView())
@@ -116,7 +112,6 @@
->setObject($countdown)
->setObjectName("C{$id}")
->setHeader($countdown->getTitle())
- ->setStatusIcon($icon.' '.$color)
->setHref($this->getApplicationURI("{$id}/"))
->addByline(
pht(
@@ -128,6 +123,14 @@
pht('Launched on %s', phabricator_datetime($epoch, $viewer)));
$item->setDisabled(true);
} else {
+ $time_left = ($epoch - PhabricatorTime::getNow());
+ $num = round($time_left / (60 * 60 * 24));
+ $noun = pht('Days');
+ if ($num < 1) {
+ $num = round($time_left / (60 * 60), 1);
+ $noun = pht('Hours');
+ }
+ $item->setCountdown($num, $noun);
$item->addAttribute(
phabricator_datetime($epoch, $viewer));
}
diff --git a/src/view/phui/PHUIObjectItemView.php b/src/view/phui/PHUIObjectItemView.php
--- a/src/view/phui/PHUIObjectItemView.php
+++ b/src/view/phui/PHUIObjectItemView.php
@@ -24,6 +24,8 @@
private $imageIcon;
private $titleText;
private $badge;
+ private $countdownNum;
+ private $countdownNoun;
const AGE_FRESH = 'fresh';
const AGE_STALE = 'stale';
@@ -105,6 +107,12 @@
return $this;
}
+ public function setCountdown($num, $noun) {
+ $this->countdownNum = $num;
+ $this->countdownNoun = $noun;
+ return $this;
+ }
+
public function setTitleText($title_text) {
$this->titleText = $title_text;
return $this;
@@ -603,6 +611,24 @@
$this->badge);
}
+ if ($this->countdownNum) {
+ $countdown = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'phui-object-item-countdown-number',
+ ),
+ array(
+ phutil_tag_div('', $this->countdownNum),
+ phutil_tag_div('', $this->countdownNoun),
+ ));
+ $column0 = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'phui-object-item-col0 phui-object-item-countdown',
+ ),
+ $countdown);
+ }
+
$column1 = phutil_tag(
'div',
array(
diff --git a/webroot/rsrc/css/phui/phui-object-item-list-view.css b/webroot/rsrc/css/phui/phui-object-item-list-view.css
--- a/webroot/rsrc/css/phui/phui-object-item-list-view.css
+++ b/webroot/rsrc/css/phui/phui-object-item-list-view.css
@@ -627,6 +627,19 @@
left: 0;
}
+/* - Countdowns ------------------------------------------------------------ */
+
+.phui-object-item-col0.phui-object-item-countdown {
+ width: 52px;
+ padding: 0;
+}
+
+.phui-object-item-countdown .phui-object-item-countdown-number {
+ border-right: 1px solid {$thinblueborder};
+ text-align: center;
+ color: {$bluetext};
+}
+
/* - Dashboards ------------------------------------------------------------ */

File Metadata

Mime Type
text/plain
Expires
Wed, Jan 15, 2:25 PM (13 h, 19 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6994789
Default Alt Text
D13742.diff (4 KB)

Event Timeline