Skip to content

Commit

Permalink
Added /add page
Browse files Browse the repository at this point in the history
  • Loading branch information
shanecowherd committed Oct 14, 2012
1 parent 7224eb4 commit 2b2272b
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ app.get '/', (req, res) ->
res.render('index', { title: 'Ok, lets go!' });
return

app.get '/add', (req, res) ->
res.render('add', { title: 'Ok, lets go!' });
return

app.get '/places.json', (req, res) ->
Place.findByLocation req.query, (err, places) ->
if err
Expand Down
2 changes: 1 addition & 1 deletion models/place.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ schema.statics.build = (form) ->
website: form.website
image_url: form.image_url
image_credit: form.image_credit
location: if form.lon? and form.lon? then [form.lon, form.lat]
location: if form.lon? and form.lat? then [form.lon, form.lat]

module.exports = Mongoose.model 'Place', schema
34 changes: 34 additions & 0 deletions views/add.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
form(action="/places.json", method="post")

input(type="text", name="name")
| Name
br
input(type="text", name="description")
| Description
br
input(type="text", name="lon")
| Lon
br
input(type="text", name="lat")
| Lat
br
input(type="text", name="tags")
| Tags (comma,del)
br
input(type="text", name="category")
| Category
br
input(type="text", name="address")
| Address
br
input(type="text", name="website")
| Website
br
input(type="text", name="image_url")
| Image Url
br
input(type="text", name="image_credit")
| Image Credit
br
br
input(type="submit", value="submit")
2 changes: 1 addition & 1 deletion views/layout.jade
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ html
script(src='http://updateyourbrowser.net/uyb.js')
!= js('application')
body
.navbar.navbar-fixed-top.navbar-inverse
.navbar.navbar-top.navbar-inverse
.navbar-inner
.container
a.brand(href='#')
Expand Down

0 comments on commit 2b2272b

Please sign in to comment.