pyc-website
main website for pyc inc.
git clone https://9o.is/git/pyc-website.git
commit 72b620c6e3c46f4754e5792ca5e9b72a92721929 parent 51c0862b53ea5a65098f83e2ab3495fed91eb392 Author: Jul <jul@9o.is> Date: Fri, 4 Jul 2014 20:37:45 -0400 completed wizard (no actual 3rdparty verification) Diffstat:
| M | src/main/scala/inc/pyc/snippet/UserSnip.scala | | | 29 | +++++++++++++++++++++++++++++ |
| M | src/main/webapp/app/App.js | | | 8 | ++++++++ |
| M | src/main/webapp/less/custom.less | | | 14 | +++++++++++++- |
| M | src/main/webapp/less/pages/purchase_limit.less | | | 14 | +------------- |
| M | src/main/webapp/settings/purchase_limit.html | | | 33 | ++++++++++++++++++++------------- |
| M | src/main/webapp/vendor/angular-wizard.js | | | 2 | +- |
6 files changed, 72 insertions(+), 28 deletions(-)
diff --git a/src/main/scala/inc/pyc/snippet/UserSnip.scala b/src/main/scala/inc/pyc/snippet/UserSnip.scala @@ -29,6 +29,13 @@ sealed trait UserSnippet extends SnippetHelper with Logger { } yield { snip(u) }): NodeSeq + + protected def serve(snip: User => CssSel): CssSel = + (for { + u <- user ?~ "User not found" + } yield { + snip(u) + }): CssSel def username(in: NodeSeq): NodeSeq = serve { user => Text(user.username.get) @@ -39,6 +46,10 @@ sealed trait UserSnippet extends SnippetHelper with Logger { if (name.length > 1) Text(name) else Text(user.username.get) } + + def limit(in: NodeSeq): NodeSeq = serve { + user => Text(user.purchaseLimit.get.toString) + } } /** @@ -310,6 +321,24 @@ class UserSettingsEmail extends AngularCurrentUser { } + +class VerificationSteps extends CurrentUser { + def render = serve { + user: User => + import USAPurchaseLimit._ + val limit = user.purchaseLimit.get + + val step = + if(limit == Unlimited || limit == Unlimited_Pending || limit == D3000) "Unlimited" + else if(limit == D3000_Pending || limit == D1000) "$3,000" + else if(limit == D500 && !user.postal.get.isEmpty) "$1,000" + else "$500" + + "wizard [current-step]" #> s"'$step'" + } +} + + class PhoneVerification extends AngularCurrentUser { lazy val smscode = (100000 + new scala.util.Random().nextInt(900000)).toString diff --git a/src/main/webapp/app/App.js b/src/main/webapp/app/App.js @@ -185,6 +185,14 @@ app.controller('PasswordChangeCtrl', ['$scope', '$controller', '$rootScope', fun }]); +app.controller('PurchaseLimitCtrl', ['$scope', '$controller', function($scope, $controller) { + $controller('LoadedFormCtrl', {$scope: $scope}); + //$scope.init('PurchaseLimitCtrl', 'init'); + + $scope.thirdPartyVerified = false; +}]); + + app.controller('PhoneVerificationAlert', ['$scope', '$controller', function($scope, $controller) { $controller('AlertCtrl', {$scope: $scope}); diff --git a/src/main/webapp/less/custom.less b/src/main/webapp/less/custom.less @@ -84,7 +84,11 @@ } .bg-primary { - background-color: @brand-primary; + background-color: @brand-primary !important; +} + +.bg-primary-light { + background-color: @brand-primary-light !important; } .bg-primary-gradient { @@ -137,6 +141,10 @@ text-align: center; } +.padding-bottom-0 { + padding-bottom: 0; +} + .padding-top-20 { padding-top: 20px; } @@ -154,6 +162,10 @@ padding-right: 20px; } +.margin-20 { + margin: 20px !important; +} + .margin-10 { margin: 10px !important; } diff --git a/src/main/webapp/less/pages/purchase_limit.less b/src/main/webapp/less/pages/purchase_limit.less @@ -1,17 +1,5 @@ #wizard-purchase-limit { - - .steps-indicator { - bottom: auto; // remove from bottom - padding-top: 25px; - } - > .steps { - padding-top: 50px; - - > .step { - > .main-message { - text-align: center; - } - } + margin-bottom: 50px; } } \ No newline at end of file diff --git a/src/main/webapp/settings/purchase_limit.html b/src/main/webapp/settings/purchase_limit.html @@ -1,23 +1,26 @@ <div data-lift="surround?with=settings-wrap&at=content"> - <div class="row margin-top-10"> + +<div class="row"> + <div class="col-xs-12"> + <div class="jumbotron text-center padding-bottom-0"> + <div class="well well-lg bg-primary-light text-primary"> + <h1>Limit is <span data-lift="CurrentUser.limit"></span></h1> + </div> + </div> + </div> + <div data-lift="VerificationSteps" class="col-xs-12" ng-controller="PurchaseLimitCtrl"> <wizard id="wizard-purchase-limit" on-finish="finishedWizard()" ng-cloak> <wz-step title="$500"> - <div class="main-message"> - <div class="jumbotron"> - <h1>As a regular user, your limit is $500</h1> - - <div class="padding-20"> + <div class="jumbotron text-center"> <button type="submit" wz-next class="btn btn-primary btn-lg"> Verify To Raise The Limit </button> - </div> </div> - </div> </wz-step> <wz-step title="$1,000"> - <div class="main-message padding-20"> + <div class="text-center padding-20"> <h1>$1,000: Verify Zip Code and Phone Number</h1> </div> @@ -30,7 +33,7 @@ </wz-step> <wz-step title="$3,000"> - <div class="main-message padding-10"> + <div class="text-center padding-10"> <h1>$3,000: Verify Identity</h1> </div> @@ -43,13 +46,17 @@ </wz-step> <wz-step title="Unlimited"> - <div class="main-message"> + <div class="jumbotron text-center"> + <p>For Unlimited Spending, you must complete at least 1 purchase of $100 minimum.</p> + <button type="submit" wz-next class="btn btn-primary btn-lg margin-20" ng-disabled="!thirdPartyVerified" disabler ng-model="loading"> + 3rd Party Verify + </button> </div> - <p>Even more steps!!</p> - <input type="submit" wz-next value="Finish now" /> </wz-step> </wizard> </div> +</div> + </div> \ No newline at end of file diff --git a/src/main/webapp/vendor/angular-wizard.js b/src/main/webapp/vendor/angular-wizard.js @@ -15,12 +15,12 @@ angular.module("step.html", []).run(["$templateCache", function($templateCache) angular.module("wizard.html", []).run(["$templateCache", function($templateCache) { $templateCache.put("wizard.html", "<div>\n" + + " <div class=\"steps\" ng-transclude></div>\n" + " <ul class=\"steps-indicator steps-{{steps.length}}\" ng-if=\"!hideIndicators\">\n" + " <li ng-class=\"{default: !step.completed && !step.selected, current: step.selected && !step.completed, done: step.completed && !step.selected, editing: step.selected && step.completed}\" ng-repeat=\"step in steps\">\n" + " <a ng-click=\"goTo(step)\">{{step.title || step.wzTitle}}</a>\n" + " </li>\n" + " </ul>\n" + - " <div class=\"steps\" ng-transclude></div>\n" + "</div>\n" + ""); }]);