@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.

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

+35 -28
+35 -28
src/applications/legalpad/query/LegalpadDocumentSearchEngine.php
··· 168 168 169 169 $title = $document->getTitle(); 170 170 171 - $type_name = $document->getSignatureTypeName(); 172 - $type_icon = $document->getSignatureTypeIcon(); 173 - 174 171 $item = id(new PHUIObjectItemView()) 175 172 ->setObjectName($document->getMonogram()) 176 173 ->setHeader($title) 177 174 ->setHref('/'.$document->getMonogram()) 178 - ->setObject($document) 179 - ->addIcon($type_icon, $type_name) 180 - ->addIcon( 181 - 'fa-pencil grey', 182 - pht('Version %d (%s)', $document->getVersions(), $last_updated)); 175 + ->setObject($document); 183 176 184 - if ($viewer->getPHID()) { 185 - $signature = $document->getUserSignature($viewer->getPHID()); 177 + $no_signatures = LegalpadDocument::SIGNATURE_TYPE_NONE; 178 + if ($document->getSignatureType() == $no_signatures) { 179 + $item->addIcon('none', pht('Not Signable')); 186 180 } else { 187 - $signature = null; 181 + 182 + $type_name = $document->getSignatureTypeName(); 183 + $type_icon = $document->getSignatureTypeIcon(); 184 + $item->addIcon($type_icon, $type_name); 185 + 186 + if ($viewer->getPHID()) { 187 + $signature = $document->getUserSignature($viewer->getPHID()); 188 + } else { 189 + $signature = null; 190 + } 191 + 192 + if ($signature) { 193 + $item->addAttribute( 194 + array( 195 + id(new PHUIIconView())->setIconFont('fa-check-square-o', 'green'), 196 + ' ', 197 + pht( 198 + 'Signed on %s', 199 + phabricator_date($signature->getDateCreated(), $viewer)), 200 + )); 201 + } else { 202 + $item->addAttribute( 203 + array( 204 + id(new PHUIIconView())->setIconFont('fa-square-o', 'grey'), 205 + ' ', 206 + pht('Not Signed'), 207 + )); 208 + } 188 209 } 189 210 190 - if ($signature) { 191 - $item->addAttribute( 192 - array( 193 - id(new PHUIIconView())->setIconFont('fa-check-square-o', 'green'), 194 - ' ', 195 - pht( 196 - 'Signed on %s', 197 - phabricator_date($signature->getDateCreated(), $viewer)), 198 - )); 199 - } else { 200 - $item->addAttribute( 201 - array( 202 - id(new PHUIIconView())->setIconFont('fa-square-o', 'grey'), 203 - ' ', 204 - pht('Not Signed'), 205 - )); 206 - } 211 + $item->addIcon( 212 + 'fa-pencil grey', 213 + pht('Version %d (%s)', $document->getVersions(), $last_updated)); 207 214 208 215 $list->addItem($item); 209 216 }