1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-04-02 15:38:18 +02:00

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
This commit is contained in:
epriestley 2014-07-13 09:18:50 -07:00
parent 66a30ef97b
commit 3a59cff7e6
12 changed files with 120 additions and 96 deletions

View file

@ -8,7 +8,7 @@ return array(
'names' => 'names' =>
array( array(
'core.pkg.css' => 'c2c68e64', 'core.pkg.css' => 'c2c68e64',
'core.pkg.js' => '2b9e8efd', 'core.pkg.js' => '80884e9b',
'darkconsole.pkg.js' => 'df001cab', 'darkconsole.pkg.js' => 'df001cab',
'differential.pkg.css' => '4a93db37', 'differential.pkg.css' => '4a93db37',
'differential.pkg.js' => '7528cfc9', 'differential.pkg.js' => '7528cfc9',
@ -84,6 +84,7 @@ return array(
'rsrc/css/application/pholio/pholio-inline-comments.css' => '8e545e49', 'rsrc/css/application/pholio/pholio-inline-comments.css' => '8e545e49',
'rsrc/css/application/pholio/pholio.css' => '47dffb9c', 'rsrc/css/application/pholio/pholio.css' => '47dffb9c',
'rsrc/css/application/phortune/phortune-credit-card-form.css' => 'b25b4beb', 'rsrc/css/application/phortune/phortune-credit-card-form.css' => 'b25b4beb',
'rsrc/css/application/phortune/phortune.css' => '012360a6',
'rsrc/css/application/phrequent/phrequent.css' => 'ffc185ad', 'rsrc/css/application/phrequent/phrequent.css' => 'ffc185ad',
'rsrc/css/application/phriction/phriction-document-css.css' => '7d7f0071', 'rsrc/css/application/phriction/phriction-document-css.css' => '7d7f0071',
'rsrc/css/application/policy/policy-edit.css' => '05cca26a', 'rsrc/css/application/policy/policy-edit.css' => '05cca26a',
@ -216,7 +217,7 @@ return array(
'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadCompositeSource.js' => '503e17fd', 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadCompositeSource.js' => '503e17fd',
'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadOnDemandSource.js' => '8b3fd187', 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadOnDemandSource.js' => '8b3fd187',
'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadPreloadedSource.js' => '54f314a0', 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadPreloadedSource.js' => '54f314a0',
'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadSource.js' => '210aa43b', 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadSource.js' => 'fcba4ecc',
'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadStaticSource.js' => '316b8fa1', 'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadStaticSource.js' => '316b8fa1',
'rsrc/externals/raphael/g.raphael.js' => '40dde778', 'rsrc/externals/raphael/g.raphael.js' => '40dde778',
'rsrc/externals/raphael/g.raphael.line.js' => '40da039e', 'rsrc/externals/raphael/g.raphael.line.js' => '40da039e',
@ -308,6 +309,11 @@ return array(
'rsrc/image/people/mckinley.png' => 'fb8f16ce', 'rsrc/image/people/mckinley.png' => 'fb8f16ce',
'rsrc/image/people/taft.png' => 'd7bc402c', 'rsrc/image/people/taft.png' => 'd7bc402c',
'rsrc/image/people/washington.png' => '40dd301c', 'rsrc/image/people/washington.png' => '40dd301c',
'rsrc/image/phortune/balanced.png' => 'f6ba2691',
'rsrc/image/phortune/paypal.png' => '9747cb33',
'rsrc/image/phortune/stripe.png' => 'bfedc2ce',
'rsrc/image/phortune/test.png' => '0235d8a7',
'rsrc/image/phortune/wepay.png' => 'b37163ce',
'rsrc/image/phrequent_active.png' => 'a466a8ed', 'rsrc/image/phrequent_active.png' => 'a466a8ed',
'rsrc/image/phrequent_inactive.png' => 'bfc15a69', 'rsrc/image/phrequent_inactive.png' => 'bfc15a69',
'rsrc/image/search-white.png' => '64cc0d45', 'rsrc/image/search-white.png' => '64cc0d45',
@ -357,7 +363,7 @@ return array(
'rsrc/js/application/countdown/timer.js' => '361e3ed3', 'rsrc/js/application/countdown/timer.js' => '361e3ed3',
'rsrc/js/application/dashboard/behavior-dashboard-async-panel.js' => '469c0d9e', 'rsrc/js/application/dashboard/behavior-dashboard-async-panel.js' => '469c0d9e',
'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => '82439934', 'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => '82439934',
'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '880fa5ac', 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375',
'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63',
'rsrc/js/application/differential/ChangesetViewManager.js' => 'd2907473', 'rsrc/js/application/differential/ChangesetViewManager.js' => 'd2907473',
'rsrc/js/application/differential/DifferentialInlineCommentEditor.js' => 'f2441746', 'rsrc/js/application/differential/DifferentialInlineCommentEditor.js' => 'f2441746',
@ -564,7 +570,7 @@ return array(
'javelin-behavior-dark-console' => '357b6e9b', 'javelin-behavior-dark-console' => '357b6e9b',
'javelin-behavior-dashboard-async-panel' => '469c0d9e', 'javelin-behavior-dashboard-async-panel' => '469c0d9e',
'javelin-behavior-dashboard-move-panels' => '82439934', 'javelin-behavior-dashboard-move-panels' => '82439934',
'javelin-behavior-dashboard-query-panel-select' => '880fa5ac', 'javelin-behavior-dashboard-query-panel-select' => '453c5375',
'javelin-behavior-dashboard-tab-panel' => 'd4eecc63', 'javelin-behavior-dashboard-tab-panel' => 'd4eecc63',
'javelin-behavior-device' => '03d6ed07', 'javelin-behavior-device' => '03d6ed07',
'javelin-behavior-differential-add-reviewers-and-ccs' => 'e10f8e18', 'javelin-behavior-differential-add-reviewers-and-ccs' => 'e10f8e18',
@ -683,7 +689,7 @@ return array(
'javelin-typeahead-normalizer' => 'aa93c7b0', 'javelin-typeahead-normalizer' => 'aa93c7b0',
'javelin-typeahead-ondemand-source' => '8b3fd187', 'javelin-typeahead-ondemand-source' => '8b3fd187',
'javelin-typeahead-preloaded-source' => '54f314a0', 'javelin-typeahead-preloaded-source' => '54f314a0',
'javelin-typeahead-source' => '210aa43b', 'javelin-typeahead-source' => 'fcba4ecc',
'javelin-typeahead-static-source' => '316b8fa1', 'javelin-typeahead-static-source' => '316b8fa1',
'javelin-uri' => '6eff08aa', 'javelin-uri' => '6eff08aa',
'javelin-util' => 'a23de73d', 'javelin-util' => 'a23de73d',
@ -762,6 +768,7 @@ return array(
'pholio-inline-comments-css' => '8e545e49', 'pholio-inline-comments-css' => '8e545e49',
'phortune-credit-card-form' => '2290aeef', 'phortune-credit-card-form' => '2290aeef',
'phortune-credit-card-form-css' => 'b25b4beb', 'phortune-credit-card-form-css' => 'b25b4beb',
'phortune-css' => '012360a6',
'phrequent-css' => 'ffc185ad', 'phrequent-css' => 'ffc185ad',
'phriction-document-css' => '7d7f0071', 'phriction-document-css' => '7d7f0071',
'phui-action-header-view-css' => '83e2cc86', 'phui-action-header-view-css' => '83e2cc86',
@ -997,13 +1004,6 @@ return array(
0 => 'javelin-util', 0 => 'javelin-util',
1 => 'javelin-magical-init', 1 => 'javelin-magical-init',
), ),
'210aa43b' =>
array(
0 => 'javelin-install',
1 => 'javelin-util',
2 => 'javelin-dom',
3 => 'javelin-typeahead-normalizer',
),
'2290aeef' => '2290aeef' =>
array( array(
0 => 'javelin-install', 0 => 'javelin-install',
@ -1180,6 +1180,11 @@ return array(
1 => 'javelin-dom', 1 => 'javelin-dom',
2 => 'phabricator-prefab', 2 => 'phabricator-prefab',
), ),
'453c5375' =>
array(
0 => 'javelin-behavior',
1 => 'javelin-dom',
),
'469c0d9e' => '469c0d9e' =>
array( array(
0 => 'javelin-behavior', 0 => 'javelin-behavior',
@ -1499,11 +1504,6 @@ return array(
array( array(
0 => 'javelin-install', 0 => 'javelin-install',
), ),
'880fa5ac' =>
array(
0 => 'javelin-behavior',
1 => 'javelin-dom',
),
'88236f00' => '88236f00' =>
array( array(
0 => 'javelin-behavior', 0 => 'javelin-behavior',
@ -2132,6 +2132,13 @@ return array(
2 => 'javelin-vector', 2 => 'javelin-vector',
3 => 'javelin-magical-init', 3 => 'javelin-magical-init',
), ),
'fcba4ecc' =>
array(
0 => 'javelin-install',
1 => 'javelin-util',
2 => 'javelin-dom',
3 => 'javelin-typeahead-normalizer',
),
42126667 => 42126667 =>
array( array(
0 => 'javelin-behavior', 0 => 'javelin-behavior',

View file

@ -41,9 +41,6 @@ final class PhabricatorApplicationPhortune extends PhabricatorApplication {
'' => 'PhortuneAccountListController', '' => 'PhortuneAccountListController',
'edit/(?:(?P<id>\d+)/)?' => 'PhortuneAccountEditController', 'edit/(?:(?P<id>\d+)/)?' => 'PhortuneAccountEditController',
), ),
'stripe/' => array(
'testpaymentform/' => 'PhortuneStripeTestPaymentFormController',
),
'product/' => array( 'product/' => array(
'' => 'PhortuneProductListController', '' => 'PhortuneProductListController',
'view/(?P<id>\d+)/' => 'PhortuneProductViewController', 'view/(?P<id>\d+)/' => 'PhortuneProductViewController',

View file

@ -82,11 +82,17 @@ final class PhortuneAccountBuyController
pht('Qty.'), pht('Qty.'),
pht('Total'), pht('Total'),
)); ));
$table->setColumnClasses(
array(
'wide',
'right',
'right',
'right',
));
$panel = new AphrontPanelView(); $cart_box = id(new PHUIObjectBoxView())
$panel->setNoBackground(true); ->setHeaderText(pht('Your Cart'))
$panel->appendChild($table); ->appendChild($table);
$title = pht('Buy Stuff'); $title = pht('Buy Stuff');
@ -167,12 +173,19 @@ final class PhortuneAccountBuyController
->setValue($one_time_options)); ->setValue($one_time_options));
} }
$payment_box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Choose Payment Method'))
->appendChild($form)
->appendChild($provider_form);
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($title);
return $this->buildApplicationPage( return $this->buildApplicationPage(
array( array(
$panel, $crumbs,
$form, $cart_box,
phutil_tag('br', array()), $payment_box,
$provider_form,
), ),
array( array(
'title' => $title, 'title' => $title,

View file

@ -79,20 +79,16 @@ final class PhortuneAccountViewController extends PhortuneController {
$request = $this->getRequest(); $request = $this->getRequest();
$user = $request->getUser(); $user = $request->getUser();
$header = id(new PHUIHeaderView())
->setHeader(pht('Payment Methods'));
$id = $account->getID(); $id = $account->getID();
$add_uri = $this->getApplicationURI($id.'/paymentmethod/edit/');
$actions = id(new PhabricatorActionListView()) $header = id(new PHUIHeaderView())
->setUser($user) ->setHeader(pht('Payment Methods'))
->setObjectURI($request->getRequestURI()) ->addActionLink(
->addAction( id(new PHUIButtonView())
id(new PhabricatorActionView()) ->setTag('a')
->setName(pht('Add Payment Method')) ->setHref($this->getApplicationURI($id.'/paymentmethod/edit/'))
->setIcon('fa-plus') ->setText(pht('Add Payment Method'))
->setHref($add_uri)); ->setIcon(id(new PHUIIconView())->setIconFont('fa-plus')));
$list = id(new PHUIObjectItemListView()) $list = id(new PHUIObjectItemListView())
->setUser($user) ->setUser($user)
@ -129,11 +125,9 @@ final class PhortuneAccountViewController extends PhortuneController {
$list->addItem($item); $list->addItem($item);
} }
return array( return id(new PHUIObjectBoxView())
$header, ->setHeader($header)
$actions, ->appendChild($list);
$list,
);
} }
private function buildPurchaseHistorySection(PhortuneAccount $account) { private function buildPurchaseHistorySection(PhortuneAccount $account) {
@ -143,10 +137,8 @@ final class PhortuneAccountViewController extends PhortuneController {
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setHeader(pht('Purchase History')); ->setHeader(pht('Purchase History'));
return array( return id(new PHUIObjectBoxView())
$header, ->setHeader($header);
);
} }
private function buildAccountHistorySection(PhortuneAccount $account) { private function buildAccountHistorySection(PhortuneAccount $account) {
@ -170,8 +162,11 @@ final class PhortuneAccountViewController extends PhortuneController {
->setTransactions($xactions) ->setTransactions($xactions)
->setMarkupEngine($engine); ->setMarkupEngine($engine);
$box = id(new PHUIObjectBoxView())
->setHeader($header);
return array( return array(
$header, $box,
$xaction_view, $xaction_view,
); );
} }

View file

@ -37,7 +37,20 @@ final class PhortunePaymentMethodEditController
foreach ($providers as $provider) { foreach ($providers as $provider) {
$choices[] = $this->renderSelectProvider($provider); $choices[] = $this->renderSelectProvider($provider);
} }
return $this->buildResponse($choices, $account_uri);
$content = phutil_tag(
'div',
array(
'class' => 'phortune-payment-method-list',
),
$choices);
return $this->newDialog()
->setRenderDialogAsDiv(true)
->setTitle(pht('Add Payment Method'))
->appendParagraph(pht('Choose a payment method to add:'))
->appendChild($content)
->addCancelButton($account_uri);
} }
$provider = $providers[$provider_key]; $provider = $providers[$provider_key];
@ -111,14 +124,21 @@ final class PhortunePaymentMethodEditController
->setValue(pht('Add Payment Method')) ->setValue(pht('Add Payment Method'))
->addCancelButton($account_uri)); ->addCancelButton($account_uri));
if ($errors) { $box = id(new PHUIObjectBoxView())
$errors = id(new AphrontErrorView()) ->setHeaderText($provider->getPaymentMethodDescription())
->setErrors($errors); ->setForm($form);
}
return $this->buildResponse( $crumbs = $this->buildApplicationCrumbs();
array($errors, $form), $crumbs->addTextCrumb(pht('Add Payment Method'));
$account_uri);
return $this->buildApplicationPage(
array(
$crumbs,
$box,
),
array(
'title' => $provider->getPaymentMethodDescription(),
));
} }
private function renderSelectProvider( private function renderSelectProvider(
@ -128,20 +148,21 @@ final class PhortunePaymentMethodEditController
$user = $request->getUser(); $user = $request->getUser();
$description = $provider->getPaymentMethodDescription(); $description = $provider->getPaymentMethodDescription();
$icon = $provider->getPaymentMethodIcon(); $icon_uri = $provider->getPaymentMethodIcon();
$details = $provider->getPaymentMethodProviderDescription(); $details = $provider->getPaymentMethodProviderDescription();
$button = phutil_tag( $this->requireResource('phortune-css');
'button',
array( $icon = id(new PHUIIconView())
'class' => 'grey', ->setImage($icon_uri)
), ->addClass('phortune-payment-icon');
array(
$description, $button = id(new PHUIButtonView())
phutil_tag('br'), ->setSize(PHUIButtonView::BIG)
$icon, ->setColor(PHUIButtonView::GREY)
$details, ->setIcon($icon)
)); ->setText($description)
->setSubtext($details);
$form = id(new AphrontFormView()) $form = id(new AphrontFormView())
->setUser($user) ->setUser($user)
@ -151,28 +172,6 @@ final class PhortunePaymentMethodEditController
return $form; return $form;
} }
private function buildResponse($content, $account_uri) {
$request = $this->getRequest();
$title = pht('Add Payment Method');
$header = id(new PHUIHeaderView())
->setHeader($title);
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Account'), $account_uri);
$crumbs->addTextCrumb(pht('Payment Methods'), $request->getRequestURI());
return $this->buildApplicationPage(
array(
$crumbs,
$header,
$content,
),
array(
'title' => $title,
));
}
private function processClientErrors( private function processClientErrors(
PhortunePaymentProvider $provider, PhortunePaymentProvider $provider,
$client_errors_raw) { $client_errors_raw) {

View file

@ -24,9 +24,6 @@ final class PhortuneProductListController extends PhabricatorController {
->setHref($this->getApplicationURI('product/edit/')) ->setHref($this->getApplicationURI('product/edit/'))
->setIcon('fa-plus-square')); ->setIcon('fa-plus-square'));
$header = id(new PHUIHeaderView())
->setHeader(pht('Product List'));
$product_list = id(new PHUIObjectItemListView()) $product_list = id(new PHUIObjectItemListView())
->setUser($user) ->setUser($user)
->setNoDataString(pht('No products.')); ->setNoDataString(pht('No products.'));
@ -51,7 +48,6 @@ final class PhortuneProductListController extends PhabricatorController {
return $this->buildApplicationPage( return $this->buildApplicationPage(
array( array(
$crumbs, $crumbs,
$header,
$product_list, $product_list,
$pager, $pager,
), ),

View file

@ -0,0 +1,17 @@
/**
* @provides phortune-css
*/
.phortune-payment-icon {
width: 34px;
height: 34px;
}
.phortune-payment-method-list {
margin: 8px 24px 0;
}
.phortune-payment-method-list button {
margin: 4px 0;
width: 100%;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB