protected function renderResultList(array $notifications, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($notifications, 'PhabricatorFeedStory');
     $viewer = $this->requireViewer();
     $image = id(new PHUIIconView())->setIconFont('fa-eye-slash');
     $button = id(new PHUIButtonView())->setTag('a')->addSigil('workflow')->setColor(PHUIButtonView::SIMPLE)->setIcon($image)->setText(pht('Mark All Read'));
     switch ($query->getQueryKey()) {
         case 'unread':
             $header = pht('Unread Notifications');
             $no_data = pht('You have no unread notifications.');
             break;
         default:
             $header = pht('Notifications');
             $no_data = pht('You have no notifications.');
             break;
     }
     $clear_uri = id(new PhutilURI('/notification/clear/'));
     if ($notifications) {
         $builder = id(new PhabricatorNotificationBuilder($notifications))->setUser($viewer);
         $view = $builder->buildView();
         $clear_uri->setQueryParam('chronoKey', head($notifications)->getChronologicalKey());
     } else {
         $view = phutil_tag_div('phabricator-notification no-notifications', $no_data);
         $button->setDisabled(true);
     }
     $button->setHref((string) $clear_uri);
     $view = id(new PHUIBoxView())->addPadding(PHUI::PADDING_MEDIUM)->addClass('phabricator-notification-list')->appendChild($view);
     $result = new PhabricatorApplicationSearchResultView();
     $result->addAction($button);
     $result->setContent($view);
     return $result;
 }
 protected function renderResultList(array $signatures, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($signatures, 'LegalpadDocumentSignature');
     $viewer = $this->requireViewer();
     Javelin::initBehavior('phabricator-tooltips');
     $sig_good = $this->renderIcon('fa-check', null, pht('Verified, Current'));
     $sig_corp = $this->renderIcon('fa-building-o', null, pht('Verified, Corporate'));
     $sig_old = $this->renderIcon('fa-clock-o', 'orange', pht('Signed Older Version'));
     $sig_unverified = $this->renderIcon('fa-envelope', 'red', pht('Unverified Email'));
     $sig_exemption = $this->renderIcon('fa-asterisk', 'indigo', pht('Exemption'));
     id(new PHUIIconView())->setIcon('fa-envelope', 'red')->addSigil('has-tooltip')->setMetadata(array('tip' => pht('Unverified Email')));
     $type_corporate = LegalpadDocument::SIGNATURE_TYPE_CORPORATION;
     $rows = array();
     foreach ($signatures as $signature) {
         $name = $signature->getSignerName();
         $email = $signature->getSignerEmail();
         $document = $signature->getDocument();
         if ($signature->getIsExemption()) {
             $sig_icon = $sig_exemption;
         } else {
             if (!$signature->isVerified()) {
                 $sig_icon = $sig_unverified;
             } else {
                 if ($signature->getDocumentVersion() != $document->getVersions()) {
                     $sig_icon = $sig_old;
                 } else {
                     if ($signature->getSignatureType() == $type_corporate) {
                         $sig_icon = $sig_corp;
                     } else {
                         $sig_icon = $sig_good;
                     }
                 }
             }
         }
         $signature_href = $this->getApplicationURI('signature/' . $signature->getID() . '/');
         $sig_icon = javelin_tag('a', array('href' => $signature_href, 'sigil' => 'workflow'), $sig_icon);
         $signer_phid = $signature->getSignerPHID();
         $rows[] = array($sig_icon, $handles[$document->getPHID()]->renderLink(), $signer_phid ? $handles[$signer_phid]->renderLink() : null, $name, phutil_tag('a', array('href' => 'mailto:' . $email), $email), phabricator_datetime($signature->getDateCreated(), $viewer));
     }
     $table = id(new AphrontTableView($rows))->setNoDataString(pht('No signatures match the query.'))->setHeaders(array('', pht('Document'), pht('Account'), pht('Name'), pht('Email'), pht('Signed')))->setColumnVisibility(array(true, !$this->document))->setColumnClasses(array('', '', '', '', 'wide', 'right'));
     $button = null;
     if ($this->document) {
         $document_id = $this->document->getID();
         $button = id(new PHUIButtonView())->setText(pht('Add Exemption'))->setTag('a')->setHref($this->getApplicationURI('addsignature/' . $document_id . '/'))->setWorkflow(true)->setIcon('fa-pencil');
     }
     if (!$this->document) {
         $table->setNotice(pht('NOTE: You can only see your own signatures and signatures on ' . 'documents you have permission to edit.'));
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setTable($table);
     if ($button) {
         $result->addAction($button);
     }
     return $result;
 }