Skip to content

Commit

Permalink
misc theme changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Snodgrass committed Apr 5, 2013
1 parent dfe805a commit e9a3e25
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Procfile
Original file line number Original file line Diff line number Diff line change
@@ -1 +1 @@
web: node app.js simple worker: node app.js simple
21 changes: 16 additions & 5 deletions components/user/middleware.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -19,13 +19,24 @@ module.exports = function(app) {
} }
} }


UserModel.findByIdAndUpdate(req.session.user._id, req.body).exec(function(err, user) { UserModel.findById(req.session.user._id, function(err, user) {
if (err || !user) { if (err || !user) {
req.flash("There was an error updating the user."); req.flash("There was an error finding the user.");
return next(); return next(err);
} }
req.session.user = user;
return next(); _.extend(user, req.body);

user.save(function(err) {
if (err) {
console.log(err);
req.flash("There was an error updating the user.");
return next();
}

req.session.user = user;
return next();
});
}); });
}, },


Expand Down
21 changes: 15 additions & 6 deletions components/user/view/settings.jade
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,19 +3,28 @@ extends ../../../shared/views/layout
block subject block subject


block content block content

section.smallColumn.centered.pushDown section.smallColumn.centered.pushDown
p.tac: a.logo.block(href='/') p.tac: a.logo.block(href='/')
span.is_hidden base12 span.is_hidden base12


form(action='/settings', method='post') form(action='/settings', method='post', enctype="multipart/form-data")
.title-bar .title-bar
h1 Profile Settings h1 Profile Settings
input(type="hidden", name="_method", value="put") input(type="hidden", name="_method", value="put")
input.block(type='email', name='email', placeholder="email", value=current_user.email) ul
input.block(type='text', name='name', placeholder="name", value=current_user.name) li
input.block(type='password', name='new_password', placeholder="new password") label(for="email") Email Address
input.block(type='password', name='new_password2', placeholder="repeat password") input.block(type='email', name='email', placeholder="email", value=current_user.email)
li
label(for="name") Name
input.block(type='text', name='name', placeholder="name", value=current_user.name)
li
label(for="new_password") New Password
input.block(type='password', name='new_password', placeholder="new password")
li
label(for="new_password2") Repeat New Password
input.block(type='password', name='new_password2', placeholder="repeat password")
.button-bar .button-bar
a.micro(href='/') Cancel a.micro(href='/') Cancel
button.button-submit(type='submit') Update! button.button-submit(type='submit') Update!
Expand Down
3 changes: 3 additions & 0 deletions public/styles/global.css
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ h1{color:#555}
a{color:inherit;text-decoration:none;} a{color:inherit;text-decoration:none;}
a:hover{text-decoration:underline} a:hover{text-decoration:underline}
input{font-size:1.2em;border:solid 1px #bbb;-webkit-border-radius:5px;border-radius:5px} input{font-size:1.2em;border:solid 1px #bbb;-webkit-border-radius:5px;border-radius:5px}
input[type=file]{font-size:16px;border:none}
form li{position:relative;}
form li label{position:absolute;top:0;left:-100%;text-align:right;width:100%;padding:10px;color:#777}
button{font-size:1.25em;border:solid 1px #ddd;background:#eee;-webkit-border-radius:3px;border-radius:3px} button{font-size:1.25em;border:solid 1px #ddd;background:#eee;-webkit-border-radius:3px;border-radius:3px}
.wrap{background:rgba(255,255,255,0.8)} .wrap{background:rgba(255,255,255,0.8)}
.micro{font-size:.8em;color:#999} .micro{font-size:.8em;color:#999}
Expand Down
17 changes: 17 additions & 0 deletions shared/styles/theme.styl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ input
border solid 1px #bbb border solid 1px #bbb
border-radius 5px border-radius 5px


input[type=file]
font-size 16px
border none
// padding 0

form
li
position relative
label
position absolute
top 0
left -100%
text-align right
width 100%
padding 10px
color #777

button button
font-size 1.25em font-size 1.25em
border solid 1px #ddd border solid 1px #ddd
Expand Down

0 comments on commit e9a3e25

Please sign in to comment.