From 0b2942ec56f8015c41a82937a07680028060a0e7 Mon Sep 17 00:00:00 2001 From: Kyle K Date: Mon, 2 Jul 2012 22:26:00 -0500 Subject: learn on events, tweak html --- protoype/app.js | 10 +++++++--- protoype/public/stylesheets/style.css | 8 ++++++-- protoype/router/driver.js | 6 ++++++ protoype/views/index.jade | 18 ++++++++++-------- 4 files changed, 29 insertions(+), 13 deletions(-) (limited to 'protoype') diff --git a/protoype/app.js b/protoype/app.js index 6722eab..2b6828c 100644 --- a/protoype/app.js +++ b/protoype/app.js @@ -32,8 +32,10 @@ app.configure(function() { }); app.post('/create', function(req, res) { - db.users.save({tag: req.param('tag'), id: req.param('id'), status: "offline", vehicle: '', - avatar: 'images/avatars/default.png', sig: '', location: '', races: 0}, + db.users.save({tag: req.param('tag'), id: req.param('id'), status: "offline", + vehicle: {make: req.param('make'), model: req.param('model'), year: req.param('year'), + desc: req.param('desc')}, userinfo: {sig: req.param('sig')}, location: {loc: req.param('loc')}, + stats: {matches: 0, won: 0, lost: 0}}, function(err, thing) { if (err || !thing) util.log('[create] error saving'); @@ -67,6 +69,9 @@ app.post('/login', function(req, res) { }); }); +/* /sys/do?get=activelist [list of active users] + * + */ app.get('/sys/:id([a-z]+)', function(req, res, next) { /* id contains routing token, req.query is a block/struct, key-val data structure containing GET params * id should be the main verb, action we want to do */ @@ -81,7 +86,6 @@ app.get('/sys/:id([a-z]+)', function(req, res, next) { util.log('[sys] do?get=activelist failed or empty'); else { for (var i = 0; i < result.length; i++) { - console.log('name is: ' + result[i].tag); data += result[i].tag + '\n'; } res.send(data); diff --git a/protoype/public/stylesheets/style.css b/protoype/public/stylesheets/style.css index c4dfff7..73d1927 100644 --- a/protoype/public/stylesheets/style.css +++ b/protoype/public/stylesheets/style.css @@ -1,9 +1,13 @@ body { - padding: 50px; - font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; + padding: 10px; + font: 12px "Lucida Grande", Helvetica, Arial, sans-serif; } a { color: #00B7FF; } +#listentry { + padding: 5px; +} + diff --git a/protoype/router/driver.js b/protoype/router/driver.js index 2eeadbb..05e1039 100644 --- a/protoype/router/driver.js +++ b/protoype/router/driver.js @@ -9,6 +9,12 @@ function newuser(req, res) { '
\n' + ' Tag:
\n' + ' ID:
\n' + + ' Make:
\n' + + ' Model:
\n' + + ' Year:
\n' + + ' Desc:
\n' + + ' Signature:
\n' + + ' Location:
\n' + ' \n' + '
\n' + '\n' + diff --git a/protoype/views/index.jade b/protoype/views/index.jade index cfbdb80..cd300f5 100644 --- a/protoype/views/index.jade +++ b/protoype/views/index.jade @@ -1,11 +1,13 @@ -h1= title -p Welcome to #{title}. +h1(style='border-bottom: dashed #FF9900; letter-spacing: -2px')= title +p Welcome to #{title}. Find your opponent, and get ready! -h3 User list: -ul - - each user in users - li= user.tag +h3 User List +- each user in users + #listentry #{user.tag} - if (user.status == 'online') - span(style='color: green')= user.status + span(style='color: green; font-weight: bold')= user.status - else - span(style='color: red')= user.status + span(style='color: red; font-weight: bold')= user.status + |
#{user.vehicle.year} #{user.vehicle.make} #{user.vehicle.model} + |
mods: #{user.vehicle.desc}
+ span(style='color: gray; font-style: italic')= user.userinfo.sig -- cgit v1.2.3