From 2f809cfbcf043caa1629071f9d89cd2e4c4d28db Mon Sep 17 00:00:00 2001 From: Edin Dazdarevic Date: Sun, 19 Apr 2015 15:00:06 +0200 Subject: [PATCH] registration page design added, some other minor changes --- front-ui/app/components/account/register.js | 143 ++++++++++++++------ front-ui/app/css/main.css | 32 +++-- 2 files changed, 116 insertions(+), 59 deletions(-) diff --git a/front-ui/app/components/account/register.js b/front-ui/app/components/account/register.js index 8b809db..7e1543e 100644 --- a/front-ui/app/components/account/register.js +++ b/front-ui/app/components/account/register.js @@ -22,7 +22,7 @@ var Register = React.createClass({ myBabyDOBDay: -1, myBabyDOBMonth: -1, myBabyDOBYear: -1, - myBabyOnTheWay: false, + myBabyOnTheWay: true, loginState : UserStore.getLoginState() }; }, @@ -47,7 +47,7 @@ var Register = React.createClass({ monthsSelect.push() } - return () + return () }, renderYearSelector: function() { var currentYear = (new Date().getFullYear()); @@ -58,7 +58,7 @@ var Register = React.createClass({ years.push() } - return () + return () }, renderDaySelector: function() { var days = []; @@ -67,7 +67,7 @@ var Register = React.createClass({ days.push() } - return () + return () }, onBabyDOBDayChange: function(e) { this.setState({ @@ -94,43 +94,7 @@ var Register = React.createClass({ babyGender: e.currentTarget.value }); }, - renderBabyDetails: function() { - if (!this.state.myBabyDetailsVisible) { - return ( -
- ) - } - return ( -
-
- - -
- Djevojčica - Dječak - Jos ne znamo -
-
-
- - -
- -
-
-
- -
- - {this.renderDaySelector()} - {this.renderMonthSelector()} - {this.renderYearSelector()} - -
-
-
) - }, validations: { firstName: function(value) { if (!ValidationUtils.isValidRequired(value)) { @@ -185,6 +149,15 @@ var Register = React.createClass({ } } }, + renderGenderImage: function() { + if(this.state.babyGender === "boy") { + return baby + } else if (this.state.babyGender === "girl") { + return baby + } + + return baby + }, renderErrorMessage: function(message){ return (
{message}
) }, @@ -210,11 +183,11 @@ var Register = React.createClass({ if (this.state.myBabyDetailsVisible) { var dobOk = this.state.myBabyDOBDay !== -1 && this.state.myBabyDOBMonth !== -1 && this.state.myBabyDOBYear !== -1; - + if (dobOk || this.state.babyName !== undefined || this.state.babyGender !== undefined) { var childInfo = { name: this.state.babyName, - gender: this.state.babyGender, + gender: this.state.babyGender === "boy" ? 1 : 2, on_the_way: this.state.myBabyOnTheWay } @@ -269,7 +242,7 @@ var Register = React.createClass({ ) } else if (rs.performed && rs.success) { return (
- Uspješno ste se registrovali na Ribicu. Kliknite ovdje za nastavak. + Uspješno ste se registrovali na Ribicu. Kliknite ovdje za nastavak.
) } }, @@ -277,11 +250,91 @@ var Register = React.createClass({ var cx = React.addons.classSet; var regSuccess = this.state.registration.performed && this.state.registration.success; var classes = cx({ - 'hide': regSuccess + 'hide': regSuccess }); if (!this.state.registration.performed && this.state.loginState.loggedIn) { return (
Vi ste već registrovani. Uživajte u kupovini.
) } + + return (
+ {this.renderRegistrationState()} +
+
+
+

Registracija

+
+
+
+ + {this.getValidationMessages('firstName').map(this.renderErrorMessage)} + +
+
+ + {this.getValidationMessages('lastName').map(this.renderErrorMessage)} + +
+
+ + {this.getValidationMessages('email').map(this.renderErrorMessage)} + +
+
+ + {this.getValidationMessages('password').map(this.renderErrorMessage)} + +
+
+ + {this.getValidationMessages('passwordConfirmation').map(this.renderErrorMessage)} + +
+
+ {this.renderGenderImage()} +
+
+

Moja beba (po izboru)

+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ Datum rođenja +
+
+
+ {this.renderDaySelector()} +
+
+ {this.renderMonthSelector()} +
+
+ {this.renderYearSelector()} +
+
+
+ +
+
+

Već imate profil? Prijavite se

+
+
+
+
+
+); + /* return (
Registracija {this.renderRegistrationState()} @@ -351,7 +404,7 @@ var Register = React.createClass({
- ); + ); */ } }) module.exports = Register; diff --git a/front-ui/app/css/main.css b/front-ui/app/css/main.css index 8f309f7..8adf26c 100644 --- a/front-ui/app/css/main.css +++ b/front-ui/app/css/main.css @@ -7,7 +7,7 @@ body{ background-size: cover ; background-position: center ; background-repeat: no-repeat; - + } #left-nave { @@ -149,7 +149,7 @@ margin-left: 8px; padding-right: 45px; margin-left: -23px; margin-right: -23px; - + } #beba:hover{ background: url("https://res.cloudinary.com/du5pdibul/image/upload/v1428813559/beba-bg_wip7kj.png"); @@ -237,7 +237,7 @@ border-color: lightgray; } .navbar-default .navbar-nav > li > a{ color:black; - + } .navbar-default .navbar-nav > li{ @@ -340,7 +340,7 @@ background-size: cover; right:-14px; bottom: -15px; text-align: right; - + } .mycart div { text-align: right; @@ -361,7 +361,7 @@ color: white; } #myhome-hover:hover { border-bottom: solid #06c3c3 1px; - + } @@ -375,7 +375,7 @@ color: white; color:black; padding: 10px; border-bottom: solid 1px lightgray; - + } .sidebar li a{ text-decoration: none; @@ -399,7 +399,7 @@ text-decoration: none; } .megamenu.dropdown-header { padding: 3px 15px !important; - + } .navbar-nav .open .dropdown-menu .dropdown-header{ color:#fff; @@ -413,10 +413,10 @@ text-decoration: none; } .navbar-toggle { display: block; - + } .navbar-collapse { - + box-shadow: inset 0 1px 0 rgba(255,255,255,0.1); border-top:none !important; } @@ -426,26 +426,30 @@ text-decoration: none; .navbar-nav>li { float: none; - + } .navbar-nav>ul { margin-bottom: 0px; - + } .navbar-nav>li>a { padding-top: 10px; padding-bottom: 10px; - + } .navbar-text { float: none; margin: 15px 0; } /* since 3.1.0 */ - .navbar-collapse.collapse.in { + .navbar-collapse.collapse.in { display: block!important; } .collapsing { overflow: hidden!important; } -} \ No newline at end of file +} + +.error-message { + color: red; +}