Skip to content

Commit

Permalink
got the profile picture working iwth Gvatar
Browse files Browse the repository at this point in the history
  • Loading branch information
yagudaev committed Aug 12, 2012
1 parent 452aa64 commit c42e63a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
3 changes: 0 additions & 3 deletions app.js
Expand Up @@ -14,9 +14,6 @@ var express = require('express'),

var app = express();

// connect to the database


app.configure(function(){
app.set('port', process.env.PORT || 3000);
app.set('views', __dirname + '/views');
Expand Down
3 changes: 1 addition & 2 deletions models/db.js
Expand Up @@ -87,5 +87,4 @@ function buildDB() {
return db;
}

exports.models = connectTo(config.dbhost, config.dbname, config.dbuser, config.dbpassword, config.dbport).models;
console.log(exports.models);
exports.models = connectTo(config.dbhost, config.dbname, config.dbuser, config.dbpassword, config.dbport).models;
11 changes: 5 additions & 6 deletions routes/index.js
Expand Up @@ -6,11 +6,11 @@ var db = require('./../models/db');


exports.index = function(req, res){
res.render('index', { title: 'Home'});
res.render('index', { title: 'Home', scripts: []});
};

exports.showSignup = function(req, res) {
res.render('signup', {title: 'Signup', errors: [] })
res.render('signup', {title: 'Signup', errors: [], scripts: ['javascripts/signup.js'] })
}

exports.processSignup = function(req, res) {
Expand All @@ -32,7 +32,6 @@ exports.processSignup = function(req, res) {
errors.push(err);
}

res.render('signup', {title: 'Signup Successful', errors: errors });
})

}
res.render('signup', { title: 'Signup Successful', errors: errors, scripts: ['javascripts/signup.js'] });
});
};
6 changes: 6 additions & 0 deletions views/footer.ejs
@@ -1,4 +1,10 @@
<footer>
</footer>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="/javascripts/jquery.md5.mini.js"></script>
<%= scripts %>
<% for(var i = 0; i < scripts.length; i++) { %>
<script src="<%= scripts[i] %>"></script>
<% } %>
</body>
</html>
6 changes: 3 additions & 3 deletions views/signup.ejs
Expand Up @@ -4,13 +4,13 @@
<% } else { %>
<p>Thank you for signing up, you are awesome :).</p>
<% } %>
<form method="post" action="/signup">
<form method="post" action="/signup" id="signup">
<label for="txtFirstName">First name:</label><input id="txtFirstName" name="txtFirstName" type="text" />
<label for="txtLastName">Last name:</label><input id="txtLastName" name="txtLastName" type="text" />
<label for="txtEmail">Email:</label><input id="txtEmail" name="txtEmail" type="text" />
<label for="txtEmail">Email:</label><input id="txtEmail" name="txtEmail" type="email" />
<label for="txtPhone">Phone:</label><input id="txtPhone" name="txtPhone" type="text" />
<label for="txtBiography">Biography</label><textarea></textarea>
<img width="50" height="50" />
<img id="profilePicture" src="" width="50" height="50" />
<button type="submit">Signup</button>
</form>
<%- include footer %>

0 comments on commit c42e63a

Please sign in to comment.