From 796e830a36d42148c85ca75501469907fa95e162 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Fri, 25 Oct 2013 13:10:22 +0200 Subject: [PATCH] Add page about insufficient oauth permissions --- assets/scripts/app/routes.coffee | 10 +++++++++- .../app/templates/insufficient_oauth_permissions.hbs | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 assets/scripts/app/templates/insufficient_oauth_permissions.hbs diff --git a/assets/scripts/app/routes.coffee b/assets/scripts/app/routes.coffee index b1dac327..8e06a2c7 100644 --- a/assets/scripts/app/routes.coffee +++ b/assets/scripts/app/routes.coffee @@ -99,6 +99,7 @@ Travis.Router.map -> @route 'getting_started' @route 'first_sync' + @route 'insufficient_oauth_permissions' @route 'stats', path: '/stats' @route 'auth', path: '/auth' @route 'notFound', path: '/not-found' @@ -138,7 +139,7 @@ Travis.GettingStartedRoute = Ember.Route.extend @render 'repos', outlet: 'left' @_super.apply(this, arguments) -Travis.FirstSyncRoute = Ember.Route.extend +Travis.SimpleLayoutRoute = Ember.Route.extend setupController: -> $('body').attr('id', 'home') @container.lookup('controller:repos').activate() @@ -149,6 +150,13 @@ Travis.FirstSyncRoute = Ember.Route.extend @render 'top', outlet: 'top' @_super.apply(this, arguments) +Travis.FirstSyncRoute = Travis.SimpleLayoutRoute.extend() +Travis.InsufficientOauthPermissionsRoute = Travis.SimpleLayoutRoute.extend + setupController: (controller) -> + @_super.apply this, arguments + existingUser = document.location.hash.match(/#existing[_-]user/) + controller.set('existingUser', existingUser) + Travis.IndexCurrentRoute = Ember.Route.extend Travis.SetupLastBuild, renderTemplate: -> @render 'repo' diff --git a/assets/scripts/app/templates/insufficient_oauth_permissions.hbs b/assets/scripts/app/templates/insufficient_oauth_permissions.hbs new file mode 100644 index 00000000..53480599 --- /dev/null +++ b/assets/scripts/app/templates/insufficient_oauth_permissions.hbs @@ -0,0 +1,5 @@ +

We need more permissions to allow you to use Travis.

+ +{{#if existingUser}} +

This will be shown if #existing-user is added to the url

+{{/if}}