pyc-website
main website for pyc inc.
git clone https://9o.is/git/pyc-website.git
commit 61483d9269d217a2a7f24491f8694dc3a0fa6207 parent 35b2709b7b203e4140b65187037c422e5e152ff5 Author: Jul <jul@9o.is> Date: Wed, 11 Jun 2014 00:22:31 -0400 moved uirouter to separate branch to create a stable release Diffstat:
22 files changed, 52 insertions(+), 69 deletions(-)
diff --git a/project/Build.scala b/project/Build.scala @@ -18,8 +18,7 @@ object LiftProjectBuild extends Build { "ch.qos.logback" % "logback-classic" % "1.0.13" % "compile", "org.scalatest" %% "scalatest" % "1.9.2" % "test", "com.foursquare" %% "rogue-lift_3.0" % "2.3.0-SNAPSHOT", - "inc.pyc" %% "aws-s3" % "0.1", - "net.liftmodules" %% ("uirouter_"+Ver.lift_edition) % "0.1-SNAPSHOT" + "inc.pyc" %% "aws-s3" % "0.1" ) ) } diff --git a/src/main/scala/bootstrap/liftweb/Boot.scala b/src/main/scala/bootstrap/liftweb/Boot.scala @@ -15,7 +15,6 @@ import inc.pyc.model.{SystemUser, User} import net.liftmodules.extras.{Gravatar, LiftExtras} import net.liftmodules.mongoauth.MongoAuth -import net.liftmodules.uirouter._ /** * A class that's instantiated early and run. It allows the application @@ -70,10 +69,6 @@ class Boot extends Loggable { // don't include the liftAjax.js code. It's served statically. LiftRules.autoIncludeAjaxCalc.default.set(() => (session: LiftSession) => false) - - // Initialize required settings for UiRouter - UiRouter.init - UiRouter.pageTitle.default.set(setTitle(pageName => "'PYC: ' + " + pageName)) // Mailer Mailer.devModeSend.default.set((m: MimeMessage) => logger.info("Dev mode message:\n" + prettyPrintMime(m))) diff --git a/src/main/scala/inc/pyc/snippet/Sitemap.scala b/src/main/scala/inc/pyc/snippet/Sitemap.scala @@ -9,7 +9,6 @@ import util._ import Helpers._ import common._ -import net.liftmodules.uirouter.UiRouter._ import org.joda.time.DateTime object Sitemap extends RestHelper { @@ -17,7 +16,7 @@ object Sitemap extends RestHelper { case Req("sitemap" :: Nil, _, GetRequest) => XmlResponse( S.render(<lift:embed what="sitemap" />, - S.request.map(_.request).get).head) + S.request.openOrThrowException("No Request").request).head) } } @@ -25,10 +24,7 @@ class SitemapContent { case class Post(url: String, date: DateTime) - lazy val baseEntry = - defaultRoute.vend map { - _.loc.calcDefaultHref - } openOr "" + lazy val baseEntry = Site.home.url lazy val entries = LiftRules.siteMap map { @@ -36,12 +32,12 @@ class SitemapContent { } openOr Nil def base: CssSel = - "loc *" #> "https://%s%s".format(Site.domain, baseEntry) & + "loc *" #> "https://www.%s%s".format(Site.domain, baseEntry) & "lastmod *" #> (new DateTime).toString("yyyy-MM-dd'T'HH:mm:ss.SSSZZ") def list: CssSel = "url *" #> entries.map(post => - "loc *" #> "https://%s%s".format(Site.domain, post.url) & + "loc *" #> "https://www.%s%s".format(Site.domain, post.url) & "lastmod *" #> post.date.toString("yyyy-MM-dd'T'HH:mm:ss.SSSZZ")) } diff --git a/src/main/scala/inc/pyc/snippet/UtilSnips.scala b/src/main/scala/inc/pyc/snippet/UtilSnips.scala @@ -5,23 +5,36 @@ import model.field._ import xml._ import net.liftweb._ import common._ +import http._ import util._ +import js._ +import JE._ +import JsCmds._ import Helpers._ import json.JsonAST._ import net.liftmodules._ import extras._, snippet._ -import uirouter.snippet._ object Assets extends AssetLoader -trait AngularSnippet extends UiRoundTrip { +trait AngularSnippet { implicit def boxedJValueToJValue(in: Box[JValue]): JValue = in openOr JNull implicit def listJValueToJValue(in: List[JValue]): JValue = in.headOption.getOrElse(JNull) + + def roundTrips: List[RoundTripInfo] + + def render(in: NodeSeq): NodeSeq = { + for (sess <- S.session) yield { + val roundtrips = sess.buildRoundtrip(roundTrips) + val className: String = this.getClass.getName.split("""\.""").last + val script = SetExp(JsVar("window", className), roundtrips) + S.appendGlobalJs(script) + } + in + } } -object NgUIRouter extends UiRouter - -object Menus extends UiMenu +object Menus extends BsMenu object ProductionOnly { def render(in: NodeSeq): NodeSeq = diff --git a/src/main/webapp/404.html b/src/main/webapp/404.html @@ -1,3 +1,3 @@ -<div data-lift="NgUIRouter.surround?withAjax=no-base-default&with=base-default&at=content"> +<div data-lift="surround?with=base-default&at=content"> <p style="font-size: 1.2em;">We're sorry but the page you are trying to access does not exist.</p> </div> diff --git a/src/main/webapp/about.html b/src/main/webapp/about.html @@ -1,4 +1,4 @@ -<div data-lift="NgUIRouter.surround?withAjax=no-base-default&with=base-default&at=content"> +<div data-lift="surround?with=base-default&at=content"> <div class="row margin-top-10"> <div class="col-xs-12 multi-column"> diff --git a/src/main/webapp/app/App.js b/src/main/webapp/app/App.js @@ -7,25 +7,6 @@ var ZIP_CODE_REGEXP = /^(\d{5}(-\d{4})?|[A-Z]\d[A-Z] *\d[A-Z]\d)$/; var PASSWORD_REGEXP = /^(?=.*[^a-zA-Z])\S{8,}$/; var UNSAFE_URL_REGEXP = /[-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?/; -app.run(["$rootScope", "$window", "$state", "$stateParams", function ($rootScope, $window, $state, $stateParams) { - $rootScope.$on('$locationChangeStart', function(event, newUrl){ - if(newUrl.match(/(http(s)?:\/\/.*\/blog)/)) { - event.preventDefault(); - $window.location.href = 'http://blog.pycbitcoin.com/'; - } - - if(newUrl.match(/(http(s)?:\/\/.*\/logout)/)) { - event.preventDefault(); - $window.location.href = '/logout'; - } - - $rootScope.$broadcast('alertClear'); - }); - - $rootScope.$state = $state; - $rootScope.$stateParams = $stateParams; -}]); - app.controller('NearAtmNotifyCtrl', ['$scope', '$controller', '$rootScope', function($scope, $controller, $rootScope) { $controller('FormCtrl', {$scope: $scope}); @@ -123,7 +104,7 @@ app.controller('FindAtmCtrl', ['$scope', '$state', '$rootScope', '$controller', $scope.search = function() { var success = function() { - $state.go('ATM_Locations'); + window.location.href = "/locations"; $scope.reset(); }; @@ -212,7 +193,7 @@ app.controller('IdVerificationCtrl', ['$scope', '$controller', '$rootScope', '$f $scope.thirdPartyVerify = function() { var success = function(alert) { $rootScope.$broadcast('alertDialog', alert); - $state.go($state.$current, null, { reload: true }); + document.location.reload(); }; var failure = function(alert) { diff --git a/src/main/webapp/error.html b/src/main/webapp/error.html @@ -1,4 +1,4 @@ -<div data-lift="NgUIRouter.surround?withAjax=no-base-default&with=base-default&at=content"> +<div data-lift="surround?with=base-default&at=content"> <p style="font-size: 1.2em;">We're sorry but an error has occurred. Our staff has been notified and is working on a solution.</p> </div> diff --git a/src/main/webapp/faqs.html b/src/main/webapp/faqs.html @@ -1,4 +1,4 @@ -<div data-lift="NgUIRouter.surround?withAjax=no-base-default&with=base-default&at=content"> +<div data-lift="surround?with=base-default&at=content"> <div id="faqs" class="row"> <div class="col-xs-12 col-sm-8 margin-bottom-10"> @@ -20,7 +20,7 @@ We're rolling out our first machine at Hellas Bakery, Albany, NY in June 27. ATMs may soon be available in the state of New Jersey. If you’re located in another state but would like to be the next customer to benefit from our service, - <a data-lift="Menus.item?name=ATM Locations">fill out this form so we can know you’re interested</a>. + <a href="/locations">fill out this form so we can know you’re interested</a>. </p> </li> @@ -43,14 +43,14 @@ At the moment, the maximum amount of money that can be taken out per transaction is 500 USD. If you would like to transfer more money, you will have to - <a data-lift="Menus.item?name=Register">sign up and verify your identity</a>. + <a href="/register">sign up and verify your identity</a>. </p> </li> <li class="padding-top-10"> <h3 class="bold">How do I use the ATM?</h3> <p> - <a data-lift="Menus.item?name=How To Use ATM">Follow our tutorial</a> so we can help you + <a href="/how-to-use-atm">Follow our tutorial</a> so we can help you find an ATM, set up a wallet, instantly retrieve your bitcoin and find local merchants. </p> @@ -59,7 +59,7 @@ <li class="padding-top-10"> <h3 class="bold">What is Bitcoin?</h3> <p> - <a data-lift="Menus.item?name=What Is Bitcoin">Discover Bitcoin’s purpose and usability</a> + <a href="/what-is-bitcoin">Discover Bitcoin’s purpose and usability</a> in our easy to follow tutorial. </p> </li> diff --git a/src/main/webapp/forgot-password.html b/src/main/webapp/forgot-password.html @@ -1,4 +1,4 @@ -<div data-lift="NgUIRouter.surround?withAjax=no-base-default&with=base-default&at=content"> +<div data-lift="surround?with=base-default&at=content"> <div class="row margin-top-10"> <div class="col-xs-12 col-sm-8 col-md-6 col-sm-offset-2 col-md-offset-0"> <div class="well"> diff --git a/src/main/webapp/how-to-use-atm.html b/src/main/webapp/how-to-use-atm.html @@ -1,3 +1,3 @@ -<div data-lift="NgUIRouter.surround?withAjax=no-base-default&with=base-default&at=content"> +<div data-lift="surround?with=base-default&at=content"> <h1>coming soon</h1> </div> \ No newline at end of file diff --git a/src/main/webapp/index.html b/src/main/webapp/index.html @@ -1,4 +1,4 @@ -<div data-lift="NgUIRouter.surround?withAjax=no-base&with=base-wrap&at=content"> +<div data-lift="surround?with=base-wrap&at=content"> <div id="content-index" class="row no-gutter"> <div class="col-xs-12 semi-content-index"> @@ -12,7 +12,7 @@ that are safe and secure, easy to use and user-friendly. Sign up now! </p> <p data-lift="test_cond.loggedOut"> - <a data-lift="Menus.item?name=Register" + <a href="/register" class="btn btn-primary btn-lg" role="button"> Free Sign Up Today </a> </p> @@ -122,7 +122,7 @@ </div> <div data-lift="ignore" class="col-xs-8 col-sm-6 col-md-12 padding-bottom-20"> - <a data-lift="Menus.item?name=What Is Bitcoin" type="button" class="btn btn-default btn-lg btn-block"> + <a data-lift="Menu.item?name=What Is Bitcoin" type="button" class="btn btn-default btn-lg btn-block"> <small>Click Here to </small><strong>Understand</strong><br> <img src="https://s3.amazonaws.com/assets-pyc/bitcoin_logo.png" alt="Click Here to Learn More About Bitcoin" style="width:100%"></img> </a> diff --git a/src/main/webapp/locations.html b/src/main/webapp/locations.html @@ -1,4 +1,4 @@ -<div data-lift="NgUIRouter.surround?withAjax=no-base&with=base-wrap&at=content"> +<div data-lift="surround?with=base-wrap&at=content"> <div id="atm-locations"> <div class="layer-info"> diff --git a/src/main/webapp/login.html b/src/main/webapp/login.html @@ -1,4 +1,4 @@ -<div data-lift="NgUIRouter.surround?withAjax=no-base-default&with=base-default&at=content"> +<div data-lift="surround?with=base-default&at=content"> <div class="row margin-top-10"> <div class="col-xs-12 col-sm-8 col-md-6 col-sm-offset-2 col-md-offset-0"> <div class="well"> @@ -8,7 +8,7 @@ <div class="col-xs-12 col-sm-8 col-md-6 col-sm-offset-2 col-md-offset-0"> <p class="lead"> Welcome Back Bitcoin User! Remember, if you have any questions, be sure to check - our <a data-lift="Menus.item?name=FAQs">frequently asked questions</a> and contact us if you need any other help. + our <a href="/faqs">frequently asked questions</a> and contact us if you need any other help. </p> <p class="lead">Thank you for using our Bitcoin services.</p> </div> diff --git a/src/main/webapp/register.html b/src/main/webapp/register.html @@ -1,4 +1,4 @@ -<div data-lift="NgUIRouter.surround?withAjax=no-base-default&with=base-default&at=content"> +<div data-lift="surround?with=base-default&at=content"> <div class="row margin-top-10"> <div class="col-xs-12 col-sm-8 col-md-6 col-sm-offset-2 col-md-offset-0"> <div class="well"> diff --git a/src/main/webapp/settings.html b/src/main/webapp/settings.html @@ -1,4 +1,4 @@ -<div data-lift="NgUIRouter.surround?withAjax=no-base-settings-wrap&with=settings-wrap&at=content"> +<div data-lift="surround?with=settings-wrap&at=content"> <div class="padding-20"> <div class="row"> <div class="col-xs-12 col-sm-6"> diff --git a/src/main/webapp/settings/password.html b/src/main/webapp/settings/password.html @@ -1,4 +1,4 @@ -<div data-lift="NgUIRouter.surround?withAjax=no-base-settings-wrap&with=settings-wrap&at=content"> +<div data-lift="surround?with=settings-wrap&at=content"> <div class="row margin-top-10"> <div class="col-xs-12 col-sm-8 col-md-6 col-sm-offset-2 col-md-offset-0"> <div class="well"> diff --git a/src/main/webapp/settings/verification.html b/src/main/webapp/settings/verification.html @@ -1,4 +1,4 @@ -<div data-lift="NgUIRouter.surround?withAjax=no-base-settings-wrap&with=settings-wrap&at=content"> +<div data-lift="surround?with=settings-wrap&at=content"> <div class="row margin-top-10"> <div class="col-xs-12 col-sm-8 col-md-6 col-sm-offset-2 col-md-offset-0"> <span data-lift="embed?what=/templates-hidden/parts/id-verification-form"></span> diff --git a/src/main/webapp/settings/verified.html b/src/main/webapp/settings/verified.html @@ -1,4 +1,4 @@ -<div data-lift="NgUIRouter.surround?withAjax=no-base-settings-wrap&with=settings-wrap&at=content"> +<div data-lift="surround?with=settings-wrap&at=content"> <div class="row margin-top-10"> <div class="col-xs-12 col-sm-8 col-md-6 col-sm-offset-2 col-md-offset-0"> <div data-lift="IdVerification" ng-controller="IdVerificationCtrl" ng-cloak> diff --git a/src/main/webapp/templates-hidden/base-wrap.html b/src/main/webapp/templates-hidden/base-wrap.html @@ -33,7 +33,7 @@ <span class="icon-bar"></span> <span class="icon-bar"></span> </button> - <a class="navbar-brand" data-lift="Menus.item?name=Bitcoin ATM Services"><img src="https://s3.amazonaws.com/assets-pyc/logo.png" alt="Go Back to Home Page"></a> + <a class="navbar-brand" href="/"><img src="https://s3.amazonaws.com/assets-pyc/logo.png" alt="Go Back to Home Page"></a> </div> <div collapse="navCollapsed" class="collapse navbar-collapse navbar-responsive-collapse"> <div class="row top-row"> @@ -44,8 +44,8 @@ <div class="row bottom-row"> <div class="col-xs-12"> <span data-lift="test_cond.loggedOut"> - <a data-lift="Menus.item?name=Login" class="btn btn-default btn-sm btn-topbar pull-right">Log In</a> - <a data-lift="Menus.item?name=Register" class="btn btn-primary btn-topbar btn-sm text-white pull-right">Sign Up</a> + <a href="/login" class="btn btn-default btn-sm btn-topbar pull-right">Log In</a> + <a href="/register" class="btn btn-primary btn-topbar btn-sm text-white pull-right">Sign Up</a> </span> <ul data-lift="test_cond.loggedIn" class="nav navbar-nav navbar-right"> <li class="dropdown" on-toggle="toggled(open)"> @@ -54,7 +54,7 @@ </button> <ul class="dropdown-menu" role="menu"> <li> - <a data-lift="Menus.item?name=Settings" href="#">Settings</a> + <a href="/settings">Settings</a> </li> <li class="divider"></li> <li> @@ -80,6 +80,5 @@ <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.0.min.js"></script> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAehyKUHOOWL_plRJCW8R1EdCIKCfR9jkg&sensor=true"></script> <script data-lift="Assets.js" type="text/javascript"></script> -<script data-lift="NgUIRouter.js?ngApp=app" type="text/javascript"></script> </body> </html> diff --git a/src/main/webapp/templates-hidden/parts/user-login-form.html b/src/main/webapp/templates-hidden/parts/user-login-form.html @@ -16,7 +16,7 @@ <input name="password" ng-model="model.password" type="password" required> </label> <div class="note"> - <a data-lift="Menus.item?name=Forgot Password">Forgot Password?</a> + <a href="forgot-password">Forgot Password?</a> </div> </section> diff --git a/src/main/webapp/what-is-bitcoin.html b/src/main/webapp/what-is-bitcoin.html @@ -1,3 +1,3 @@ -<div data-lift="NgUIRouter.surround?withAjax=no-base-default&with=base-default&at=content"> +<div data-lift="surround?with=base-default&at=content"> <h1>coming soon</h1> </div> \ No newline at end of file