Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

misc theme changes

  • Loading branch information...
commit e9a3e2523ec81d77219b0faae9af1382cb77360a 1 parent dfe805a
Jim Snodgrass authored
View
2  Procfile
@@ -1 +1 @@
-web: node app.js simple
+worker: node app.js simple
View
21 components/user/middleware.js
@@ -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) {
- req.flash("There was an error updating the user.");
- return next();
+ req.flash("There was an error finding the user.");
+ 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();
+ });
});
},
View
21 components/user/view/settings.jade
@@ -3,19 +3,28 @@ extends ../../../shared/views/layout
block subject
block content
-
+
section.smallColumn.centered.pushDown
p.tac: a.logo.block(href='/')
span.is_hidden base12
- form(action='/settings', method='post')
+ form(action='/settings', method='post', enctype="multipart/form-data")
.title-bar
h1 Profile Settings
input(type="hidden", name="_method", value="put")
- input.block(type='email', name='email', placeholder="email", value=current_user.email)
- input.block(type='text', name='name', placeholder="name", value=current_user.name)
- input.block(type='password', name='new_password', placeholder="new password")
- input.block(type='password', name='new_password2', placeholder="repeat password")
+ ul
+ li
+ label(for="email") Email Address
+ 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
a.micro(href='/') Cancel
button.button-submit(type='submit') Update!
View
3  public/styles/global.css
@@ -41,6 +41,9 @@ h1{color:#555}
a{color:inherit;text-decoration:none;}
a:hover{text-decoration:underline}
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}
.wrap{background:rgba(255,255,255,0.8)}
.micro{font-size:.8em;color:#999}
View
17 shared/styles/theme.styl
@@ -17,6 +17,23 @@ input
border solid 1px #bbb
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
font-size 1.25em
border solid 1px #ddd
Please sign in to comment.
Something went wrong with that request. Please try again.