]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Front.git/commitdiff
JS clean. v0.0.15
authorjloup <jloup@jloup.work>
Mon, 14 May 2018 10:38:00 +0000 (12:38 +0200)
committerjloup <jloup@jloup.work>
Mon, 14 May 2018 10:38:00 +0000 (12:38 +0200)
api/user.go
cmd/web/js/account.jsx
cmd/web/js/change_password.jsx
cmd/web/js/main.jsx
cmd/web/js/otp.jsx
cmd/web/js/panel.jsx
cmd/web/js/password_reset.jsx
cmd/web/js/signin.jsx
cmd/web/js/signup.jsx
cmd/web/static/style.css

index ff539f0c388d395a157e579515addf1d28fae08b..8f1a465c10b84c4bb84415012be929284b4ab87e 100644 (file)
@@ -136,13 +136,6 @@ func (q SignupQuery) Run() (interface{}, *Error) {
                }
        }
 
-       if CONFIG.FreeSMSUser != "" {
-               err := SendSMS(CONFIG.FreeSMSUser, CONFIG.FreeSMSPass, fmt.Sprintf("'%v' request a password reset. Token '/change-password?token=%v'", q.In.Email, token))
-               if err != nil {
-                       return nil, NewInternalError(err)
-               }
-       }
-
        return SignResult{token, newUser.Role == db.RoleAdmin}, nil
 }
 
index 988d840a3c4996c3e188f0d14098a561a9ffe6c8..9a976f4c0729bf104bc82ff3a0bdf80e1358a516 100644 (file)
@@ -177,12 +177,10 @@ class PoloniexCredentialsForm extends React.Component {
         <div className="row">
           <div className="col-12">
             <form role="form" onSubmit={this.handleSubmit}>
-              <label className="w-100">Key:
-                <input className="form-control" type="text" placeholder="key" value={keyDisplayed} onChange={this.handleApiKeyChange} disabled={!this.props.editMode}/>
-              </label>
-              <label className="w-100">Secret:
-                <input className="form-control" type="text" placeholder="secret" value={secretDisplayed} onChange={this.handleApiSecretChange} disabled={!this.props.editMode}/>
-              </label>
+              <label className="w-100">Key:</label>
+              <input className="form-control" type="text" value={keyDisplayed} onChange={this.handleApiKeyChange} disabled={!this.props.editMode}/>
+              <label className="w-100">Secret:</label>
+              <input className="form-control" type="text" value={secretDisplayed} onChange={this.handleApiSecretChange} disabled={!this.props.editMode}/>
               <input className="form-control submit" type={submitType} value="Save" />
               <button className="form-control submit" style={{display: buttonDisplay}} onSubmit={null} onClick={this.props.onEditClick} type="button">Show/Edit</button>
             </form>
index 74cde0fc86ef7737aeef1b24a48429b7b5ee987a..dfa57016bf3cc83b394efcd5cce4068cafe8f90b 100644 (file)
@@ -47,9 +47,10 @@ class ChangePasswordForm extends React.Component {
     var cName = classNames('form-message', {'hidden': this.state.hideMsg, 'message-ok': this.state.msgOk});
     return (
         <div className="row sign-in">
-          <div className="offset-1 col-10 offset-md-4 col-md-4 text-center">
+          <div className="offset-1 col-10 box offset-md-4 col-md-4 text-center">
             <form role="form" onSubmit={this.handleSubmit}>
-              <input className="form-control" type="password" placeholder="password" onChange={this.handlePasswordChange} />
+              <label className="w-100 text-left"><strong>New password</strong></label>
+              <input className="form-control" type="password" onChange={this.handlePasswordChange} />
               <input className="form-control submit" type="submit" value="Change password" />
               <div className={cName}>{this.state.msg}</div>
             </form>
index 8014377523aba32c31ef45f50c8ac7e39630c40a..a64b34248bd3dacb97a2de6e32fad5907ed86bc6 100644 (file)
@@ -86,6 +86,7 @@ App.page('/confirm', false, function(context) {
 
 App.page('/signout', true, function(context) {
   cookies.removeItem('jwt');
+  cookies.removeItem('isAdmin');
 
   App.go('/');
 });
index 6c22c8ccc9fb5f3c365c8a285bc62f82423bc28f..5f04e21da2968fdffefebb24dd9191cbef28d745 100644 (file)
@@ -61,11 +61,12 @@ class OtpEnrollForm extends React.Component {
 }
     return (
         <div className="row otp-enroll">
-          <div className="offset-4 col-4 col-xs-offset-1 col-xs-10 text-center">
+          <div className="offset-1 col-10 box offset-md-4 col-md-4 text-center">
             {qrCode}
             <div className="row justify-content-center">
               <form role="form" onSubmit={this.handleSubmit}>
-                <input className="form-control" type="pass" placeholder="code" onChange={this.handlePassChange} />
+                <label className="w-100 text-left"><strong>Code</strong></label>
+                <input className="form-control" type="pass" onChange={this.handlePassChange} />
                 <input className="form-control submit" type="submit" value="Validate" />
                 <div className={cName}>{this.state.msg}</div>
               </form>
index c293e9a8a0c0f0cbfd4b13ecfbbae4fc77b1e546..7f9f9a36cc04719cfe822338c85f3b604beb07ac 100644 (file)
@@ -11,7 +11,7 @@ class Panel extends React.Component {
 
     return (
       <div className={className}>
-        <div className="box col-12">
+        <div className="box offset-1 col-10">
           <div className="row">
             <div className="col-4">{this.props.title}</div>
           </div>
index b6a10ecbceec8852710276f44438a77d48909785..7193a93cc4db696636fc2126e325a5e78e6bf4a2 100644 (file)
@@ -42,9 +42,10 @@ class PasswordResetForm extends React.Component {
     var cName = classNames('form-message', {'hidden': this.state.hideMsg, 'message-ok': this.state.msgOk});
     return (
         <div className="row sign-in">
-          <div className="offset-1 col-10 offset-md-4 col-md-4 text-center">
+          <div className="offset-1 col-10 box offset-md-4 col-md-4 text-center">
             <form role="form" onSubmit={this.handleSubmit}>
-              <input className="form-control" type="email" placeholder="email" onChange={this.handleEmailChange} />
+              <label className="w-100 text-left"><strong>Email address</strong></label>
+              <input className="form-control" type="email" onChange={this.handleEmailChange} />
               <input className="form-control submit" type="submit" value="Reset" />
               <div className={cName}>{this.state.msg}</div>
             </form>
index 5b3b661f4a7be7373e60bf29e30201e5968b343c..cf486adcbeff5293587842a54c9d6de2b8ab00e2 100644 (file)
@@ -43,17 +43,28 @@ class SigninForm extends React.Component {
   render = () => {
     var cName = classNames('form-message', {'hidden': this.state.hideMsg, 'message-ok': this.state.msgOk});
     return (
+        <React.Fragment>
         <div className="row sign-in">
-          <div className="offset-1 col-10 offset-md-4 col-md-4 text-center">
+          <div className="offset-1 col-10 box offset-md-4 col-md-4 text-center">
             <form role="form" onSubmit={this.handleSubmit}>
-              <input className="form-control" type="email" placeholder="email" onChange={this.handleEmailChange} />
-              <input className="form-control" type="password" placeholder="password" onChange={this.handlePasswordChange} />
+              <label className="w-100 text-left"><strong>Email address</strong></label>
+              <input className="form-control" type="email" onChange={this.handleEmailChange} />
+              <span className="w-100 d-inline-block text-left">
+                <label><strong>Password</strong></label>
+                <a className="blue-link hint-text float-right" href="/reset-password">Forgot password?</a>
+              </span>
+              <input className="form-control" type="password" onChange={this.handlePasswordChange} />
               <input className="form-control submit" type="submit" value="Sign In" />
               <div className={cName}>{this.state.msg}</div>
             </form>
-            <a href="#" onClick={App.onInternNavigation.bind(this, '/signup')}><u>Sign up</u></a>
           </div>
         </div>
+        <div className="row">
+          <div className="offset-1 col-10 box offset-md-4 col-md-4 text-center">
+            <span>New to CryptoPF? <a href="#" className="blue-link" onClick={App.onInternNavigation.bind(this, '/signup')}>Create an account.</a></span>
+          </div>
+        </div>
+        </React.Fragment>
        );
   }
 }
index 08509e82845281bd500c3ee66cf8dd726803a8bf..15f9e887c1d2b26a01941c518bc95195e0150364 100644 (file)
@@ -51,13 +51,14 @@ class SignupForm extends React.Component {
     var cName = classNames('form-message', {'hidden': this.state.hideMsg, 'message-ok': this.state.msgOk});
     return (
         <div className="row sign-in">
-          <div className="offset-1 col-10 offset-md-4 col-md-4 text-center">
+          <div className="offset-1 box col-10 offset-md-4 col-md-4 text-center">
             <form role="form" onSubmit={this.handleSubmit}>
-              <input className="form-control" type="email" placeholder="email" onChange={this.handleEmailChange} />
-              <input className="form-control" type="password" placeholder="password" onChange={this.handlePasswordChange} />
+              <label className="w-100 text-left"><strong>Email address</strong></label>
+              <input className="form-control" type="email" onChange={this.handleEmailChange} />
+              <label className="w-100 text-left"><strong>Password</strong></label>
+              <input className="form-control" type="password" onChange={this.handlePasswordChange} />
               <input className="form-control submit" type="submit" value="Sign Up" />
               <div className={cName}>{this.state.msg}</div>
-              <a href="#" onClick={App.onInternNavigation.bind(this, '/signin')}><u>Sign In</u></a>
             </form>
           </div>
         </div>
index ad718d7a8efe62fb4c6adf3c1e2f58fbe222fd7a..1ba682b7347c61c7c9d01e5ad69e2a0f1bb20d10 100644 (file)
@@ -3,6 +3,7 @@
 body {
   font-family: 'Fira Mono', 'Helvetica Neue', Arial, Helvetica, sans-serif;
   background-color: rgb(246, 248, 251);
+  font-size: 0.9em;
 }
 
 ul {
@@ -64,7 +65,6 @@ h1 {
 .sign-in .form-control {
   margin-bottom: 20px;
   border-radius: 2px;
-  border: none;
   background-color: white;
 }
 
@@ -83,12 +83,21 @@ h1 {
 .sign-in .submit {
   background-color: rgb(20, 20, 20);
   color: white;
+  font-weight: bold;
+}
+
+.blue-link {
+  color: #0366d6;
+}
+
+.hint-text {
+  font-size: 0.9em;
+  margin-top: 1px;
 }
 
 .api-credentials-form .form-control {
   margin-bottom: 20px;
   border-radius: 2px;
-  border: none;
   background-color: white;
 }
 
@@ -100,13 +109,13 @@ h1 {
 .otp-enroll .form-control {
   margin-bottom: 20px;
   border-radius: 2px;
-  border: none;
   background-color: white;
 }
 
 .otp-enroll .submit {
   background-color: rgb(20, 20, 20);
   color: white;
+  font-weight: bold;
 }
 .form-message {
   background-color: rgba(255, 6, 6, .33);