summaryrefslogtreecommitdiffstats
path: root/protoype
diff options
context:
space:
mode:
authorKyle K <kylek389@gmail.com>2012-07-02 22:26:00 -0500
committerKamil Kaminski <kyle@kkaminsk.com>2012-07-02 22:26:00 -0500
commit0b2942ec56f8015c41a82937a07680028060a0e7 (patch)
treef26932c8d2dcc840492d68f658550d93b158dd05 /protoype
parent46230d8dd0709829859dc1feb92db17933000fcc (diff)
downloadfubar-0b2942ec56f8015c41a82937a07680028060a0e7.tar.gz
fubar-0b2942ec56f8015c41a82937a07680028060a0e7.tar.bz2
fubar-0b2942ec56f8015c41a82937a07680028060a0e7.zip
learn on events, tweak html
Diffstat (limited to 'protoype')
-rw-r--r--protoype/app.js10
-rw-r--r--protoype/public/stylesheets/style.css8
-rw-r--r--protoype/router/driver.js6
-rw-r--r--protoype/views/index.jade18
4 files changed, 29 insertions, 13 deletions
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) {
'<form method="post" action="/create">\n' +
' Tag: <input type="text" name="tag" /><br />\n' +
' ID: <input type="text" name="id" /><br />\n' +
+ ' Make: <input type="text" name="make" /><br />\n' +
+ ' Model: <input type="text" name="model" /><br />\n' +
+ ' Year: <input type="text" name="year" /><br />\n' +
+ ' Desc: <input type="text" name="desc" /><br />\n' +
+ ' Signature: <input type="text" name="sig" /><br />\n' +
+ ' Location: <input type="text" name="loc" /><br />\n' +
' <input type="submit" value="add" />\n' +
'</form>\n' +
'</body>\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 <u>#{user.tag}</u>
- 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
+ | <br />#{user.vehicle.year} #{user.vehicle.make} #{user.vehicle.model}
+ | <br />mods: #{user.vehicle.desc}<br />
+ span(style='color: gray; font-style: italic')= user.userinfo.sig