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
).property('state', 'name', 'payload')
isWorking: (->
@get('state') == 'working'
).property('state')
urlJob: (->
"/#{@get('repository')}/jobs/#{@get('job_id')}" if @get('state') == 'working'
).property('repository', 'job_id', 'state')

View File

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

View File

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

View File

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

File diff suppressed because one or more lines are too long