try adding Travis.Model.find() since Ember.Model does not delegate findAll()

This commit is contained in:
Sven Fuchs 2012-09-16 17:18:27 +02:00
parent 3d0b4274ae
commit 1fcb01b545
5 changed files with 23 additions and 4 deletions

View File

@ -27,6 +27,10 @@ require 'travis/model'
name + ': ' + state name + ': ' + state
).property('state', 'name', 'payload') ).property('state', 'name', 'payload')
isWorking: (->
@get('state') == 'working'
).property('state')
urlJob: (-> urlJob: (->
"/#{@get('repository')}/jobs/#{@get('job_id')}" if @get('state') == 'working' "/#{@get('repository')}/jobs/#{@get('job_id')}" if @get('state') == 'working'
).property('repository', 'job_id', 'state') ).property('repository', 'job_id', 'state')

View File

@ -10,7 +10,11 @@
{{#each worker in group}} {{#each worker in group}}
<li class="worker"> <li class="worker">
<div class="icon"></div> <div class="icon"></div>
{{#if worker.isWorking}}
<a {{bindAttr href="worker.urlJob"}} {{bindAttr title="worker.lastSeenAt"}} {{action route}}>{{worker.display}}</a> <a {{bindAttr href="worker.urlJob"}} {{bindAttr title="worker.lastSeenAt"}} {{action route}}>{{worker.display}}</a>
{{else}}
{{worker.display}}
{{/if}}
</li> </li>
{{/each}} {{/each}}
</ul> </ul>

View File

@ -12,6 +12,12 @@
this this
@Travis.Model.reopenClass @Travis.Model.reopenClass
find: ->
if arguments.length == 0
Travis.app.store.findAll(this)
else
@_super.apply(this, arguments)
filter: (callback) -> filter: (callback) ->
Travis.app.store.filter(this, callback) Travis.app.store.filter(this, callback)

View File

@ -11,8 +11,13 @@
// minispade.require('mocks') // minispade.require('mocks')
minispade.require('app') minispade.require('app')
if(location.hostname != 'localhost') {
Travis.Pusher.KEY = '23ed642e81512118260e' Travis.Pusher.KEY = '23ed642e81512118260e'
}
$(function() {
Travis.run() Travis.run()
});
</script> </script>
</head> </head>
<body> <body>

File diff suppressed because one or more lines are too long