Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

magic things

  • Loading branch information...
commit df5abd2e02cd36a6eaf1798812a8ff47e50f8912 1 parent d48895c
@rashfael authored
View
100 app/application.coffee
@@ -11,62 +11,62 @@ require 'lib/iosync'
# The application object
module.exports = class Application extends Chaplin.Application
- # Set your application name here so the document title is set to
- # “Controller title – Site title” (see Layout#adjustTitle)
- title: 'Shack Karma'
- serverUrl: 'http://localhost:9000/'
+ # Set your application name here so the document title is set to
+ # “Controller title – Site title” (see Layout#adjustTitle)
+ title: 'Shack Karma'
+ serverUrl: 'http://localhost:9000/'
- initialize: ->
- super
+ initialize: ->
+ super
- # Initialize core components
- @initDispatcher()
- @initLayout()
- @initMediator()
- #@initRouter()
- @router = new Router()
- @initSocket ->
- auth = new AuthenticationController()
+ # Initialize core components
+ @initDispatcher()
+ @initLayout()
+ @initMediator()
+ #@initRouter()
+ @router = new Router()
+ @initSocket ->
+ auth = new AuthenticationController()
- mediator.subscribe '!auth:success', =>
- @initControllers()
- # register routes late
- routes @router.match
- @router.startHistory()
- #mediator.publish '!router:route', ''
+ mediator.subscribe '!auth:success', =>
+ @initControllers()
+ # register routes late
+ routes @router.match
+ @router.startHistory()
+ #mediator.publish '!router:route', ''
- Object.freeze? this
+ Object.freeze? this
- # Override standard layout initializer
- # ------------------------------------
- initLayout: ->
- # Use an application-specific Layout class. Currently this adds
- # no features to the standard Chaplin Layout, it’s an empty placeholder.
- @layout = new Layout {@title}
+ # Override standard layout initializer
+ # ------------------------------------
+ initLayout: ->
+ # Use an application-specific Layout class. Currently this adds
+ # no features to the standard Chaplin Layout, it’s an empty placeholder.
+ @layout = new Layout {@title}
- # Instantiate common controllers
- # ------------------------------
- initControllers: ->
- # These controllers are active during the whole application runtime.
- # You don’t need to instantiate all controllers here, only special
- # controllers which do not to respond to routes. They may govern models
- # and views which are needed the whole time, for example header, footer
- # or navigation views.
- # e.g. new NavigationController()
- # new SessionController()
- new HeaderController()
+ # Instantiate common controllers
+ # ------------------------------
+ initControllers: ->
+ # These controllers are active during the whole application runtime.
+ # You don’t need to instantiate all controllers here, only special
+ # controllers which do not to respond to routes. They may govern models
+ # and views which are needed the whole time, for example header, footer
+ # or navigation views.
+ # e.g. new NavigationController()
+ # new SessionController()
+ new HeaderController()
new FooterController()
- # Create additional mediator properties
- # -------------------------------------
- initMediator: ->
- # Create a user property
- Chaplin.mediator.user = null
- # Add additional application-specific properties and methods
- # Seal the mediator
- # Chaplin.mediator.seal()
+ # Create additional mediator properties
+ # -------------------------------------
+ initMediator: ->
+ # Create a user property
+ Chaplin.mediator.user = null
+ # Add additional application-specific properties and methods
+ # Seal the mediator
+ # Chaplin.mediator.seal()
- initSocket: (cb) =>
- socket = io.connect @serverUrl
- Backbone.socket = socket
- socket.on 'connect', cb
+ initSocket: (cb) =>
+ socket = io.connect @serverUrl
+ Backbone.socket = socket
+ socket.on 'connect', cb
View
1  app/views/templates/deedTable.jade
@@ -1,5 +1,6 @@
thead
tr
th Name
+ th Karma Points
th Description
tbody
View
1  app/views/templates/deed_add.jade
@@ -6,6 +6,7 @@ include mixins/form_helpers
form.form-horizontal
fieldset
mixin textfield({name:'name', label:'Name'})
+ mixin textfield({name:'karma', label:'Karma Points'})
mixin textarea({name:'description', label:'Description'})
.form-actions
button.btn.btn-primary Save
View
1  app/views/templates/deed_item.jade
@@ -1,3 +1,4 @@
.page-header
h1= 'Deed ' + name
+ h4= 'Karma Points: ' + karma
p= description
View
1  app/views/templates/deed_list_item.jade
@@ -1,2 +1,3 @@
td= name
+td= karma
td= description
View
1  lib/schemas/Deed.coffee
@@ -5,5 +5,6 @@ Schema = mongoose.Schema
schema = new Schema
name: String
description: String
+ karma: Number
module.exports = mongoose.model 'Deed', schema, 'deeds'
Please sign in to comment.
Something went wrong with that request. Please try again.