Merge branch 'insufficient-oauth-permissions'
Conflicts: assets/scripts/app/routes.coffee
This commit is contained in:
commit
39b8af12f9
BIN
assets/images/travis-crying.png
Normal file
BIN
assets/images/travis-crying.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
|
@ -87,6 +87,7 @@ Travis.Router.map ->
|
||||||
@route 'tab', path: ':tab'
|
@route 'tab', path: ':tab'
|
||||||
|
|
||||||
@route 'first_sync'
|
@route 'first_sync'
|
||||||
|
@route 'insufficient_oauth_permissions'
|
||||||
@route 'stats', path: '/stats'
|
@route 'stats', path: '/stats'
|
||||||
@route 'auth', path: '/auth'
|
@route 'auth', path: '/auth'
|
||||||
|
|
||||||
|
@ -114,12 +115,7 @@ Travis.GettingStartedRoute = Travis.Route.extend
|
||||||
renderTemplate: ->
|
renderTemplate: ->
|
||||||
@render('no_owned_repos')
|
@render('no_owned_repos')
|
||||||
|
|
||||||
Travis.FirstSyncRoute = Travis.Route.extend
|
Travis.SimpleLayoutRoute = Travis.Route.extend
|
||||||
actions:
|
|
||||||
redirectToGettingStarted: ->
|
|
||||||
# do nothing, we are showing first sync, so it's normal that there is
|
|
||||||
# no owned repos
|
|
||||||
|
|
||||||
setupController: ->
|
setupController: ->
|
||||||
$('body').attr('id', 'home')
|
$('body').attr('id', 'home')
|
||||||
@container.lookup('controller:repos').activate()
|
@container.lookup('controller:repos').activate()
|
||||||
|
@ -130,6 +126,18 @@ Travis.FirstSyncRoute = Travis.Route.extend
|
||||||
@render 'top', outlet: 'top'
|
@render 'top', outlet: 'top'
|
||||||
@_super.apply(this, arguments)
|
@_super.apply(this, arguments)
|
||||||
|
|
||||||
|
Travis.FirstSyncRoute = Travis.SimpleLayoutRoute.extend
|
||||||
|
actions:
|
||||||
|
redirectToGettingStarted: ->
|
||||||
|
# do nothing, we are showing first sync, so it's normal that there is
|
||||||
|
# no owned repos
|
||||||
|
|
||||||
|
Travis.InsufficientOauthPermissionsRoute = Travis.SimpleLayoutRoute.extend
|
||||||
|
setupController: (controller) ->
|
||||||
|
@_super.apply this, arguments
|
||||||
|
existingUser = document.location.hash.match(/#existing[_-]user/)
|
||||||
|
controller.set('existingUser', existingUser)
|
||||||
|
|
||||||
Travis.IndexCurrentRoute = Travis.Route.extend Travis.SetupLastBuild,
|
Travis.IndexCurrentRoute = Travis.Route.extend Travis.SetupLastBuild,
|
||||||
renderTemplate: ->
|
renderTemplate: ->
|
||||||
@render 'repo'
|
@render 'repo'
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
<div id="insufficient-permissions">
|
||||||
|
<img src="/images/travis-crying.png" class="sad-travis" width="150">
|
||||||
|
|
||||||
|
<p class="insufficient-permissions-head">
|
||||||
|
Oops, looks like something went wrong!
|
||||||
|
</p>
|
||||||
|
<p class="insufficient-permissions-more">
|
||||||
|
It looks like we don't have authorization to access your GitHub account.<br>
|
||||||
|
Please review your GitHub settings and try again.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="insufficient-permissions-row">
|
||||||
|
<div class="insufficient-permissions-column">
|
||||||
|
<p class="align-right">
|
||||||
|
More information on GithubAuth
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="insufficient-permissions-column">
|
||||||
|
<p>
|
||||||
|
More information on GithubAuth
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="insufficient-permissions-row">
|
||||||
|
{{#if existingUser}}
|
||||||
|
<p>This will be shown if #existing-user is added to the url</p>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -50,4 +50,46 @@
|
||||||
margin: 0 0 50px 0
|
margin: 0 0 50px 0
|
||||||
height: 150px
|
height: 150px
|
||||||
background: inline-image('travis-mascot-150.png') 50% 0 no-repeat
|
background: inline-image('travis-mascot-150.png') 50% 0 no-repeat
|
||||||
background-size: 150px 150px
|
background-size: 150px 150px
|
||||||
|
|
||||||
|
#insufficient-permissions
|
||||||
|
width: 850px
|
||||||
|
margin: 0 auto
|
||||||
|
padding-top: 30px
|
||||||
|
font-family: 'Source Sans Pro', Helvetica, sans-serif
|
||||||
|
font-size: 17px
|
||||||
|
line-height: 26px
|
||||||
|
text-align: center
|
||||||
|
|
||||||
|
.insufficient-permissions-head
|
||||||
|
font-size: 35px
|
||||||
|
color: #337389
|
||||||
|
font-weight: 800
|
||||||
|
text-align: center
|
||||||
|
padding-bottom: 20px
|
||||||
|
margin: 0
|
||||||
|
|
||||||
|
.insufficient-permissions-more
|
||||||
|
color: #919191
|
||||||
|
font-size: 20px
|
||||||
|
font-weight: 400
|
||||||
|
text-align: center
|
||||||
|
padding: 0
|
||||||
|
margin: 0
|
||||||
|
|
||||||
|
.sad-travis
|
||||||
|
border: 0px
|
||||||
|
padding-bottom: 30px
|
||||||
|
align: center
|
||||||
|
|
||||||
|
.insufficient-permissions-row
|
||||||
|
display: inline-block
|
||||||
|
clear: all
|
||||||
|
padding-top: 30px
|
||||||
|
|
||||||
|
.insufficient-permissions-column
|
||||||
|
padding-right: 28px
|
||||||
|
max-width: 380px
|
||||||
|
display: block
|
||||||
|
float: left
|
||||||
|
clear: all
|
|
@ -4,7 +4,21 @@ class Travis::Web::ApiRedirect < Sinatra::Base
|
||||||
disable :protection, :static
|
disable :protection, :static
|
||||||
set api_endpoint: 'https://api.travis-ci.org'
|
set api_endpoint: 'https://api.travis-ci.org'
|
||||||
|
|
||||||
get '/:owner_name/:name.png' do
|
class NotPublicImages
|
||||||
|
Match = Struct.new(:captures)
|
||||||
|
|
||||||
|
def initialize(pattern, except)
|
||||||
|
@except = except
|
||||||
|
@pattern = pattern
|
||||||
|
@captures = Match.new([])
|
||||||
|
end
|
||||||
|
|
||||||
|
def match(str)
|
||||||
|
@captures if str =~ @pattern && str !~ @except
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
get NotPublicImages.new(%r{^/([^/]+)/([^/]+).png}, %r{^/images/}) do
|
||||||
redirect!
|
redirect!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -14,6 +28,10 @@ class Travis::Web::ApiRedirect < Sinatra::Base
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def public_image?
|
||||||
|
params[:owner_name] == 'images'
|
||||||
|
end
|
||||||
|
|
||||||
def redirect!(path = nil)
|
def redirect!(path = nil)
|
||||||
path = File.join(settings.api_endpoint, path || request.fullpath)
|
path = File.join(settings.api_endpoint, path || request.fullpath)
|
||||||
redirect(path, 301)
|
redirect(path, 301)
|
||||||
|
|
BIN
public/images/travis-crying.png
Normal file
BIN
public/images/travis-crying.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
Loading…
Reference in New Issue
Block a user