aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app.coffee9
-rw-r--r--package.json3
-rw-r--r--views/_header.html17
-rw-r--r--views/about.html306
-rw-r--r--views/exchangers.html32
-rw-r--r--views/layout.html19
6 files changed, 194 insertions, 192 deletions
diff --git a/app.coffee b/app.coffee
index b96d81d5..1170843c 100644
--- a/app.coffee
+++ b/app.coffee
@@ -4,6 +4,7 @@ path = require('path')
engines = require('consolidate')
passport = require('passport')
bcrypt = require('bcrypt')
+db = require("redis")
config = require('./config')
app = express()
@@ -77,7 +78,7 @@ app.get('/:user/report', (req, res) ->
)
app.get('/:user.json', (req, res) ->
- db = require("redis").createClient()
+ db.createClient()
db.hgetall(req.params.user, (err, obj) ->
res.write(JSON.stringify(obj))
res.end()
@@ -85,7 +86,7 @@ app.get('/:user.json', (req, res) ->
)
app.get('/:user/transactions', (req, res) ->
- db = require("redis").createClient()
+ db.createClient()
user = req.params.user
r = 'transactions': []
@@ -148,7 +149,7 @@ app.post('/users', (req, res) ->
if req.body.login
if req.body.password
bcrypt.hash(req.body.password, 12, (err, hash) ->
- db = require("redis").createClient()
+ db.createClient()
db.hget(req.body.login, 'password', (err, password) ->
bcrypt.compare(req.body.password, password, (err, match) ->
if match
@@ -171,7 +172,7 @@ app.post('/users', (req, res) ->
app.post('/:user/transactions', (req, res) ->
user = req.params.user
- db = require("redis").createClient()
+ db.createClient()
db.incr('transactions', (err, id) ->
db.hmset("#{user}:transactions:#{id}", req.body, ->
db.rpush("#{user}:transactions", id, ->
diff --git a/package.json b/package.json
index 6835d308..85e20f81 100644
--- a/package.json
+++ b/package.json
@@ -7,13 +7,14 @@
},
"dependencies": {
"express": "3.0.1",
- "consolidate": "0.5.0",
+ "consolidate": "git://github.com/simov/consolidate.js.git",
"hogan.js": "2.0.0",
"coffee-script": "1.4.0",
"connect-assets": "2.3.3",
"less": "1.3.1",
"redis": "0.8.2",
"passport": "0.1.15",
+ "passport-local": "0.1.6",
"bcrypt": "0.7.3"
}
}
diff --git a/views/_header.html b/views/_header.html
new file mode 100644
index 00000000..ab242716
--- /dev/null
+++ b/views/_header.html
@@ -0,0 +1,17 @@
+<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">
+ <a href="/login" class="navbar-link">Login</a>
+ </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>
+ </ul>
+ </div><!--/.nav-collapse -->
+ </div>
+ </div>
+</div>
diff --git a/views/about.html b/views/about.html
index edbd8d3e..790bfa62 100644
--- a/views/about.html
+++ b/views/about.html
@@ -1,184 +1,144 @@
-<!DOCTYPE html>
-<html>
- <head>
- <meta charset="utf-8" />
- <meta name="viewport" content="width=480, height=752, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
- <title>Vancouver Bitcoin</title>
- <link href="img/favicon.ico" rel="shortcut icon" />
- {{#css}}index{{/css}}
- </head>
- <body>
- <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">
- <a href="/login" class="navbar-link">Login</a>
- </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>
- </ul>
- </div><!--/.nav-collapse -->
- </div>
- </div>
- </div>
+<div class="row-fluid">
+ <div class="span6">
+ <h1>What are bitcoins?</h1>
+ <p>
+ Bitcoins are units of digital currency that can be
+ transferred over the Internet.
+ They get sent to a bitcoin address and stored in a digital wallet
+ that you can access with a
+ password. Creating and using a new wallet and address is free and as
+ easy as email -- <a href="https://blockchain.info/wallet/new">try it</a>.
+ </p>
+
+ <p>
+ Transactions between bitcoin addresses are
+ recorded in a public file and <a href="http://blockchain.info/unconfirmed-transactions">published on
+ the Internet</a>. This file, or "block chain", keeps track of what amounts are
+ stored at what addresses.
+ </p>
+
+ About every 10 minutes, 50 new bitcoins are
+ generated by a mathematical algorithm and distributed to people who
+ contribute computing power to the network. The
+ <a href="http://bitcoin.org">software to participate in the network</a> is free and open source so anyone can run it on their computer.
+ </p>
- <div></div>
+ <p>
+ Over time, fewer and fewer
+ bitcoins will be created until there are a total of
+ 21 million of them in circulation by the year 2040. Each bitcoin
+ is divisible up to 8 decimal places, making
+ it possible to transact very small portions of them.
+ </p>
+ </div>
+ <div class="span6">
+ <h1>Why use them?</h1>
+ <p>
+ They're free, fast, secure, and global. Merchants
+ don't get charged for accepting them and you don't
+ get charged for transferring them, even
+ internationally. There are no fees, prerequisites, or
+ limits. You can register addresses anonymously and
+ create as many accounts as you like. They can
+ never be frozen because no central authority
+ controls them. Whether you're sending a fraction of
+ a cent or a million dollars, the network doesn't
+ discriminate.
+ </p>
+
+ <p>
+ You can use bitcoins to securely store
+ and backup your savings and gain access to them
+ from anywhere that has Internet access. They tend to
+ appreciate in value over time because of their
+ limited supply so they make a good investment.
+ Unlike dollars and other national currencies, no
+ government or issuing authority can print more of
+ them.
+ </p>
- <div class="container-fluid">
- <div class="row-fluid">
- <div class="span6">
- <h1>What are bitcoins?</h1>
- <p>
- Bitcoins are units of digital currency that can be
- transferred over the Internet.
- They get sent to a bitcoin address and stored in a digital wallet
- that you can access with a
- password. Creating and using a new wallet and address is free and as
- easy as email -- <a href="https://blockchain.info/wallet/new">try it</a>.
- </p>
-
- <p>
- Transactions between bitcoin addresses are
- recorded in a public file and <a href="http://blockchain.info/unconfirmed-transactions">published on
- the Internet</a>. This file, or "block chain", keeps track of what amounts are
- stored at what addresses.
- </p>
-
- About every 10 minutes, 50 new bitcoins are
- generated by a mathematical algorithm and distributed to people who
- contribute computing power to the network. The
- <a href="http://bitcoin.org">software to participate in the network</a> is free and open source so anyone can run it on their computer.
- </p>
+ <p>
+ Bitcoins enable you to send free,
+ immediate payments to your friends and family
+ from your phone or laptop so you can pay a co-worker
+ back for coffee, transfer wages to family overseas,
+ or donate to organizations like WikiLeaks who have
+ been cut off by the major payment companies.
+ </p>
+ </div>
+</div>
- <p>
- Over time, fewer and fewer
- bitcoins will be created until there are a total of
- 21 million of them in circulation by the year 2040. Each bitcoin
- is divisible up to 8 decimal places, making
- it possible to transact very small portions of them.
- </p>
- </div>
- <div class="span6">
- <h1>Why use them?</h1>
- <p>
- They're free, fast, secure, and global. Merchants
- don't get charged for accepting them and you don't
- get charged for transferring them, even
- internationally. There are no fees, prerequisites, or
- limits. You can register addresses anonymously and
- create as many accounts as you like. They can
- never be frozen because no central authority
- controls them. Whether you're sending a fraction of
- a cent or a million dollars, the network doesn't
- discriminate.
- </p>
-
- <p>
- You can use bitcoins to securely store
- and backup your savings and gain access to them
- from anywhere that has Internet access. They tend to
- appreciate in value over time because of their
- limited supply so they make a good investment.
- Unlike dollars and other national currencies, no
- government or issuing authority can print more of
- them.
- </p>
- <p>
- Bitcoins enable you to send free,
- immediate payments to your friends and family
- from your phone or laptop so you can pay a co-worker
- back for coffee, transfer wages to family overseas,
- or donate to organizations like WikiLeaks who have
- been cut off by the major payment companies.
- </p>
- </div>
- </div>
+<div class="row-fluid">
+ <div class="span6">
+ <h1>Where can I get some?</h1>
+ <p>
+ Contact one of our trusted in-person <a href="/exchangers">exchangers</a>.
+ </p>
+ <p>
+ There are also several bitcoin markets operating online. The largest one in Canada
+ is <a href="http://cavirtex.com/">cavirtex.com</a> and is run out of Calgary. They link up buyers and sellers and facilitate trades by
+ allowing you to deposit and withdraw Canadian dollars directly from your bank account. A list of other
+ online exchanges and their rates can be found at <a href="http://bitcoincharts.com">bitcoincharts.com</a>.
+ </p>
- <div class="row-fluid">
- <div class="span6">
- <h1>Where can I get some?</h1>
- <p>
- Contact one of our trusted in-person <a href="/exchangers">exchangers</a>.
- </p>
+ <p>
+ You can also use sites like <a href="http://localbitcoins.com/">Local Bitcoins</a>, <a href="http://bitcoinary.com/">Bitcoinary</a>, and <a href="http://bitcoin-otc.com/">Bitcoin OTC</a> to find people to trade with directly if you want to take your chances with strangers.
+ </p>
+ </div>
- <p>
- There are also several bitcoin markets operating online. The largest one in Canada
- is <a href="http://cavirtex.com/">cavirtex.com</a> and is run out of Calgary. They link up buyers and sellers and facilitate trades by
- allowing you to deposit and withdraw Canadian dollars directly from your bank account. A list of other
- online exchanges and their rates can be found at <a href="http://bitcoincharts.com">bitcoincharts.com</a>.
- </p>
+ <div class="span6">
+ <h1>How is their price set?</h1>
+ <p>
+ Most merchants accepting bitcoin will use an
+ exchange rate from one of the online markets
+ to determine their equivalent
+ dollar value. The exchange rate is simply the last
+ price that some seller was able to charge some
+ buyer for bitcoins in the free market and is
+ governed by supply and demand.
+ </p>
- <p>
- You can also use sites like <a href="http://localbitcoins.com/">Local Bitcoins</a>, <a href="http://bitcoinary.com/">Bitcoinary</a>, and <a href="http://bitcoin-otc.com/">Bitcoin OTC</a> to find people to trade with directly if you want to take your chances with strangers.
- </p>
- </div>
+ <p>
+ Bitcoins aren't backed by any underlying
+ commodity or insured by any authority. They
+ have value as a form of currency due to their mathematically
+ guaranteed scarcity, security, ease of use,
+ distributed nature, lack of fees, divisibility, and
+ global recognition.
+ </p>
- <div class="span6">
- <h1>How is their price set?</h1>
- <p>
- Most merchants accepting bitcoin will use an
- exchange rate from one of the online markets
- to determine their equivalent
- dollar value. The exchange rate is simply the last
- price that some seller was able to charge some
- buyer for bitcoins in the free market and is
- governed by supply and demand.
- </p>
+ <p>
+ We peg our rates
+ to <a href="http://cavirtex.com/">cavirtex.com</a>.
+ </p>
+ </div>
+</div>
- <p>
- Bitcoins aren't backed by any underlying
- commodity or insured by any authority. They
- have value as a form of currency due to their mathematically
- guaranteed scarcity, security, ease of use,
- distributed nature, lack of fees, divisibility, and
- global recognition.
- </p>
+<div class="row-fluid">
+ <div class="span6">
+ <h1>What can I buy with them?</h1>
+ <p>
+ You can <a href="/merchants">spend them locally</a> at one of our participating merchants or check out
+ <a href="http://bitcoinmagazine.net/where-to-spend-your-bitcoins/">this article</a> for some other good suggestions.
+ The number of <a href="https://en.bitcoin.it/wiki/Trade">companies accepting bitcoins</a>
+ is growing quickly. We're working to get more stores accepting them in
+ Vancouver. We believe it'll be in
+ their best interest to avoid the transaction fees
+ charged by the credit card companies. Transaction
+ fees end up getting built into the prices we pay for
+ goods and services across the board so we're
+ indirectly subsidizing the big banks and credit card
+ companies whether we personally use their services
+ or not.
+ </p>
- <p>
- We peg our rates
- to <a href="http://cavirtex.com/">cavirtex.com</a>.
- </p>
- </div>
- </div>
-
- <div class="row-fluid">
- <div class="span6">
- <h1>What can I buy with them?</h1>
- <p>
- You can <a href="/merchants">spend them locally</a> at one of our participating merchants or check out
- <a href="http://bitcoinmagazine.net/where-to-spend-your-bitcoins/">this article</a> for some other good suggestions.
- The number of <a href="https://en.bitcoin.it/wiki/Trade">companies accepting bitcoins</a>
- is growing quickly. We're working to get more stores accepting them in
- Vancouver. We believe it'll be in
- their best interest to avoid the transaction fees
- charged by the credit card companies. Transaction
- fees end up getting built into the prices we pay for
- goods and services across the board so we're
- indirectly subsidizing the big banks and credit card
- companies whether we personally use their services
- or not.
- </p>
-
- </div>
- <div class="span6">
- <h1>Where can I learn more?</h1>
- <p>
- Come to our <a href="http://meetup.com/bitcoinvan/">monthly meetup group</a> or <a href="/exchangers">contact one of us</a> directly.
- </p>
- </div><!--/span-->
- </div><!--/row-->
-
- <hr>
-
- <footer>
- <p>&copy; VanBTC 2012</p>
- </footer>
- </div>
- </body>
-</html>
+ </div>
+ <div class="span6">
+ <h1>Where can I learn more?</h1>
+ <p>
+ Come to our <a href="http://meetup.com/bitcoinvan/">monthly meetup group</a> or <a href="/exchangers">contact one of us</a> directly.
+ </p>
+ </div>
+</div>
diff --git a/views/exchangers.html b/views/exchangers.html
index 6fe8a1c8..b9db0d74 100644
--- a/views/exchangers.html
+++ b/views/exchangers.html
@@ -10,6 +10,7 @@
div.row-fluid img { width: 150px; height: 150px; float: left; padding-right: 20px; }
b.price { color: white; }
p.labels { overflow: hidden; float: left; text-align: right; padding-right: 5px; }
+ div.row-fluid td.first { text-align: right; }
</style>
</head>
<body>
@@ -44,26 +45,29 @@
<div class="span6">
<h1>Meeting Procedure</h1>
<ul>
- <li>Contact one of us letting us know how much you want to spend and your availability</li>
- <li>We'll set a time to meet at a public place like a caf&eacute; or a bank</li>
- <li>We'll meet up and use the exchange rate above to convert the specified amount of CAD to BTC</li>
- <li>You provide us with a bitcoin address and count out the cash</li>
- <li>We send bitcoins to your address and take the cash</li>
+ <li>Contact one of us to let us know your availability and how much you want to spend</li>
+ <li>We'll arrange a time to meet at a public place like a caf&eacute; or a bank</li>
+ <li>At the time of meeting, we'll look up the exchange rate above and figure out how many bitcoins to send for the amount you specified</li>
+ <li>You'll provide us with a bitcoin address to send to and count out the cash for us</li>
+ <li>We'll send the bitcoins to your address using a phone or laptop</li>
+ <li>When the transaction is confirmed, we take the cash and you keep the bitcoins!</li>
</ul>
</div>
</div>
<div class="row-fluid">
- <div class="span4">
+ <div class="span6">
<h2>Adam Soltys</h2>
<img src="http://photos3.meetupstatic.com/photos/member/c/5/0/member_60963152.jpeg" />
- <p class="labels">
- <b>Neighbourhood:</b><br />
- <b>Email:</b><br />
- </p>
- <p>
- Hastings/Sunrise<br />
- <a href="mailto:[email protected]">[email protected]</a>
- </p>
+ <table>
+ <tr>
+ <td class="first"><b>Neighbourhood:</b></td>
+ <td>Hastings/Sunrise</td>
+ </tr>
+ <tr>
+ <td class="first"><b>Email:</b></td>
+ <td><a href="mailto:[email protected]">[email protected]</a></td>
+ </tr>
+ </table>
</div>
<!--
<div class="span4">
diff --git a/views/layout.html b/views/layout.html
new file mode 100644
index 00000000..ad45585e
--- /dev/null
+++ b/views/layout.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=480, height=752, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
+ <title>Vancouver Bitcoin</title>
+ <link href="img/favicon.ico" rel="shortcut icon" />
+ {{#css}}index{{/css}}
+ </head>
+ <body>
+ <div class="container-fluid">
+ {{body}}
+ </div>
+ <hr>
+ <footer>
+ <p>&copy; VanBTC 2012</p>
+ </footer>
+ </body>
+</html>