Skip to content

Commit

Permalink
Fixed #13 and config admin user
Browse files Browse the repository at this point in the history
  • Loading branch information
koostudios committed Apr 26, 2012
1 parent aec4e6a commit abe4c8b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion controllers/users.coffee
@@ -1,13 +1,14 @@
cradle = require 'cradle'
crypto = require 'crypto'
config = require('../config').config
admin = require('../config').admin

class User
constructor: () ->
@connect = new cradle.Connection config.db.host, config.db.port, {
cache: true
raw: false
auth: {username: config.db.user, password: config.db.pass}
auth: {username: admin.user, password: admin.pass}
}
@db = @connect.database '_users'

Expand Down
4 changes: 2 additions & 2 deletions main.coffee
Expand Up @@ -86,9 +86,9 @@ app.post '/register', (req, res) ->
type: 'user'
users.register data, (err,docs) ->
if err
res.render 'register',
res.render front + 'register',
locals:
title: config.site.title
title: config.site.title + ' / Register'
message: JSON.stringify err
config: config
else
Expand Down
2 changes: 1 addition & 1 deletion views/admin/editor.jade
Expand Up @@ -25,4 +25,4 @@ form#editor(method= 'post', action= '/admin/edit')
textarea.editor-html(name= 'body', rows= '20')!= article.body
input#submit(type="submit", value="Publish")
script(type= 'text/javascript', src= 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js')
script(type= 'text/javascript', src= '/js/editor.js')
script(type= 'text/javascript', src= '/admin/js/editor.js')
2 changes: 1 addition & 1 deletion views/admin/new.jade
Expand Up @@ -24,4 +24,4 @@ form#editor(method= 'post', action= '/admin/edit')
textarea.editor-html(name="body", rows="20")
input#submit(type="submit", value="Publish")
script(type= 'text/javascript', src= 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js')
script(type= 'text/javascript', src= '/js/editor.js')
script(type= 'text/javascript', src= '/admin/js/editor.js')
2 changes: 1 addition & 1 deletion views/admin/public/css/style.css
@@ -1,5 +1,5 @@
::selection {
background: #FFA;
background: #FFC;
}

* {
Expand Down

0 comments on commit abe4c8b

Please sign in to comment.