diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-08-15 13:50:35 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-08-15 13:50:35 +0200 |
| commit | 189eccc46edd09e78c9683580ccf078c28d5b34e (patch) | |
| tree | 65d97d909384b1501993fd73b6b4d389f02001a4 /StoneIsland/platforms/ios/www | |
| parent | 590a9772063bd0774c6ad4c099447472294deecd (diff) | |
consent modal stuff
Diffstat (limited to 'StoneIsland/platforms/ios/www')
| -rwxr-xr-x | StoneIsland/platforms/ios/www/css/nav.css | 9 | ||||
| -rwxr-xr-x | StoneIsland/platforms/ios/www/index.html | 4 | ||||
| -rwxr-xr-x | StoneIsland/platforms/ios/www/js/lib/_router.js | 23 | ||||
| -rw-r--r-- | StoneIsland/platforms/ios/www/js/lib/account/ConsentModal.js | 13 | ||||
| -rwxr-xr-x | StoneIsland/platforms/ios/www/js/lib/auth/LogoutView.js | 2 |
5 files changed, 38 insertions, 13 deletions
diff --git a/StoneIsland/platforms/ios/www/css/nav.css b/StoneIsland/platforms/ios/www/css/nav.css index 77bc5487..b7002f20 100755 --- a/StoneIsland/platforms/ios/www/css/nav.css +++ b/StoneIsland/platforms/ios/www/css/nav.css @@ -368,7 +368,14 @@ padding-bottom:0px; color: white; border-color: black; } - +#consent_error { + opacity: 0; + color: red; + transition: 0.3s all; +} +#consent_error.visible { + opacity: 1; +} /* SELECTOR */ #selector { diff --git a/StoneIsland/platforms/ios/www/index.html b/StoneIsland/platforms/ios/www/index.html index e8816830..bdad67c8 100755 --- a/StoneIsland/platforms/ios/www/index.html +++ b/StoneIsland/platforms/ios/www/index.html @@ -1027,14 +1027,14 @@ </label> </div> </div> - <div id="consent_error">Please note that if you do not consent to terms, you cannot use the app.</div> - <br><br> For more information, please consult our <a href="#/page/privacy">Privacy Policy</a> or visit <a href="#" id="care-link">Customer Care</a>. <br><br> To continue to My Account we invite you to click accept. Otherwise you can continue to navigate as an unregistered user. <br><br> + <div id="consent_error">Please note that if you do not consent to terms, you cannot use the app.</div> + <br><br> <button id="consent_proceed">PROCEED</button> <button id="consent_logout">LOG OUT</button> </div> diff --git a/StoneIsland/platforms/ios/www/js/lib/_router.js b/StoneIsland/platforms/ios/www/js/lib/_router.js index bd13c126..91f29b55 100755 --- a/StoneIsland/platforms/ios/www/js/lib/_router.js +++ b/StoneIsland/platforms/ios/www/js/lib/_router.js @@ -39,7 +39,9 @@ var SiteRouter = Router.extend({ '/cart/thanks': 'cart.thanks', '/cart/error': 'cart.error', }, - + + terms_routes: ['terms','account_terms','privacy','returns','care','logout'], + initialize: function(){ var fn for (var route in this.routes) { @@ -75,9 +77,7 @@ var SiteRouter = Router.extend({ default_view: function(name){ var fn = function(){ console.log(name) - if (app.demand_consent && app.consent.check()) { - return - } + var n = [name] if (app.view != app.login && app.view != app.signin) { app.last_view = app.view } @@ -85,7 +85,7 @@ var SiteRouter = Router.extend({ app.view.hide() } if (name.match(/\./)) { - var n = name.split(".") + n = name.split(".") console.log(name, n) app.view = app[n[0]][n[1]] } @@ -97,6 +97,19 @@ var SiteRouter = Router.extend({ console.log("view >>", app.view) app.header.set_back( !! app.view.back ) app.view.show() + + // var isTermsRoute = this.terms_routes.indexOf(name) !== -1 + // var isCartRoute = n[0] === 'cart' + // if ( (isCartRoute || app.demand_consent && !isTermsRoute) && app.account.consent.check()) { + // console.log('showed consent modal') + // return + // } + + var isTermsRoute = this.terms_routes.indexOf(name) !== -1 + if (app.demand_consent && !isTermsRoute && app.account.consent.check()) { + console.log('showed consent modal') + return + } }.bind(this) return fn }, diff --git a/StoneIsland/platforms/ios/www/js/lib/account/ConsentModal.js b/StoneIsland/platforms/ios/www/js/lib/account/ConsentModal.js index 22f63c53..dfeb4fac 100644 --- a/StoneIsland/platforms/ios/www/js/lib/account/ConsentModal.js +++ b/StoneIsland/platforms/ios/www/js/lib/account/ConsentModal.js @@ -13,11 +13,13 @@ var ConsentModal = View.extend({ this.$form = this.$(".form") this.$msg = this.$(".msg") this.$checkbox = this.$("[name=AccountTermsConsent]") + this.$consentError = this.$("#consent_error") }, check: function(){ var status = localStorage.getItem('account_terms.consent') if (status !== 'true') { + app.demand_consent = true this.show() return true } else { @@ -55,16 +57,17 @@ var ConsentModal = View.extend({ changeConsent: function(){ var state = this.$checkbox.prop("checked") - // if (state) { - // this.$el.addClass('consent-yes').removeClass('consent-no') - // } else { - // this.$el.addClass('consent-no').removeClass('consent-yes') - // } + if (state) { + this.$consentError.removeClass('visible') + } else { + this.$consentError.addClass('visible') + } }, proceed: function(){ var state = this.$checkbox.prop("checked") if (!state) { + this.$consentError.addClass('visible') return } app.demand_consent = false diff --git a/StoneIsland/platforms/ios/www/js/lib/auth/LogoutView.js b/StoneIsland/platforms/ios/www/js/lib/auth/LogoutView.js index 481dcb8d..89091473 100755 --- a/StoneIsland/platforms/ios/www/js/lib/auth/LogoutView.js +++ b/StoneIsland/platforms/ios/www/js/lib/auth/LogoutView.js @@ -10,6 +10,8 @@ var LogoutView = View.extend({ app.header.set_cart_count(0) app.footer.hide() auth.log_out() + app.demand_consent = false + app.account.consent.hide() app.account.logged_out() }, |
