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

Show signatures in a table instead of an object list

Summary:
Ref T3116. Since this UI was written we've moved away from footer icons and made tables work better on mobile. This seems reasonable to use a pure table for. I've also reduced the number of required fields here. Use a table and make this UI accessible.

The "Restricted External Account" stuff is T3732, which I'll tackle next.

Test Plan: {F171584}

Reviewers: chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T3116

Differential Revision: https://secure.phabricator.com/D9766

+80 -37
+80 -37
src/applications/legalpad/query/LegalpadDocumentSignatureSearchEngine.php
··· 110 110 111 111 $viewer = $this->requireViewer(); 112 112 113 - $list = new PHUIObjectItemListView(); 114 - $list->setUser($viewer); 113 + Javelin::initBehavior('phabricator-tooltips'); 115 114 116 - foreach ($signatures as $signature) { 117 - $created = phabricator_date($signature->getDateCreated(), $viewer); 115 + $sig_good = $this->renderIcon( 116 + 'fa-check', 117 + null, 118 + pht('Verified, Current')); 118 119 119 - $data = $signature->getSignatureData(); 120 + $sig_old = $this->renderIcon( 121 + 'fa-clock-o', 122 + 'orange', 123 + pht('Signed Older Version')); 120 124 121 - $sig_data = phutil_tag( 122 - 'div', 123 - array(), 124 - array( 125 - phutil_tag( 126 - 'div', 127 - array(), 128 - phutil_tag( 129 - 'a', 130 - array( 131 - 'href' => 'mailto:'.$data['email'], 132 - ), 133 - $data['email'])), 134 - )); 125 + $sig_unverified = $this->renderIcon( 126 + 'fa-envelope', 127 + 'red', 128 + pht('Unverified Email')); 135 129 136 - $item = id(new PHUIObjectItemView()) 137 - ->setObject($signature) 138 - ->setHeader($data['name']) 139 - ->setSubhead($sig_data) 140 - ->addIcon('none', pht('Signed %s', $created)); 130 + id(new PHUIIconView()) 131 + ->setIconFont('fa-envelope', 'red') 132 + ->addSigil('has-tooltip') 133 + ->setMetadata(array('tip' => pht('Unverified Email'))); 141 134 142 - $good_sig = true; 143 - if (!$signature->isVerified()) { 144 - $item->addFootIcon('disable', 'Unverified Email'); 145 - $good_sig = false; 146 - } 135 + $rows = array(); 136 + foreach ($signatures as $signature) { 137 + $data = $signature->getSignatureData(); 138 + $name = idx($data, 'name'); 139 + $email = idx($data, 'email'); 147 140 148 141 $document = $signature->getDocument(); 149 - if ($signature->getDocumentVersion() != $document->getVersions()) { 150 - $item->addFootIcon('delete', 'Stale Signature'); 151 - $good_sig = false; 152 - } 153 142 154 - if ($good_sig) { 155 - $item->setBarColor('green'); 143 + if (!$signature->isVerified()) { 144 + $sig_icon = $sig_unverified; 145 + } else if ($signature->getDocumentVersion() != $document->getVersions()) { 146 + $sig_icon = $sig_old; 147 + } else { 148 + $sig_icon = $sig_good; 156 149 } 157 150 158 - $list->addItem($item); 151 + $rows[] = array( 152 + $sig_icon, 153 + $handles[$signature->getSignerPHID()]->renderLink(), 154 + $name, 155 + phutil_tag( 156 + 'a', 157 + array( 158 + 'href' => 'mailto:'.$email, 159 + ), 160 + $email), 161 + phabricator_datetime($signature->getDateCreated(), $viewer), 162 + ); 159 163 } 160 164 161 - return $list; 165 + $table = id(new AphrontTableView($rows)) 166 + ->setHeaders( 167 + array( 168 + '', 169 + pht('Account'), 170 + pht('Name'), 171 + pht('Email'), 172 + pht('Signed'), 173 + )) 174 + ->setColumnClasses( 175 + array( 176 + '', 177 + '', 178 + '', 179 + 'wide', 180 + 'right', 181 + )); 182 + 183 + $box = id(new PHUIObjectBoxView()) 184 + ->setHeaderText(pht('Signatures')) 185 + ->appendChild($table); 186 + 187 + return $box; 188 + } 189 + 190 + private function renderIcon($icon, $color, $title) { 191 + Javelin::initBehavior('phabricator-tooltips'); 192 + 193 + return array( 194 + id(new PHUIIconView()) 195 + ->setIconFont($icon, $color) 196 + ->addSigil('has-tooltip') 197 + ->setMetadata(array('tip' => $title)), 198 + javelin_tag( 199 + 'span', 200 + array( 201 + 'aural' => true, 202 + ), 203 + $title), 204 + ); 162 205 } 163 206 164 207 }