@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

Update Phortune UI elements

Summary:
Ref T2787. Update some of the UI elements used by Phortune. Mostly gets rid of the old blue headers.

Also adds some sweet art.

Test Plan: Poked aroudn Phortune.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T2787

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

+120 -96
+24 -17
resources/celerity/map.php
··· 8 8 'names' => 9 9 array( 10 10 'core.pkg.css' => 'c2c68e64', 11 - 'core.pkg.js' => '2b9e8efd', 11 + 'core.pkg.js' => '80884e9b', 12 12 'darkconsole.pkg.js' => 'df001cab', 13 13 'differential.pkg.css' => '4a93db37', 14 14 'differential.pkg.js' => '7528cfc9', ··· 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 88 'rsrc/css/application/phrequent/phrequent.css' => 'ffc185ad', 88 89 'rsrc/css/application/phriction/phriction-document-css.css' => '7d7f0071', 89 90 'rsrc/css/application/policy/policy-edit.css' => '05cca26a', ··· 216 217 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadCompositeSource.js' => '503e17fd', 217 218 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadOnDemandSource.js' => '8b3fd187', 218 219 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadPreloadedSource.js' => '54f314a0', 219 - 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadSource.js' => '210aa43b', 220 + 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadSource.js' => 'fcba4ecc', 220 221 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadStaticSource.js' => '316b8fa1', 221 222 'rsrc/externals/raphael/g.raphael.js' => '40dde778', 222 223 'rsrc/externals/raphael/g.raphael.line.js' => '40da039e', ··· 308 309 'rsrc/image/people/mckinley.png' => 'fb8f16ce', 309 310 'rsrc/image/people/taft.png' => 'd7bc402c', 310 311 'rsrc/image/people/washington.png' => '40dd301c', 312 + 'rsrc/image/phortune/balanced.png' => 'f6ba2691', 313 + 'rsrc/image/phortune/paypal.png' => '9747cb33', 314 + 'rsrc/image/phortune/stripe.png' => 'bfedc2ce', 315 + 'rsrc/image/phortune/test.png' => '0235d8a7', 316 + 'rsrc/image/phortune/wepay.png' => 'b37163ce', 311 317 'rsrc/image/phrequent_active.png' => 'a466a8ed', 312 318 'rsrc/image/phrequent_inactive.png' => 'bfc15a69', 313 319 'rsrc/image/search-white.png' => '64cc0d45', ··· 357 363 'rsrc/js/application/countdown/timer.js' => '361e3ed3', 358 364 'rsrc/js/application/dashboard/behavior-dashboard-async-panel.js' => '469c0d9e', 359 365 'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => '82439934', 360 - 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '880fa5ac', 366 + 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 361 367 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', 362 368 'rsrc/js/application/differential/ChangesetViewManager.js' => 'd2907473', 363 369 'rsrc/js/application/differential/DifferentialInlineCommentEditor.js' => 'f2441746', ··· 564 570 'javelin-behavior-dark-console' => '357b6e9b', 565 571 'javelin-behavior-dashboard-async-panel' => '469c0d9e', 566 572 'javelin-behavior-dashboard-move-panels' => '82439934', 567 - 'javelin-behavior-dashboard-query-panel-select' => '880fa5ac', 573 + 'javelin-behavior-dashboard-query-panel-select' => '453c5375', 568 574 'javelin-behavior-dashboard-tab-panel' => 'd4eecc63', 569 575 'javelin-behavior-device' => '03d6ed07', 570 576 'javelin-behavior-differential-add-reviewers-and-ccs' => 'e10f8e18', ··· 683 689 'javelin-typeahead-normalizer' => 'aa93c7b0', 684 690 'javelin-typeahead-ondemand-source' => '8b3fd187', 685 691 'javelin-typeahead-preloaded-source' => '54f314a0', 686 - 'javelin-typeahead-source' => '210aa43b', 692 + 'javelin-typeahead-source' => 'fcba4ecc', 687 693 'javelin-typeahead-static-source' => '316b8fa1', 688 694 'javelin-uri' => '6eff08aa', 689 695 'javelin-util' => 'a23de73d', ··· 762 768 'pholio-inline-comments-css' => '8e545e49', 763 769 'phortune-credit-card-form' => '2290aeef', 764 770 'phortune-credit-card-form-css' => 'b25b4beb', 771 + 'phortune-css' => '012360a6', 765 772 'phrequent-css' => 'ffc185ad', 766 773 'phriction-document-css' => '7d7f0071', 767 774 'phui-action-header-view-css' => '83e2cc86', ··· 997 1004 0 => 'javelin-util', 998 1005 1 => 'javelin-magical-init', 999 1006 ), 1000 - '210aa43b' => 1001 - array( 1002 - 0 => 'javelin-install', 1003 - 1 => 'javelin-util', 1004 - 2 => 'javelin-dom', 1005 - 3 => 'javelin-typeahead-normalizer', 1006 - ), 1007 1007 '2290aeef' => 1008 1008 array( 1009 1009 0 => 'javelin-install', ··· 1179 1179 0 => 'javelin-behavior', 1180 1180 1 => 'javelin-dom', 1181 1181 2 => 'phabricator-prefab', 1182 + ), 1183 + '453c5375' => 1184 + array( 1185 + 0 => 'javelin-behavior', 1186 + 1 => 'javelin-dom', 1182 1187 ), 1183 1188 '469c0d9e' => 1184 1189 array( ··· 1498 1503 '85ea0626' => 1499 1504 array( 1500 1505 0 => 'javelin-install', 1501 - ), 1502 - '880fa5ac' => 1503 - array( 1504 - 0 => 'javelin-behavior', 1505 - 1 => 'javelin-dom', 1506 1506 ), 1507 1507 '88236f00' => 1508 1508 array( ··· 2131 2131 1 => 'javelin-dom', 2132 2132 2 => 'javelin-vector', 2133 2133 3 => 'javelin-magical-init', 2134 + ), 2135 + 'fcba4ecc' => 2136 + array( 2137 + 0 => 'javelin-install', 2138 + 1 => 'javelin-util', 2139 + 2 => 'javelin-dom', 2140 + 3 => 'javelin-typeahead-normalizer', 2134 2141 ), 2135 2142 42126667 => 2136 2143 array(
-3
src/applications/phortune/application/PhabricatorApplicationPhortune.php
··· 41 41 '' => 'PhortuneAccountListController', 42 42 'edit/(?:(?P<id>\d+)/)?' => 'PhortuneAccountEditController', 43 43 ), 44 - 'stripe/' => array( 45 - 'testpaymentform/' => 'PhortuneStripeTestPaymentFormController', 46 - ), 47 44 'product/' => array( 48 45 '' => 'PhortuneProductListController', 49 46 'view/(?P<id>\d+)/' => 'PhortuneProductViewController',
+21 -8
src/applications/phortune/controller/PhortuneAccountBuyController.php
··· 82 82 pht('Qty.'), 83 83 pht('Total'), 84 84 )); 85 - 86 - $panel = new AphrontPanelView(); 87 - $panel->setNoBackground(true); 88 - $panel->appendChild($table); 85 + $table->setColumnClasses( 86 + array( 87 + 'wide', 88 + 'right', 89 + 'right', 90 + 'right', 91 + )); 89 92 93 + $cart_box = id(new PHUIObjectBoxView()) 94 + ->setHeaderText(pht('Your Cart')) 95 + ->appendChild($table); 90 96 91 97 $title = pht('Buy Stuff'); 92 98 ··· 167 173 ->setValue($one_time_options)); 168 174 } 169 175 176 + $payment_box = id(new PHUIObjectBoxView()) 177 + ->setHeaderText(pht('Choose Payment Method')) 178 + ->appendChild($form) 179 + ->appendChild($provider_form); 180 + 181 + $crumbs = $this->buildApplicationCrumbs(); 182 + $crumbs->addTextCrumb($title); 183 + 170 184 return $this->buildApplicationPage( 171 185 array( 172 - $panel, 173 - $form, 174 - phutil_tag('br', array()), 175 - $provider_form, 186 + $crumbs, 187 + $cart_box, 188 + $payment_box, 176 189 ), 177 190 array( 178 191 'title' => $title,
+17 -22
src/applications/phortune/controller/PhortuneAccountViewController.php
··· 79 79 $request = $this->getRequest(); 80 80 $user = $request->getUser(); 81 81 82 - $header = id(new PHUIHeaderView()) 83 - ->setHeader(pht('Payment Methods')); 84 - 85 82 $id = $account->getID(); 86 - $add_uri = $this->getApplicationURI($id.'/paymentmethod/edit/'); 87 83 88 - $actions = id(new PhabricatorActionListView()) 89 - ->setUser($user) 90 - ->setObjectURI($request->getRequestURI()) 91 - ->addAction( 92 - id(new PhabricatorActionView()) 93 - ->setName(pht('Add Payment Method')) 94 - ->setIcon('fa-plus') 95 - ->setHref($add_uri)); 84 + $header = id(new PHUIHeaderView()) 85 + ->setHeader(pht('Payment Methods')) 86 + ->addActionLink( 87 + id(new PHUIButtonView()) 88 + ->setTag('a') 89 + ->setHref($this->getApplicationURI($id.'/paymentmethod/edit/')) 90 + ->setText(pht('Add Payment Method')) 91 + ->setIcon(id(new PHUIIconView())->setIconFont('fa-plus'))); 96 92 97 93 $list = id(new PHUIObjectItemListView()) 98 94 ->setUser($user) ··· 129 125 $list->addItem($item); 130 126 } 131 127 132 - return array( 133 - $header, 134 - $actions, 135 - $list, 136 - ); 128 + return id(new PHUIObjectBoxView()) 129 + ->setHeader($header) 130 + ->appendChild($list); 137 131 } 138 132 139 133 private function buildPurchaseHistorySection(PhortuneAccount $account) { ··· 143 137 $header = id(new PHUIHeaderView()) 144 138 ->setHeader(pht('Purchase History')); 145 139 146 - return array( 147 - $header, 148 - 149 - ); 140 + return id(new PHUIObjectBoxView()) 141 + ->setHeader($header); 150 142 } 151 143 152 144 private function buildAccountHistorySection(PhortuneAccount $account) { ··· 170 162 ->setTransactions($xactions) 171 163 ->setMarkupEngine($engine); 172 164 165 + $box = id(new PHUIObjectBoxView()) 166 + ->setHeader($header); 167 + 173 168 return array( 174 - $header, 169 + $box, 175 170 $xaction_view, 176 171 ); 177 172 }
+41 -42
src/applications/phortune/controller/PhortunePaymentMethodEditController.php
··· 37 37 foreach ($providers as $provider) { 38 38 $choices[] = $this->renderSelectProvider($provider); 39 39 } 40 - return $this->buildResponse($choices, $account_uri); 40 + 41 + $content = phutil_tag( 42 + 'div', 43 + array( 44 + 'class' => 'phortune-payment-method-list', 45 + ), 46 + $choices); 47 + 48 + return $this->newDialog() 49 + ->setRenderDialogAsDiv(true) 50 + ->setTitle(pht('Add Payment Method')) 51 + ->appendParagraph(pht('Choose a payment method to add:')) 52 + ->appendChild($content) 53 + ->addCancelButton($account_uri); 41 54 } 42 55 43 56 $provider = $providers[$provider_key]; ··· 111 124 ->setValue(pht('Add Payment Method')) 112 125 ->addCancelButton($account_uri)); 113 126 114 - if ($errors) { 115 - $errors = id(new AphrontErrorView()) 116 - ->setErrors($errors); 117 - } 127 + $box = id(new PHUIObjectBoxView()) 128 + ->setHeaderText($provider->getPaymentMethodDescription()) 129 + ->setForm($form); 130 + 131 + $crumbs = $this->buildApplicationCrumbs(); 132 + $crumbs->addTextCrumb(pht('Add Payment Method')); 118 133 119 - return $this->buildResponse( 120 - array($errors, $form), 121 - $account_uri); 134 + return $this->buildApplicationPage( 135 + array( 136 + $crumbs, 137 + $box, 138 + ), 139 + array( 140 + 'title' => $provider->getPaymentMethodDescription(), 141 + )); 122 142 } 123 143 124 144 private function renderSelectProvider( ··· 128 148 $user = $request->getUser(); 129 149 130 150 $description = $provider->getPaymentMethodDescription(); 131 - $icon = $provider->getPaymentMethodIcon(); 151 + $icon_uri = $provider->getPaymentMethodIcon(); 132 152 $details = $provider->getPaymentMethodProviderDescription(); 133 153 134 - $button = phutil_tag( 135 - 'button', 136 - array( 137 - 'class' => 'grey', 138 - ), 139 - array( 140 - $description, 141 - phutil_tag('br'), 142 - $icon, 143 - $details, 144 - )); 154 + $this->requireResource('phortune-css'); 155 + 156 + $icon = id(new PHUIIconView()) 157 + ->setImage($icon_uri) 158 + ->addClass('phortune-payment-icon'); 159 + 160 + $button = id(new PHUIButtonView()) 161 + ->setSize(PHUIButtonView::BIG) 162 + ->setColor(PHUIButtonView::GREY) 163 + ->setIcon($icon) 164 + ->setText($description) 165 + ->setSubtext($details); 145 166 146 167 $form = id(new AphrontFormView()) 147 168 ->setUser($user) ··· 149 170 ->appendChild($button); 150 171 151 172 return $form; 152 - } 153 - 154 - private function buildResponse($content, $account_uri) { 155 - $request = $this->getRequest(); 156 - 157 - $title = pht('Add Payment Method'); 158 - $header = id(new PHUIHeaderView()) 159 - ->setHeader($title); 160 - 161 - $crumbs = $this->buildApplicationCrumbs(); 162 - $crumbs->addTextCrumb(pht('Account'), $account_uri); 163 - $crumbs->addTextCrumb(pht('Payment Methods'), $request->getRequestURI()); 164 - 165 - return $this->buildApplicationPage( 166 - array( 167 - $crumbs, 168 - $header, 169 - $content, 170 - ), 171 - array( 172 - 'title' => $title, 173 - )); 174 173 } 175 174 176 175 private function processClientErrors(
-4
src/applications/phortune/controller/PhortuneProductListController.php
··· 24 24 ->setHref($this->getApplicationURI('product/edit/')) 25 25 ->setIcon('fa-plus-square')); 26 26 27 - $header = id(new PHUIHeaderView()) 28 - ->setHeader(pht('Product List')); 29 - 30 27 $product_list = id(new PHUIObjectItemListView()) 31 28 ->setUser($user) 32 29 ->setNoDataString(pht('No products.')); ··· 51 48 return $this->buildApplicationPage( 52 49 array( 53 50 $crumbs, 54 - $header, 55 51 $product_list, 56 52 $pager, 57 53 ),
+17
webroot/rsrc/css/application/phortune/phortune.css
··· 1 + /** 2 + * @provides phortune-css 3 + */ 4 + 5 + .phortune-payment-icon { 6 + width: 34px; 7 + height: 34px; 8 + } 9 + 10 + .phortune-payment-method-list { 11 + margin: 8px 24px 0; 12 + } 13 + 14 + .phortune-payment-method-list button { 15 + margin: 4px 0; 16 + width: 100%; 17 + }
webroot/rsrc/image/phortune/balanced.png

This is a binary file and will not be displayed.

webroot/rsrc/image/phortune/paypal.png

This is a binary file and will not be displayed.

webroot/rsrc/image/phortune/stripe.png

This is a binary file and will not be displayed.

webroot/rsrc/image/phortune/test.png

This is a binary file and will not be displayed.

webroot/rsrc/image/phortune/wepay.png

This is a binary file and will not be displayed.