
Previously we showed only accounts and repositories, to which you have admin access. To improve usability, it's better to show all accounts and all repositories, but explain why part of the repositories are not manageable.
34 lines
746 B
CoffeeScript
34 lines
746 B
CoffeeScript
require 'travis/model'
|
|
|
|
@Travis.Hook = Travis.Model.extend
|
|
name: DS.attr('string')
|
|
ownerName: DS.attr('string')
|
|
description: DS.attr('string')
|
|
active: DS.attr('boolean')
|
|
admin: DS.attr('boolean')
|
|
|
|
account: (->
|
|
@get('slug').split('/')[0]
|
|
).property('slug')
|
|
|
|
slug: (->
|
|
"#{@get('ownerName')}/#{@get('name')}"
|
|
).property('ownerName', 'name')
|
|
|
|
urlGithub: (->
|
|
"http://github.com/#{@get('slug')}"
|
|
).property()
|
|
|
|
urlGithubAdmin: (->
|
|
"http://github.com/#{@get('slug')}/settings/hooks#travis_minibucket"
|
|
).property()
|
|
|
|
toggle: ->
|
|
return if @get('isSaving')
|
|
transaction = @get('store').transaction()
|
|
transaction.add this
|
|
|
|
@set 'active', !@get('active')
|
|
|
|
transaction.commit()
|