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

Clean up legalpad sign UI

Summary: Moves stuff to ObjectBox, Error UI

Test Plan: Signed Document, Missed a Form Field, Resigned Form Document. Fixes T4037

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: Korvin, epriestley, aran

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

+57 -82
-9
src/__celerity_resource_map__.php
··· 2981 2981 ), 2982 2982 'disk' => '/rsrc/externals/javelin/lib/Workflow.js', 2983 2983 ), 2984 - 'legalpad-documentbody-css' => 2985 - array( 2986 - 'uri' => '/res/034c3494/rsrc/css/application/legalpad/legalpad-documentbody.css', 2987 - 'type' => 'css', 2988 - 'requires' => 2989 - array( 2990 - ), 2991 - 'disk' => '/rsrc/css/application/legalpad/legalpad-documentbody.css', 2992 - ), 2993 2984 'lightbox-attachment-css' => 2994 2985 array( 2995 2986 'uri' => '/res/4657e15d/rsrc/css/aphront/lightbox-attachment.css',
+57 -64
src/applications/legalpad/controller/LegalpadDocumentSignController.php
··· 47 47 $has_signed = true; 48 48 $error_view = id(new AphrontErrorView()) 49 49 ->setSeverity(AphrontErrorView::SEVERITY_NOTICE) 50 - ->setTitle(pht('You have already agreed to these terms.')); 50 + ->setTitle(pht('Already Signed')) 51 + ->appendChild(pht('Thank you for signing and agreeing')); 51 52 $data = $signature->getSignatureData(); 52 53 } 53 54 ··· 101 102 $has_signed = true; 102 103 $error_view = id(new AphrontErrorView()) 103 104 ->setSeverity(AphrontErrorView::SEVERITY_NOTICE) 104 - ->setTitle(pht('Signature successful. Thank you.')); 105 + ->setTitle(pht('Signature successful')) 106 + ->appendChild(pht('Thank you for signing and agreeing')); 105 107 } else { 106 108 $error_view = id(new AphrontErrorView()) 107 109 ->setTitle(pht('Error in submission.')) ··· 126 128 id(new PHUIDocumentView()) 127 129 ->setHeader($header) 128 130 ->appendChild($this->buildDocument($engine, $document_body)), 129 - $error_view, 130 131 $this->buildSignatureForm( 131 132 $document_body, 132 133 $signature, 133 134 $has_signed, 134 135 $e_name, 135 136 $e_email, 136 - $e_address_1)); 137 + $e_address_1, 138 + $error_view)); 137 139 138 140 return $this->buildApplicationPage( 139 141 $content, ··· 148 150 PhabricatorMarkupEngine 149 151 $engine, LegalpadDocumentBody $body) { 150 152 151 - require_celerity_resource('legalpad-documentbody-css'); 152 - 153 - return phutil_tag( 154 - 'div', 155 - array( 156 - 'class' => 'legalpad-documentbody' 157 - ), 158 - $engine->getOutput($body, LegalpadDocumentBody::MARKUP_FIELD_TEXT)); 159 - 153 + return $engine->getOutput($body, LegalpadDocumentBody::MARKUP_FIELD_TEXT); 160 154 } 161 155 162 156 private function buildSignatureForm( ··· 165 159 $has_signed = false, 166 160 $e_name = true, 167 161 $e_email = true, 168 - $e_address_1 = true) { 162 + $e_address_1 = true, 163 + $error_view = null) { 169 164 170 165 $user = $this->getRequest()->getUser(); 171 166 if ($has_signed) { ··· 178 173 $form = id(new AphrontFormView()) 179 174 ->setUser($user) 180 175 ->appendChild( 181 - id(new AphrontFormInsetView()) 182 - ->setTitle(pht('Sign and Agree')) 183 - ->setDescription($instructions) 184 - ->setContent(phutil_tag('br', array())) 185 - ->appendChild( 186 - id(new AphrontFormTextControl()) 187 - ->setLabel(pht('Name')) 188 - ->setValue(idx($data, 'name', '')) 189 - ->setName('name') 190 - ->setError($e_name) 191 - ->setDisabled($has_signed)) 192 - ->appendChild( 193 - id(new AphrontFormTextControl()) 194 - ->setLabel(pht('Email')) 195 - ->setValue(idx($data, 'email', '')) 196 - ->setName('email') 197 - ->setError($e_email) 198 - ->setDisabled($has_signed)) 199 - ->appendChild( 200 - id(new AphrontFormTextControl()) 201 - ->setLabel(pht('Address line 1')) 202 - ->setValue(idx($data, 'address_1', '')) 203 - ->setName('address_1') 204 - ->setError($e_address_1) 205 - ->setDisabled($has_signed)) 206 - ->appendChild( 207 - id(new AphrontFormTextControl()) 208 - ->setLabel(pht('Address line 2')) 209 - ->setValue(idx($data, 'address_2', '')) 210 - ->setName('address_2') 211 - ->setDisabled($has_signed)) 212 - ->appendChild( 213 - id(new AphrontFormTextControl()) 214 - ->setLabel(pht('Phone')) 215 - ->setValue(idx($data, 'phone', '')) 216 - ->setName('phone') 217 - ->setDisabled($has_signed)) 218 - ->appendChild( 219 - id(new AphrontFormCheckboxControl()) 220 - ->addCheckbox( 221 - 'agree', 222 - 'agree', 223 - pht('I agree to the terms laid forth above.'), 224 - $has_signed) 225 - ->setDisabled($has_signed)) 226 - ->appendChild( 227 - id(new AphrontFormSubmitControl()) 228 - ->setValue(pht('Sign and Agree')) 229 - ->setDisabled($has_signed))); 176 + id(new AphrontFormTextControl()) 177 + ->setLabel(pht('Name')) 178 + ->setValue(idx($data, 'name', '')) 179 + ->setName('name') 180 + ->setError($e_name) 181 + ->setDisabled($has_signed)) 182 + ->appendChild( 183 + id(new AphrontFormTextControl()) 184 + ->setLabel(pht('Email')) 185 + ->setValue(idx($data, 'email', '')) 186 + ->setName('email') 187 + ->setError($e_email) 188 + ->setDisabled($has_signed)) 189 + ->appendChild( 190 + id(new AphrontFormTextControl()) 191 + ->setLabel(pht('Address line 1')) 192 + ->setValue(idx($data, 'address_1', '')) 193 + ->setName('address_1') 194 + ->setError($e_address_1) 195 + ->setDisabled($has_signed)) 196 + ->appendChild( 197 + id(new AphrontFormTextControl()) 198 + ->setLabel(pht('Address line 2')) 199 + ->setValue(idx($data, 'address_2', '')) 200 + ->setName('address_2') 201 + ->setDisabled($has_signed)) 202 + ->appendChild( 203 + id(new AphrontFormTextControl()) 204 + ->setLabel(pht('Phone')) 205 + ->setValue(idx($data, 'phone', '')) 206 + ->setName('phone') 207 + ->setDisabled($has_signed)) 208 + ->appendChild( 209 + id(new AphrontFormCheckboxControl()) 210 + ->addCheckbox( 211 + 'agree', 212 + 'agree', 213 + pht('I agree to the terms laid forth above.'), 214 + $has_signed) 215 + ->setDisabled($has_signed)) 216 + ->appendChild( 217 + id(new AphrontFormSubmitControl()) 218 + ->setValue(pht('Sign and Agree')) 219 + ->setDisabled($has_signed)); 230 220 231 - return $form; 221 + return id(new PHUIObjectBoxView()) 222 + ->setHeaderText(pht('Sign and Agree')) 223 + ->setFormError($error_view) 224 + ->setForm($form); 232 225 } 233 226 234 227 }
-9
webroot/rsrc/css/application/legalpad/legalpad-documentbody.css
··· 1 - /** 2 - * @provides legalpad-documentbody-css 3 - */ 4 - 5 - .legalpad-documentbody { 6 - position: relative; 7 - padding: 1.25em 2% 8 - } 9 -