@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add dates to notifications page

Summary: Fixes T3957, adds timestamps to the notifications page.

Test Plan: View my notifications page, see the new time stamps. Uncertain if I set $user correctly.

Reviewers: epriestley, btrahan

Reviewed By: btrahan

CC: Korvin, epriestley, aran

Maniphest Tasks: T3957

Differential Revision: https://secure.phabricator.com/D8039

+32 -7
+3 -3
resources/celerity/map.php
··· 7 7 return array( 8 8 'names' => 9 9 array( 10 - 'core.pkg.css' => '2eafddad', 10 + 'core.pkg.css' => '6c70dd0e', 11 11 'core.pkg.js' => 'c907bd96', 12 12 'darkconsole.pkg.js' => 'ca8671ce', 13 13 'differential.pkg.css' => '5a65a762', ··· 40 40 'rsrc/css/aphront/typeahead.css' => '00c9a200', 41 41 'rsrc/css/application/auth/auth.css' => '1e655982', 42 42 'rsrc/css/application/base/main-menu-view.css' => 'aba0b7a6', 43 - 'rsrc/css/application/base/notification-menu.css' => '07433791', 43 + 'rsrc/css/application/base/notification-menu.css' => 'fc9a363c', 44 44 'rsrc/css/application/base/phabricator-application-launch-view.css' => '6f8453d9', 45 45 'rsrc/css/application/base/standard-page-view.css' => '517cdfb1', 46 46 'rsrc/css/application/chatlog/chatlog.css' => '0cd2bc78', ··· 693 693 'phabricator-nav-view-css' => 'd0d4a509', 694 694 'phabricator-notification' => '95944043', 695 695 'phabricator-notification-css' => '6901121e', 696 - 'phabricator-notification-menu-css' => '07433791', 696 + 'phabricator-notification-menu-css' => 'fc9a363c', 697 697 'phabricator-object-list-view-css' => '1a1ea560', 698 698 'phabricator-object-selector-css' => '029a133d', 699 699 'phabricator-phtize' => 'd254d646',
+7 -2
src/applications/notification/builder/PhabricatorNotificationBuilder.php
··· 3 3 final class PhabricatorNotificationBuilder { 4 4 5 5 private $stories; 6 + private $user = null; 6 7 7 8 public function __construct(array $stories) { 8 9 $this->stories = $stories; 10 + } 11 + 12 + public function setUser($user) { 13 + $this->user = $user; 14 + return $this; 9 15 } 10 16 11 17 public function buildView() { ··· 124 130 125 131 foreach ($stories as $story) { 126 132 $view = $story->renderView(); 127 - 128 - $null_view->appendChild($view->renderNotification()); 133 + $null_view->appendChild($view->renderNotification($this->user)); 129 134 } 130 135 131 136 return $null_view;
+1
src/applications/notification/controller/PhabricatorNotificationListController.php
··· 43 43 44 44 if ($notifications) { 45 45 $builder = new PhabricatorNotificationBuilder($notifications); 46 + $builder->setUser($user); 46 47 $view = $builder->buildView()->render(); 47 48 } else { 48 49 $view = phutil_tag_div(
+16 -2
src/view/phui/PHUIFeedStoryView.php
··· 99 99 return $this->href; 100 100 } 101 101 102 - public function renderNotification() { 102 + public function renderNotification($user) { 103 103 $classes = array( 104 104 'phabricator-notification', 105 105 ); ··· 107 107 if (!$this->viewed) { 108 108 $classes[] = 'phabricator-notification-unread'; 109 109 } 110 + if ($this->epoch) { 111 + if ($user) { 112 + $foot = phabricator_datetime($this->epoch, $user); 113 + $foot = phutil_tag( 114 + 'span', 115 + array( 116 + 'class' => 'phabricator-notification-date'), 117 + $foot); 118 + } else { 119 + $foot = null; 120 + } 121 + } else { 122 + $foot = pht('No time specified.'); 123 + } 110 124 111 125 return javelin_tag( 112 126 'div', ··· 117 131 'href' => $this->getHref(), 118 132 ), 119 133 ), 120 - $this->title); 134 + array($this->title, $foot)); 121 135 } 122 136 123 137 public function render() {
+5
webroot/rsrc/css/application/base/notification-menu.css
··· 13 13 border-radius: 3px; 14 14 } 15 15 16 + .phabricator-notification .phabricator-notification-date { 17 + margin-left: 8px; 18 + color: {$lightgreytext}; 19 + } 20 + 16 21 .phabricator-notification-menu-loading { 17 22 text-align: center; 18 23 padding: 10px 0;