@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 Phortune checkout UI a little less bad

Summary: Ref T2787. There were some mega-uggo buttons and such; reduce the uggo-ness by a hair.

Test Plan: {F179686}

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T2787

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

+63 -62
+2 -2
resources/celerity/map.php
··· 84 84 'rsrc/css/application/pholio/pholio-inline-comments.css' => '8e545e49', 85 85 'rsrc/css/application/pholio/pholio.css' => '47dffb9c', 86 86 'rsrc/css/application/phortune/phortune-credit-card-form.css' => 'b25b4beb', 87 - 'rsrc/css/application/phortune/phortune.css' => '012360a6', 87 + 'rsrc/css/application/phortune/phortune.css' => '9149f103', 88 88 'rsrc/css/application/phrequent/phrequent.css' => 'ffc185ad', 89 89 'rsrc/css/application/phriction/phriction-document-css.css' => '7d7f0071', 90 90 'rsrc/css/application/policy/policy-edit.css' => '05cca26a', ··· 767 767 'pholio-inline-comments-css' => '8e545e49', 768 768 'phortune-credit-card-form' => '2290aeef', 769 769 'phortune-credit-card-form-css' => 'b25b4beb', 770 - 'phortune-css' => '012360a6', 770 + 'phortune-css' => '9149f103', 771 771 'phrequent-css' => 'ffc185ad', 772 772 'phriction-document-css' => '7d7f0071', 773 773 'phui-action-header-view-css' => '83e2cc86',
+7
src/applications/phortune/controller/PhortuneCartCheckoutController.php
··· 146 146 $viewer); 147 147 } 148 148 149 + $one_time_options = phutil_tag( 150 + 'div', 151 + array( 152 + 'class' => 'phortune-payment-onetime-list', 153 + ), 154 + $one_time_options); 155 + 149 156 $provider_form = new PHUIFormLayoutView(); 150 157 $provider_form->appendChild( 151 158 id(new AphrontFormMarkupControl())
+31 -1
src/applications/phortune/provider/PhortunePaymentProvider.php
··· 181 181 PhortuneAccount $account, 182 182 PhortuneCart $cart, 183 183 PhabricatorUser $user) { 184 - throw new PhortuneNotImplementedException($this); 184 + 185 + require_celerity_resource('phortune-css'); 186 + 187 + $icon_uri = $this->getPaymentMethodIcon(); 188 + $description = $this->getPaymentMethodProviderDescription(); 189 + $details = $this->getPaymentMethodDescription(); 190 + 191 + $icon = id(new PHUIIconView()) 192 + ->setImage($icon_uri) 193 + ->addClass('phortune-payment-icon'); 194 + 195 + $button = id(new PHUIButtonView()) 196 + ->setSize(PHUIButtonView::BIG) 197 + ->setColor(PHUIButtonView::GREY) 198 + ->setIcon($icon) 199 + ->setText($description) 200 + ->setSubtext($details); 201 + 202 + $uri = $this->getControllerURI( 203 + 'checkout', 204 + array( 205 + 'cartID' => $cart->getID(), 206 + )); 207 + 208 + return phabricator_form( 209 + $user, 210 + array( 211 + 'action' => $uri, 212 + 'method' => 'POST', 213 + ), 214 + $button); 185 215 } 186 216 187 217
+2 -30
src/applications/phortune/provider/PhortunePaypalPaymentProvider.php
··· 17 17 } 18 18 19 19 public function getPaymentMethodDescription() { 20 - return 'Paypal Account'; 20 + return pht('Credit Card or Paypal Account'); 21 21 } 22 22 23 23 public function getPaymentMethodIcon() { 24 - return 'rsrc/phortune/paypal.png'; 24 + return celerity_get_resource_uri('rsrc/image/phortune/paypal.png'); 25 25 } 26 26 27 27 public function getPaymentMethodProviderDescription() { 28 28 return 'Paypal'; 29 29 } 30 - 31 30 32 31 public function canHandlePaymentMethod(PhortunePaymentMethod $method) { 33 32 $type = $method->getMetadataValue('type'); ··· 57 56 public function canProcessOneTimePayments() { 58 57 return true; 59 58 } 60 - 61 - public function renderOneTimePaymentButton( 62 - PhortuneAccount $account, 63 - PhortuneCart $cart, 64 - PhabricatorUser $user) { 65 - 66 - $uri = $this->getControllerURI( 67 - 'checkout', 68 - array( 69 - 'cartID' => $cart->getID(), 70 - )); 71 - 72 - return phabricator_form( 73 - $user, 74 - array( 75 - 'action' => $uri, 76 - 'method' => 'POST', 77 - ), 78 - phutil_tag( 79 - 'button', 80 - array( 81 - 'class' => 'green', 82 - 'type' => 'submit', 83 - ), 84 - pht('Pay with Paypal'))); 85 - } 86 - 87 59 88 60 /* -( Controllers )-------------------------------------------------------- */ 89 61
+1 -28
src/applications/phortune/provider/PhortuneWePayPaymentProvider.php
··· 22 22 } 23 23 24 24 public function getPaymentMethodIcon() { 25 - return 'rsrc/phortune/wepay.png'; 25 + return celerity_get_resource_uri('/rsrc/image/phortune/wepay.png'); 26 26 } 27 27 28 28 public function getPaymentMethodProviderDescription() { 29 29 return 'WePay'; 30 30 } 31 - 32 31 33 32 public function canHandlePaymentMethod(PhortunePaymentMethod $method) { 34 33 $type = $method->getMetadataValue('type'); ··· 62 61 63 62 public function canProcessOneTimePayments() { 64 63 return true; 65 - } 66 - 67 - public function renderOneTimePaymentButton( 68 - PhortuneAccount $account, 69 - PhortuneCart $cart, 70 - PhabricatorUser $user) { 71 - 72 - $uri = $this->getControllerURI( 73 - 'checkout', 74 - array( 75 - 'cartID' => $cart->getID(), 76 - )); 77 - 78 - return phabricator_form( 79 - $user, 80 - array( 81 - 'action' => $uri, 82 - 'method' => 'POST', 83 - ), 84 - phutil_tag( 85 - 'button', 86 - array( 87 - 'class' => 'green', 88 - 'type' => 'submit', 89 - ), 90 - pht('Pay with WePay'))); 91 64 } 92 65 93 66
+9
src/applications/phortune/query/PhortunePaymentMethodQuery.php
··· 47 47 } 48 48 49 49 protected function willFilterPage(array $methods) { 50 + foreach ($methods as $key => $method) { 51 + try { 52 + $method->buildPaymentProvider(); 53 + } catch (Exception $ex) { 54 + unset($methods[$key]); 55 + continue; 56 + } 57 + } 58 + 50 59 $accounts = id(new PhortuneAccountQuery()) 51 60 ->setViewer($this->getViewer()) 52 61 ->withPHIDs(mpull($methods, 'getAccountPHID'))
+2 -1
src/applications/phortune/storage/PhortunePaymentMethod.php
··· 48 48 } 49 49 50 50 public function getDescription() { 51 - return '...'; 51 + $provider = $this->buildPaymentProvider(); 52 + return $provider->getPaymentMethodProviderDescription(); 52 53 } 53 54 54 55 public function getMetadataValue($key, $default = null) {
+9
webroot/rsrc/css/application/phortune/phortune.css
··· 15 15 margin: 4px 0; 16 16 width: 100%; 17 17 } 18 + 19 + .phortune-payment-onetime-list { 20 + width: 280px; 21 + } 22 + 23 + .phortune-payment-onetime-list button { 24 + margin: 0 0 8px 0; 25 + width: 100%; 26 + }