From 013cd0962cdf230ea08f32e5c8027b8da2444e75 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 22 Nov 2016 11:59:41 -0800 Subject: Let users enter their phone number for notifications --- bower.json | 5 +++-- public/js/profile.coffee | 1 + public/js/profile.js | 6 +----- routes/users.js | 6 ++++-- src/routes/users.coffee | 8 ++++++-- views/users/profile.html | 6 ++++++ 6 files changed, 21 insertions(+), 11 deletions(-) diff --git a/bower.json b/bower.json index d42833a7..241bae58 100644 --- a/bower.json +++ b/bower.json @@ -3,7 +3,7 @@ "description": "Bitcoin Point of Sale App", "main": "app.js", "authors": [ - "Adam Soltys " + "Adam Soltys " ], "license": "MIT", "keywords": [ @@ -34,7 +34,8 @@ "jquery-serialize-object": "~2.5.0", "crypto-js": "~3.1.5", "bootbox.js": "bootbox#~4.4.0", - "moment": "^2.15.1" + "moment": "^2.15.1", + "bootstrap-formhelpers": "^2.3.0" }, "resolutions": { "bootstrap": "b962f8a4308d094c23c9ac47a0a5ee3d4e9a4bfd" diff --git a/public/js/profile.coffee b/public/js/profile.coffee index fdbde8ee..a894f275 100644 --- a/public/js/profile.coffee +++ b/public/js/profile.coffee @@ -8,6 +8,7 @@ $(-> user = $('#username').val() $.getJSON("/#{user}.json", (data) -> $('#email').val(data.email) + $('#phone').val(data.phone) $('#profile').fadeIn() ) diff --git a/public/js/profile.js b/public/js/profile.js index a49c7583..db81832b 100644 --- a/public/js/profile.js +++ b/public/js/profile.js @@ -1,4 +1,3 @@ -;(function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0](function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s delete req.session.user.password if req.body.password? - bcrypt.hash(req.body.password, 12, (err, hash) -> - db.hmset("user:#{req.params.user.toLowerCase()}", password: hash, -> + bcrypt.hash(req.body.password, 12, (err, password) -> + db.hmset("user:#{req.params.user.toLowerCase()}", + email: email + password: password + phone: phone + , -> if req.xhr res.send({}) res.end() diff --git a/views/users/profile.html b/views/users/profile.html index 0f37d20e..060ff240 100644 --- a/views/users/profile.html +++ b/views/users/profile.html @@ -1,4 +1,5 @@ {{#yield-scripts}} + {{/yield-scripts}} @@ -12,6 +13,11 @@ +
+ + +
+
-- cgit v1.2.3