Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15457049
D12915.id31069.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D12915.id31069.diff
View Options
diff --git a/src/applications/people/event/PhabricatorPeopleHovercardEventListener.php b/src/applications/people/event/PhabricatorPeopleHovercardEventListener.php
--- a/src/applications/people/event/PhabricatorPeopleHovercardEventListener.php
+++ b/src/applications/people/event/PhabricatorPeopleHovercardEventListener.php
@@ -31,10 +31,15 @@
->setViewer($viewer)
->withIDs(array($user->getID()))
->needAvailability(true)
+ ->needProfile(true)
->executeOne();
+ $profile = $user->getUserProfile();
+ $title = nonempty(
+ $profile->getTitle(),
+ pht('No title was found befitting of this rare specimen'));
$hovercard->setTitle($user->getUsername());
- $hovercard->setDetail($user->getRealName());
+ $hovercard->setDetail($user->getRealName().' - '.$title.'.');
if ($user->getIsDisabled()) {
$hovercard->addField(pht('Account'), pht('Disabled'));
@@ -52,6 +57,13 @@
pht('User Since'),
phabricator_date($user->getDateCreated(), $viewer));
+ if ($profile->getBlurb()) {
+ $hovercard->addField(pht('Blurb'),
+ id(new PhutilUTF8StringTruncator())
+ ->setMaximumGlyphs(120)
+ ->truncateString($profile->getBlurb()));
+ }
+
$event->setValue('hovercard', $hovercard);
}
diff --git a/src/applications/people/storage/PhabricatorUser.php b/src/applications/people/storage/PhabricatorUser.php
--- a/src/applications/people/storage/PhabricatorUser.php
+++ b/src/applications/people/storage/PhabricatorUser.php
@@ -396,6 +396,10 @@
return substr(PhabricatorHash::digest($vec), 0, $len);
}
+ public function getUserProfile() {
+ return $this->assertAttached($this->profile);
+ }
+
public function attachUserProfile(PhabricatorUserProfile $profile) {
$this->profile = $profile;
return $this;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 31, 1:59 PM (2 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7350973
Default Alt Text
D12915.id31069.diff (1 KB)
Attached To
Mode
D12915: People - fix hovercards for people
Attached
Detach File
Event Timeline
Log In to Comment