public function renderHovercard(PhabricatorHovercardView $hovercard, PhabricatorObjectHandle $handle, $object, $data)
 {
     $viewer = $this->getViewer();
     $user = idx($data['users'], $object->getPHID());
     if (!$user) {
         return;
     }
     $hovercard->setTitle($user->getUsername());
     $profile = $user->getUserProfile();
     $detail = $user->getRealName();
     if ($profile->getTitle()) {
         $detail .= ' - ' . $profile->getTitle();
     }
     $hovercard->setDetail($detail);
     if ($user->getIsDisabled()) {
         $hovercard->addField(pht('Account'), pht('Disabled'));
     } else {
         if (!$user->isUserActivated()) {
             $hovercard->addField(pht('Account'), pht('Not Activated'));
         } else {
             if (PhabricatorApplication::isClassInstalledForViewer('PhabricatorCalendarApplication', $viewer)) {
                 $hovercard->addField(pht('Status'), $user->getAvailabilityDescription($viewer));
             }
         }
     }
     $hovercard->addField(pht('User Since'), phabricator_date($user->getDateCreated(), $viewer));
     if ($profile->getBlurb()) {
         $hovercard->addField(pht('Blurb'), id(new PhutilUTF8StringTruncator())->setMaximumGlyphs(120)->truncateString($profile->getBlurb()));
     }
     $badges = $this->buildBadges($user, $viewer);
     foreach ($badges as $badge) {
         $hovercard->addBadge($badge);
     }
 }
 public function renderHovercard(PhabricatorHovercardView $hovercard, PhabricatorObjectHandle $handle, $task, $data)
 {
     $viewer = $this->getViewer();
     $hovercard->setTitle($task->getMonogram())->setDetail($task->getTitle());
     $owner_phid = $task->getOwnerPHID();
     if ($owner_phid) {
         $owner = $viewer->renderHandle($owner_phid);
     } else {
         $owner = phutil_tag('em', array(), pht('None'));
     }
     $hovercard->addField(pht('Assigned To'), $owner);
     $hovercard->addField(pht('Priority'), ManiphestTaskPriority::getTaskPriorityName($task->getPriority()));
     $hovercard->addTag(ManiphestView::renderTagForTask($task));
 }
 public function renderHovercard(PhabricatorHovercardView $hovercard, PhabricatorObjectHandle $handle, $commit, $data)
 {
     $viewer = $this->getViewer();
     $author_phid = $commit->getAuthorPHID();
     if ($author_phid) {
         $author = $viewer->renderHandle($author_phid);
     } else {
         $commit_data = $commit->loadCommitData();
         $author = phutil_tag('em', array(), $commit_data->getAuthorName());
     }
     $hovercard->setTitle($handle->getName());
     $hovercard->setDetail($commit->getSummary());
     $hovercard->addField(pht('Author'), $author);
     $hovercard->addField(pht('Date'), phabricator_date($commit->getEpoch(), $viewer));
     if ($commit->getAuditStatus() != PhabricatorAuditCommitStatusConstants::NONE) {
         $hovercard->addField(pht('Audit Status'), PhabricatorAuditCommitStatusConstants::getStatusName($commit->getAuditStatus()));
     }
 }
 public function renderHovercard(PhabricatorHovercardView $hovercard, PhabricatorObjectHandle $handle, $object, $data)
 {
     $viewer = $this->getViewer();
     $revision = idx($data['revisions'], $object->getPHID());
     if (!$revision) {
         return;
     }
     $hovercard->setTitle('D' . $revision->getID());
     $hovercard->setDetail($revision->getTitle());
     $hovercard->addField(pht('Author'), $viewer->renderHandle($revision->getAuthorPHID()));
     $reviewer_phids = $revision->getReviewerStatus();
     $reviewer_phids = mpull($reviewer_phids, 'getReviewerPHID');
     $hovercard->addField(pht('Reviewers'), $viewer->renderHandleList($reviewer_phids)->setAsInline(true));
     $summary = $revision->getSummary();
     if (strlen($summary)) {
         $summary = id(new PhutilUTF8StringTruncator())->setMaximumGlyphs(120)->truncateString($summary);
         $hovercard->addField(pht('Summary'), $summary);
     }
     $tag = DifferentialRevisionDetailView::renderTagForRevision($revision);
     $hovercard->addTag($tag);
 }