Merge pull request #392 from travis-ci/fix-owner-on-magnum

Authenticate owner request
This commit is contained in:
Lisa P 2015-08-26 13:14:08 -04:00
commit 58f540457b
4 changed files with 11 additions and 5 deletions

View File

@ -7,7 +7,6 @@ Route = TravisRoute.extend
filter: { replace: true }
model: ->
apiEndpoint = config.apiEndpoint
console.log(@auth)
$.ajax(apiEndpoint + '/v3/repos?repository.active=true', {
# $.ajax(apiEndpoint + '/v3/#{params.owner}?include=user.repositories,organization.repositories,build.commit', {
headers: {

View File

@ -4,11 +4,15 @@
`import config from 'travis/config/environment'`
Route = TravisRoute.extend
deactivate: ->
@controllerFor('loading').set('layoutName', null)
model: (params) ->
$.get(config.apiEndpoint + "/v3/owner/#{params.owner}")
options = {}
if @get('auth.signedIn')
options.headers = { Authorization: "token #{@auth.token()}" }
$.ajax(config.apiEndpoint + "/v3/owner/#{params.owner}", options)
beforeModel: ->
@controllerFor('loading').set('layoutName', 'simple')

View File

@ -10,6 +10,9 @@ Route = TravisRoute.extend
"#{model.name}"
model: (params, transition) ->
$.get(config.apiEndpoint + "/v3/owner/#{transition.params.owner.owner}?include=user.repositories,organization.repositories,build.commit,repository.active")
options = {}
if @get('auth.signedIn')
options.headers = { Authorization: "token #{@auth.token()}" }
$.ajax(config.apiEndpoint + "/v3/owner/#{transition.params.owner.owner}?include=user.repositories,organization.repositories,build.commit,repository.active", options)
`export default Route`

View File

@ -1,6 +1,6 @@
{{#if repo.private }}
{{!-- {{#if repo.private }}
<div class="tile-lock"><span class="icon icon-lock"></span></div>
{{/if}}
{{/if}} --}}
<div class="repo">
{{#if isAnimating}}
<span class="icon-owner-receiving"><i></i><i></i><i></i></span>