diff --git a/app/controllers/users.js b/app/controllers/users.js index 6761295..ef2901d 100644 --- a/app/controllers/users.js +++ b/app/controllers/users.js @@ -34,7 +34,7 @@ exports.authenticate = function(req, res){ req.session.regenerate(function(){ req.session.userId = user._id; req.session.save(function(){ - res.redirect('/'); + res.redirect('/marketplace'); }); }); }else{ diff --git a/app/static/css/style.css b/app/static/css/style.css index 1a35bac..28056fa 100644 --- a/app/static/css/style.css +++ b/app/static/css/style.css @@ -1 +1 @@ -@import url(http://fonts.googleapis.com/css?family=Montserrat);@import url(http://fonts.googleapis.com/css?family=Berkshire+Swash);#brand:hover{color:#711a1a}#bs-navbar-collapse a:hover{background-color:#711a1a;color:white}body{color:#0f1c3c;background-color:#ECECEC}#brand{font-family:'Berkshire Swash',cursive;font-size:50px}.navbar{background-color:#0f1c3c;border-radius:0}.navbar form button{background-color:#711a1a;border:2px solid white}#marketplace{text-align:center;color:white;background-color:#711a1a;padding:15px;margin-top:0}#marketplace-map{margin-bottom:30px}#marketplace-table{border:3px solid #0f1c3c}.panel-body{background-color:#ECECEC}.homePage{height:1080px}.profile-photo{height:200px;width:150px;background-size:cover}.item-photo{height:100px;width:100px;background-size:cover}#marketplace-map{height:400px}#userTable{border:2px solid #0f1c3c}#userTable th{border:1px solid #0f1c3c;color:white;background-color:#711a1a}#userTable td{border:1px solid #0f1c3c;height:120px;vertical-align:auto;margin-top:auto;margin-bottom:auto}#marketplace-table th{border:1px solid #0f1c3c;color:white;background-color:#711a1a}#marketplace-table a{color:#0f1c3c}.marketplace-date a{color:white}#marketplace-table a:hover{color:white;background-color:#711a1a}#marketplace-table .sort{color:white}#addWine{color:#0f1c3c}#newItem{border:2px solid #0f1c3c;padding:5px}#openAuctions thead,tbody,th,td{border:1px solid #0f1c3c}#winesOnBid{border:2px solid #0f1c3c}#profileTable{border:2px solid #0f1c3c;padding:5px}.userPhoto{background-size:cover;height:100%}#marketplace-table td{border:1px solid #0f1c3c}#messagesTable{border:3px solid #0f1c3c}#messagesTable th{border:1px solid #0f1c3c;color:white;background-color:#711a1a}#messagesTable td{border:1px solid #0f1c3c;background-color:white}#bid{margin:10px;position:relative;display:inline-block;vertical-align:top;border:1px solid #ebebeb;width:200px;height:375px;background-color:#120f30}.bid-photo{height:200px;background-size:cover}.bid-name{font-size:24px;padding:10px}.bid-location{padding:10px;font-size:18px;background-color:#1B1742}.bid-description{padding:10px;font-size:18px;background-color:#231F4D;margin:0px}#bidButton{position:absolute;bottom:0px;right:0px;width:197px;background-color:#ebebeb;border:0 solid #ebebeb;color:#260026;border-radius:0%}#bidButton:hover{background-color:white}table#ItemsOnSale.table.table-stribed.table-hover.table-bordered{border:3px solid #0f1c3c} \ No newline at end of file +@import url(http://fonts.googleapis.com/css?family=Montserrat);@import url(http://fonts.googleapis.com/css?family=Berkshire+Swash);#brand:hover{color:#711a1a}#bs-navbar-collapse a:hover{background-color:#711a1a;color:white}body{color:#0f1c3c;background-color:#ececec}#brand{font-family:'Berkshire Swash',cursive;font-size:50px}.navbar{background-color:#0f1c3c;border-radius:0}.navbar form button{background-color:#711a1a;border:2px solid white}#marketplace{text-align:center;color:white;background-color:#711a1a;padding:15px;margin-top:0}#marketplace-map{margin-bottom:30px}#marketplace-table{border:3px solid #0f1c3c}.panel-body{background-color:#ececec}.profile-photo{height:200px;width:150px;background-size:cover}.item-photo{height:100px;width:100px;background-size:cover}#marketplace-map{height:400px}#userTable{border:2px solid #0f1c3c}#userTable th{border:1px solid #0f1c3c;color:white;background-color:#711a1a}#userTable td{border:1px solid #0f1c3c;height:120px;vertical-align:auto;margin-top:auto;margin-bottom:auto}#marketplace-table th{border:1px solid #0f1c3c;color:white;background-color:#711a1a}#marketplace-table a{color:#0f1c3c}.marketplace-date a{color:white}#marketplace-table a:hover{color:white;background-color:#711a1a}#marketplace-table .sort{color:white}#addWine{color:#0f1c3c}#newItem{border:2px solid #0f1c3c;padding:5px}#openAuctions thead,tbody,th,td{border:1px solid #0f1c3c}#winesOnBid{border:2px solid #0f1c3c}#profileTable{border:2px solid #0f1c3c;padding:5px}.userPhoto{background-size:cover;height:100%}#marketplace-table td{border:1px solid #0f1c3c}#messagesTable{border:3px solid #0f1c3c}#messagesTable th{border:1px solid #0f1c3c;color:white;background-color:#711a1a}#messagesTable td{border:1px solid #0f1c3c;background-color:white}#bid{margin:10px;position:relative;display:inline-block;vertical-align:top;border:1px solid #ebebeb;width:200px;height:375px;background-color:#120f30}.bid-photo{height:200px;background-size:cover;background-repeat:no-repeat}.bid-name{font-size:24px;padding:10px}.bid-location{padding:10px;font-size:18px;background-color:#1B1742}.bid-description{padding:10px;font-size:18px;background-color:#231F4D;margin:0px}#bidButton{position:absolute;bottom:0px;right:0px;width:197px;background-color:#ebebeb;border:0 solid #ebebeb;color:#260026;border-radius:0%}#bidButton:hover{background-color:white}#editProfile{background-color:#0f1c3c}.input-bar{margin:0px;background-color:#711a1a;padding:40px;color:#0f1c3c;font-size:20px;border:0px;border-radius:10px;text-align:center}.input-bar:hover{background-color:white}#labels{background-color:white;width:2000px;margin:0px}#register{text-align:center}.btn{background-color:#0f1c3c;color:white}.btn:hover{background-color:#711a1a;color:white}@media screen and (max-width:480px){.register{text-align:center;color:#0f1c3c;position:relative}.content-main{position:relative;left:0%;border:1px solid #0f1c3c}}@media screen and (min-width:660px){.register{text-align:center;color:#0f1c3c;position:relative}.content-main{position:relative;left:38%}form.regLog{padding:15px;border:1px solid #0f1c3c;width:400px;border-radius:15px;margin-top:20px}.backgroundImage{background-image:url("/img/wine_cellar_bg.png");background-size:cover;background-repeat:no-repeat}.cheers{position:relative;right:635px;top:75px;font-size:100px;font-family:'Berkshire Swash',cursive}}.navbar{margin:0px;padding:15px}.homePage{background-image:url("/img/wine_cellar_home.png");background-size:cover;height:975px;position:relative;margin:0px auto}#goRegister a{color:#711a1a;text-align:center;font-size:20px;position:absolute;left:930px;top:500px;font-size:50px;padding:30px}#goLogin a{color:#711a1a;text-align:center;font-size:20px;position:absolute;left:530px;top:500px;font-size:50px;padding:30px}#goLogin a:hover{border:1px solid #711a1a;border-radius:15%}#goRegister a:hover{border:1px solid #711a1a;border-radius:15%}.slogan{position:absolute;left:540px;top:150px;font-family:'Berkshire Swash',cursive;font-size:45px;color:#ececec}table#ItemsOnSale.table.table-stribed.table-hover.table-bordered{border:3px solid #0f1c3c} \ No newline at end of file diff --git a/app/static/css/style.less b/app/static/css/style.less index ba7eada..dc26ecd 100644 --- a/app/static/css/style.less +++ b/app/static/css/style.less @@ -4,6 +4,7 @@ @bidButton: #ebebeb; @themeBlue: #0f1c3c; @themeRed: #711a1a; +@themeGray: #ECECEC; #brand:hover{ color: #711a1a; @@ -15,7 +16,7 @@ } body{ color: @themeBlue; - background-color: #ECECEC; + background-color: @themeGray; } #brand{ @@ -49,10 +50,7 @@ body{ } .panel-body{ - background-color: #ECECEC; -} -.homePage { - height: 1080px; + background-color: @themeGray; } .profile-photo { @@ -173,7 +171,7 @@ body{ .bid-photo{ height: 200px; background-size: cover; - /*background-repeat: no-repeat;*/ + background-repeat: no-repeat; } .bid-name { @@ -209,9 +207,173 @@ body{ background-color: white; } +// views/user/edit +#editProfile { + background-color:@themeBlue; +} + +.input-bar{ + margin: 0px; + background-color: @themeRed; + padding: 40px; + color: @themeBlue; + font-size: 20px; + border: 0px; + border-radius: 10px; + text-align: center; +} + +.input-bar:hover { + background-color: white; +} + +#labels { + background-color: white; + width: 2000px; + margin: 0px; +} + +// /user/new.jade + +#register { + text-align: center; +} + +.btn { + background-color: @themeBlue; + color: white; +} + +.btn:hover { + background-color: @themeRed; + color: white; +} + +@media screen and (max-width: 480px) { + + .register { + text-align: center; + color: @themeBlue; + position: relative; + } + .content-main { + position: relative; + left: 0%; + border: 1px solid @themeBlue; + } +} + +@media screen and (min-width: 660px) { + + .register { + text-align: center; + color: @themeBlue; + position: relative; + } + .content-main { + position: relative; + left: 38%; + } + form.regLog { + padding: 15px; + border: 1px solid @themeBlue; + width: 400px; + border-radius: 15px; + margin-top: 20px; + } + .backgroundImage { + background-image: url("/img/wine_cellar_bg.png"); + background-size: cover; + background-repeat: no-repeat; + } + .cheers { + position: relative; + right: 635px; + top: 75px; + font-size: 100px; + font-family: 'Berkshire Swash', cursive; + } +} + +// home/index.jade + +.navbar { + margin: 0px; + padding: 15px; +} + +.homePage { + background-image: url("/img/wine_cellar_home.png"); + background-size: cover; + height: 975px; + position: relative; + margin: 0px auto; +} + +#goRegister a { + color: @themeRed; + text-align: center; + font-size: 20px; + position: absolute; + left: 930px; + top: 500px; + /*font-family: 'Berkshire Swash', cursive;*/ + font-size: 50px; + padding: 30px; +} + + +#goLogin a { + color: @themeRed; + text-align: center; + font-size: 20px; + position: absolute; + left: 530px; + top: 500px; + /*font-family: 'Berkshire Swash', cursive;*/ + font-size: 50px; + padding: 30px; +} + +#goLogin a:hover { + border: 1px solid @themeRed; + border-radius: 15%; +} + +#goRegister a:hover { + border: 1px solid @themeRed; + border-radius: 15%; +} + +.slogan { + position: absolute; + left: 540px; + top: 150px; + font-family: 'Berkshire Swash', cursive; + font-size: 45px; + color: @themeGray; + +} + + + + + + + + + + + + + + +// table#ItemsOnSale.table.table-stribed.table-hover.table-bordered { border: 3px solid #0f1c3c; } + + diff --git a/app/static/img/wine_cellar_bg.png b/app/static/img/wine_cellar_bg.png new file mode 100644 index 0000000..9885199 Binary files /dev/null and b/app/static/img/wine_cellar_bg.png differ diff --git a/app/static/img/wine_cellar_home.png b/app/static/img/wine_cellar_home.png new file mode 100644 index 0000000..1df2fe9 Binary files /dev/null and b/app/static/img/wine_cellar_home.png differ diff --git a/app/static/js/user/new-register.js b/app/static/js/user/new-register.js new file mode 100644 index 0000000..ec0c034 --- /dev/null +++ b/app/static/js/user/new-register.js @@ -0,0 +1,10 @@ +(function(){ + 'use strict'; + + $(document).ready(function(){ + $('body').css('display', 'none'); + $('body').fadeIn(3000); + }); + +})(); + diff --git a/app/views/home/index.jade b/app/views/home/index.jade index f4cc7c9..9e93b90 100644 --- a/app/views/home/index.jade +++ b/app/views/home/index.jade @@ -1,6 +1,12 @@ extends ../shared/template block content - .homePage(style='background-image: url("/img/wine_seller.png");') + body + .homePage + #goRegister: a(href= '/register') Register + #goLogin: a(href='/login') Login + .slogan .
Bid.
      Trade.
                Drink... + + block scripts script(src='/js/user/home.js') diff --git a/app/views/users/edit.jade b/app/views/users/edit.jade index 5502a3b..1a1a779 100644 --- a/app/views/users/edit.jade +++ b/app/views/users/edit.jade @@ -1,30 +1,32 @@ extends ../shared/template block content - h2 Edit Profile - .row - .col-xs-6 - form(role='form', method='post', action='/profile') - input(type='hidden', name='_method', value='put') - .form-group - label(for='name') Name - input.form-control#name(type='text', name='name', value=user.name, autofocus=true) - .form-group - label(for='email') Email - input.form-control#email(type='email', name='email', value=user.email) - .form-group - label(for='phone') Phone - input.form-control#phone(type='tel', name='phone', value=user.phone) - .form-group - label(for='photo') Photo - input.form-control#photo(type='text', name='photo', value=user.photo) - .form-group - label(for='bio') Bio - input.form-control#bio(type='text', name='bio', value=user.bio) - .form-group - label(for='favorite') Favorite Wine - input.form-control#favorite(type='text', name='favorite', value=user.favorite) + body#editProfile + .row + .col-xs-12.col-md-4 + form(role='form', method='post', action='/profile') + input(type='hidden', name='_method', value='put') + .form-group + label(for='name')#labels + input.form-control#name(type='text', name='name', value=user.name, autofocus=true) + .form-group + label(for='email') Email + input.form-control#email(type='email', name='email', value=user.email) + .form-group + label(for='phone') Phone + input.form-control#phone(type='tel', name='phone', value=user.phone) + .form-group + label(for='photo') Photo + input.form-control#photo(type='text', name='photo', value=user.photo) + .form-group + label(for='bio') Bio + input.form-control#bio(type='text', name='bio', value=user.bio) + .form-group + label(for='favorite') Favorite Wine + input.form-control.textBox#favorite(type='text', name='favorite', value=user.favorite) - button.btn.btn-primary(type='submit') Update Profile - .col-xs-6 + button.btn.btn-primary(type='submit') Update Profile + + .row + .col-xs-12.col-md-12 block scripts diff --git a/app/views/users/login.jade b/app/views/users/login.jade index 63c5a1f..ad55669 100644 --- a/app/views/users/login.jade +++ b/app/views/users/login.jade @@ -1,17 +1,22 @@ extends ../shared/template block content - h2 Login - .row - .col-xs-6 - form(role='form', method='post', action='/login') - .form-group - label(for='email') Email - input.form-control#email(type='email', name='email', autofocus=true) - .form-group - label(for='password') Password - input.form-control#password(type='password', name='password') - button.btn.btn-success(type='submit') Submit - .col-xs-6 + body.backgroundImage + div.register + div.content-main + .row + .col-xs-12.col-md-3 + h2.register Login + form.regLog(role='form', method='post', action='/login') + .form-group + label(for='email') + input.form-control.input-bar#email(type='email', name='email', autofocus=true, placeholder= 'Email') + .form-group + label(for='password') + input.form-control.input-bar#password(type='password', name='password', placeholder= 'Password') + button.btn(type='submit') Submit + .cheers Cheers! + .row + .col-xs-12.col-md-3 -block scripts + block scripts diff --git a/app/views/users/new.jade b/app/views/users/new.jade index 328925e..2c4304f 100644 --- a/app/views/users/new.jade +++ b/app/views/users/new.jade @@ -1,26 +1,31 @@ extends ../shared/template block content - h2 Register - .row - .col-xs-6 - form(role='form', method='post', action='/register') - .form-group - label(for='name') Name - input.form-control#name(type='text', name='name', autofocus=true) - .form-group - label(for='photo') Photo - input.form-control#photo(type='text', name='photo', placeholder='http://example.com/pic.jpg') - .form-group - label(for='email') Email - input.form-control#email(type='email', name='email') - .form-group - label(for='phone') Phone - input.form-control#phone(type='text', name='phone', placeholder='xxx-xxx-xxxx') - .form-group - label(for='password') Password - input.form-control#password(type='password', name='password') - button.btn.btn-primary(type='submit') Submit - .col-xs-6 + body.backgroundImage + div.register + div.content-main + .row + .col-xs-12.col-md-3 + h2.register Register + form.regLog(role='form', method='post', action='/register') + .form-group + label(for='name') + input.form-control.input-bar#name(type='text', name='name', placeholder='User Name', autofocus=true) + .form-group + label(for='photo') + input.form-control.input-bar#photo(type='text', name='photo', placeholder='Picture URL') + .form-group + label(for='phone') + input.form-control.input-bar#phone(type='text', name='phone', placeholder='xxx-xxx-xxxx') + .form-group + label(for='email') + input.form-control.input-bar#email(type='email', name='email', placeholder ='Email') + .form-group + label(for='password') + input.form-control.input-bar#password(type='password', name='password', placeholder='Password') + button.btn(type='submit') Submit + .row + .col-xs-12 -block scripts + block scripts + script(src='/js/user/new-register.js') diff --git a/app/views/users/trader.jade b/app/views/users/trader.jade index 4141719..a5dc59c 100644 --- a/app/views/users/trader.jade +++ b/app/views/users/trader.jade @@ -61,7 +61,7 @@ block content label(for='message') Message: textarea.form-control#message(name='message', autofocus=true) input(type='hidden' name='mtype' value='internal') - .form-group + form,.form-group button.btn.btn-info.btn-sm(type='submit') Send Message block scripts diff --git a/test/acceptance/users.js b/test/acceptance/users.js index a358f30..bccab94 100644 --- a/test/acceptance/users.js +++ b/test/acceptance/users.js @@ -81,7 +81,7 @@ describe('users', function(){ .send('email=nodeapptest%2Bbob%40gmail.com&password=1234') .end(function(err, res){ expect(res.status).to.equal(302); - expect(res.headers.location).to.equal('/'); + expect(res.headers.location).to.equal('/marketplace'); done(); }); });