aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2013-11-08 22:18:11 -0800
committerAdam Soltys <[email protected]>2013-11-08 22:18:36 -0800
commit5c5ae752fcc8e32399948c743315c5a0b6ad6ab1 (patch)
tree2c09dc9cf74d2b0a70fcf22c4d714f726645330f
parent2e18f69d99deacca727054d301b21a7c357fd6dc (diff)
downloadcoinos-server-5c5ae752fcc8e32399948c743315c5a0b6ad6ab1.tar.gz
coinos-server-5c5ae752fcc8e32399948c743315c5a0b6ad6ab1.zip
Create merchant list stub
-rw-r--r--app.coffee3
-rw-r--r--routes/users.coffee15
-rw-r--r--views/layout.html31
-rw-r--r--views/users/index.html7
4 files changed, 28 insertions, 28 deletions
diff --git a/app.coffee b/app.coffee
index 50a25e0b..9adbe83c 100644
--- a/app.coffee
+++ b/app.coffee
@@ -43,8 +43,8 @@ app.get('/logout', sessions.destroy)
app.get('/:user/exists', users.exists)
app.get('/:user.json', users.json)
-app.get('/:user', users.show)
+app.get('/users', users.index)
app.get('/users/new', users.new)
app.post('/users', users.create)
@@ -54,6 +54,7 @@ app.post('/:user/update', authorize, users.update)
app.get('/:user/transactions.json', authorize, transactions.json)
app.post('/:user/transactions', authorize, transactions.create)
app.get('/:user/report', authorize, transactions.index)
+app.get('/:user', users.show)
app.use((err, req, res, next) ->
res.status(500)
diff --git a/routes/users.coffee b/routes/users.coffee
index 718a649a..29300f90 100644
--- a/routes/users.coffee
+++ b/routes/users.coffee
@@ -3,7 +3,6 @@ bcrypt = require('bcrypt')
module.exports = (sessions) ->
exists: (req, res) ->
-
db.hgetall("user:"+req.params.user, (err, obj) ->
if obj? then res.write('true') else res.write('false')
res.end()
@@ -16,6 +15,19 @@ module.exports = (sessions) ->
res.end()
)
+ index: (req, res) ->
+ db.keys('*', (err, obj) ->
+ res.write(JSON.stringify(obj))
+ res.end()
+ )
+
+ list: (req, res) ->
+ res.render('users/index',
+ js: (-> global.js),
+ css: (-> global.css),
+ layout: 'layout'
+ )
+
show: (req, res) ->
res.render('calculator/show',
user: req.params.user,
@@ -37,6 +49,7 @@ module.exports = (sessions) ->
)
)
)
+
create: (req, res) ->
userkey = "user:"+req.body.username
db.hgetall(userkey, (err, obj) ->
diff --git a/views/layout.html b/views/layout.html
index 04f0be2d..4f83e237 100644
--- a/views/layout.html
+++ b/views/layout.html
@@ -1,35 +1,14 @@
-<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
- <title>Vancouver Bitcoin</title>
+ <meta name="viewport" content="width=480, height=752, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
+ <title>Bitcoin Payment Calculator</title>
<link href="img/favicon.ico" rel="shortcut icon" />
- {{#js}}index{{/js}}
- {{#css}}index{{/css}}
- <meta name="description" content="Vancouver's Bitcoin Community of Merchants and Exchangers" />
- <meta name="keywords" content="Bitcoin, Vancouver, Point of Sale, Merchants, Exchangers" />
+ {{#css}}calculator{{/css}}
</head>
<body>
- <div class="container">
- <div class="navbar navbar-inverse">
- <div class="navbar-inner">
- <div class="container-fluid">
- <a class="brand" href="/">VanBTC</a>
- <div class="nav-collapse collapse">
- <p class="navbar-text pull-right">
- Buy: <b id="bid"></b> | Sell: <b id="ask"></b>
- </p>
- <ul class="nav">
- <li><a href="/about">Info</a></li>
- <li><a href="/merchants">Merchants</a></li>
- <li><a href="/exchangers">Exchangers</a></li>
- <li><a href="/contact">Contact</a></li>
- </ul>
- </div><!--/.nav-collapse -->
- </div>
- </div>
- </div>
+ <div class="container-fluid">
{{>content}}
</div>
</body>
-</html>
+</html>
diff --git a/views/users/index.html b/views/users/index.html
new file mode 100644
index 00000000..3bf10b58
--- /dev/null
+++ b/views/users/index.html
@@ -0,0 +1,7 @@
+<h1>Merchants</h1>
+
+<ul>
+ <li>One</li>
+ <li>One</li>
+ <li>One</li>
+</ul>