1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-20 05:42:40 +01:00

Make legalpad document list a little nicer for unsignable documents

Summary:
This just cleans things up a little:

  - Don't show signature status if the document isn't signable.
  - Show "Not Signable" instead of "No One" to make the meaning more clear in this context, where we don't have a "Who should sign:" sort of cue.

Test Plan: {F310538}

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D11834
This commit is contained in:
epriestley 2015-02-20 07:26:45 -08:00
parent 9c23a74fb7
commit 543cb1c900

View file

@ -168,42 +168,49 @@ final class LegalpadDocumentSearchEngine
$title = $document->getTitle(); $title = $document->getTitle();
$type_name = $document->getSignatureTypeName();
$type_icon = $document->getSignatureTypeIcon();
$item = id(new PHUIObjectItemView()) $item = id(new PHUIObjectItemView())
->setObjectName($document->getMonogram()) ->setObjectName($document->getMonogram())
->setHeader($title) ->setHeader($title)
->setHref('/'.$document->getMonogram()) ->setHref('/'.$document->getMonogram())
->setObject($document) ->setObject($document);
->addIcon($type_icon, $type_name)
->addIcon(
'fa-pencil grey',
pht('Version %d (%s)', $document->getVersions(), $last_updated));
if ($viewer->getPHID()) { $no_signatures = LegalpadDocument::SIGNATURE_TYPE_NONE;
$signature = $document->getUserSignature($viewer->getPHID()); if ($document->getSignatureType() == $no_signatures) {
$item->addIcon('none', pht('Not Signable'));
} else { } else {
$signature = null;
$type_name = $document->getSignatureTypeName();
$type_icon = $document->getSignatureTypeIcon();
$item->addIcon($type_icon, $type_name);
if ($viewer->getPHID()) {
$signature = $document->getUserSignature($viewer->getPHID());
} else {
$signature = null;
}
if ($signature) {
$item->addAttribute(
array(
id(new PHUIIconView())->setIconFont('fa-check-square-o', 'green'),
' ',
pht(
'Signed on %s',
phabricator_date($signature->getDateCreated(), $viewer)),
));
} else {
$item->addAttribute(
array(
id(new PHUIIconView())->setIconFont('fa-square-o', 'grey'),
' ',
pht('Not Signed'),
));
}
} }
if ($signature) { $item->addIcon(
$item->addAttribute( 'fa-pencil grey',
array( pht('Version %d (%s)', $document->getVersions(), $last_updated));
id(new PHUIIconView())->setIconFont('fa-check-square-o', 'green'),
' ',
pht(
'Signed on %s',
phabricator_date($signature->getDateCreated(), $viewer)),
));
} else {
$item->addAttribute(
array(
id(new PHUIIconView())->setIconFont('fa-square-o', 'grey'),
' ',
pht('Not Signed'),
));
}
$list->addItem($item); $list->addItem($item);
} }