Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15445291
D16258.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D16258.diff
View Options
diff --git a/src/applications/notification/builder/PhabricatorNotificationBuilder.php b/src/applications/notification/builder/PhabricatorNotificationBuilder.php
--- a/src/applications/notification/builder/PhabricatorNotificationBuilder.php
+++ b/src/applications/notification/builder/PhabricatorNotificationBuilder.php
@@ -5,6 +5,7 @@
private $stories;
private $parsedStories;
private $user = null;
+ private $showTimestamps = true;
public function __construct(array $stories) {
assert_instances_of($stories, 'PhabricatorFeedStory');
@@ -16,6 +17,15 @@
return $this;
}
+ public function setShowTimestamps($show_timestamps) {
+ $this->showTimestamps = $show_timestamps;
+ return $this;
+ }
+
+ public function getShowTimestamps() {
+ return $this->showTimestamps;
+ }
+
private function parseStories() {
if ($this->parsedStories) {
@@ -121,6 +131,9 @@
// TODO: Render a nice debuggable notice instead?
continue;
}
+
+ $view->setShowTimestamp($this->getShowTimestamps());
+
$null_view->appendChild($view->renderNotification($this->user));
}
diff --git a/src/applications/notification/controller/PhabricatorNotificationIndividualController.php b/src/applications/notification/controller/PhabricatorNotificationIndividualController.php
--- a/src/applications/notification/controller/PhabricatorNotificationIndividualController.php
+++ b/src/applications/notification/controller/PhabricatorNotificationIndividualController.php
@@ -31,7 +31,8 @@
}
$builder = id(new PhabricatorNotificationBuilder(array($story)))
- ->setUser($viewer);
+ ->setUser($viewer)
+ ->setShowTimestamps(false);
$content = $builder->buildView()->render();
$dict = $builder->buildDict();
diff --git a/src/view/phui/PHUIFeedStoryView.php b/src/view/phui/PHUIFeedStoryView.php
--- a/src/view/phui/PHUIFeedStoryView.php
+++ b/src/view/phui/PHUIFeedStoryView.php
@@ -17,6 +17,7 @@
private $chronologicalKey;
private $tags;
private $authorIcon;
+ private $showTimestamp = true;
public function setTags($tags) {
$this->tags = $tags;
@@ -97,6 +98,15 @@
return $this;
}
+ public function setShowTimestamp($show_timestamp) {
+ $this->showTimestamp = $show_timestamp;
+ return $this;
+ }
+
+ public function getShowTimestamp() {
+ return $this->showTimestamp;
+ }
+
public function addProject($project) {
$this->projects[] = $project;
return $this;
@@ -136,20 +146,25 @@
if (!$this->viewed) {
$classes[] = 'phabricator-notification-unread';
}
- if ($this->epoch) {
- if ($user) {
- $foot = phabricator_datetime($this->epoch, $user);
- $foot = phutil_tag(
- 'span',
- array(
- 'class' => 'phabricator-notification-date',
- ),
- $foot);
+
+ if ($this->getShowTimestamp()) {
+ if ($this->epoch) {
+ if ($user) {
+ $foot = phabricator_datetime($this->epoch, $user);
+ $foot = phutil_tag(
+ 'span',
+ array(
+ 'class' => 'phabricator-notification-date',
+ ),
+ $foot);
+ } else {
+ $foot = null;
+ }
} else {
- $foot = null;
+ $foot = pht('No time specified.');
}
} else {
- $foot = pht('No time specified.');
+ $foot = null;
}
return javelin_tag(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 28, 1:18 PM (4 w, 22 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7414353
Default Alt Text
D16258.diff (3 KB)
Attached To
Mode
D16258: Strip timestamps from popup notification bubbles
Attached
Detach File
Event Timeline
Log In to Comment