X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=cmd%2Fweb%2Fjs%2Fmain.jsx;h=8014377523aba32c31ef45f50c8ac7e39630c40a;hb=2e4885d98ec49203180deb7e4e9148762e4720e7;hp=e5e505d8daa5ef4ba301c5112b026bf4aebe69ae;hpb=2f91f20a8645339385ada602684f4957f20f4da4;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FFront.git diff --git a/cmd/web/js/main.jsx b/cmd/web/js/main.jsx index e5e505d..8014377 100644 --- a/cmd/web/js/main.jsx +++ b/cmd/web/js/main.jsx @@ -1,20 +1,16 @@ -var SignupForm = require('./signup.js').SignupForm; -var SigninForm = require('./signin.js').SigninForm; -var OtpEnrollForm = require('./otp.js').OtpEnrollForm; -var PoloniexController = require('./poloniex.js').PoloniexController; -var App = require('./app.js'); -var Api = require('./api.js').Api; -var cookies = require('./cookies.js'); - -var Logo = React.createClass({ - render: function() { - return (
- -
); - } -}); +import SignupForm from './signup.js'; +import SigninForm from './signin.js'; +import PasswordResetForm from './password_reset.js'; +import ChangePasswordForm from './change_password.js'; +import OtpEnrollForm from './otp.js'; +import PoloniexController from './poloniex.js'; +import UserAccount from './account.js'; +import AdminDashboard from './admin.js'; +import App from './app.js'; +import Api from './api.js'; +import cookies from './cookies.js'; +import React from 'react'; +import qs from 'qs'; App.page('/signup', false, function(context) { if (App.isUserSignedIn()) { @@ -22,12 +18,9 @@ App.page('/signup', false, function(context) { return; } - App.mount( -
- + App.mount(
-
- ); +
); }); App.page('/signin', false, function(context) { @@ -36,11 +29,58 @@ App.page('/signin', false, function(context) { return; } - App.mount( -
- + App.mount(
-
+
); +}); + +App.page('/reset-password', false, function(context) { + if (App.isUserSignedIn()) { + App.go('/me'); + return; + } + + App.mount(
+ +
); +}); + +App.page('/change-password', false, function(context) { + if (App.isUserSignedIn()) { + App.go('/me'); + return; + } + + var token = qs.parse(context.querystring).token; + + if (token === undefined) { + App.go('/'); + return; + } + + App.mount(
+ +
); +}); + +App.page('/confirm', false, function(context) { + var token = qs.parse(context.querystring).token; + + if (token === undefined) { + App.go('/'); + return; + } + + Api.Call( + 'CONFIRM_EMAIL', + {'token': token}, + function(err, status, data) { + if (err) { + console.error(err, data); + } + + App.go('/me'); + } ); }); @@ -51,12 +91,32 @@ App.page('/signout', true, function(context) { }); App.page('/me', true, function(context) { - App.mount( -
- + App.mount(
-
- ); +
); +}); + +App.page('/account', true, function(context) { + App.mount(
+ +
); +}); + +App.page('/admin', true, function(context) { + App.mount(
+ +
); +}); + +App.page('/not_confirmed', true, function(context) { + App.mount(
+
+
+

An email has now been sent to your email address.

+

{'Please click the \'Confirm your account\' button to validate your email.'}

+
+
+
); }); App.page('/otp/setup', true, function(context) { @@ -66,23 +126,17 @@ App.page('/otp/setup', true, function(context) { return; } - App.mount( -
- + App.mount(
-
- ); +
); - }.bind(this)); + }); }); App.page('/otp/validate', true, function(context) { - App.mount( -
- + App.mount(
-
- ); +
); }); App.page('/', false, function(context) {