Merge branch 'master' into dashboard
Conflicts: assets/scripts/app/controllers.coffee assets/scripts/app/routes.coffee
This commit is contained in:
commit
a5978dd36f
|
@ -8,6 +8,7 @@ cache:
|
||||||
bundler: true
|
bundler: true
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
|
fast_finish: true
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- rvm: 2.1.2
|
- rvm: 2.1.2
|
||||||
env: 'TEST_SUITE=phantomjs'
|
env: 'TEST_SUITE=phantomjs'
|
||||||
|
|
|
@ -48,7 +48,8 @@ Ember.Handlebars.registerHelper('label', (options) ->
|
||||||
options.hash.for = id
|
options.hash.for = id
|
||||||
options.hashTypes.for = 'STRING'
|
options.hashTypes.for = 'STRING'
|
||||||
options.hashContexts.for = this
|
options.hashContexts.for = this
|
||||||
options.fn = Ember.Handlebars.compile("{{view.content}}")
|
if options.hash.content
|
||||||
|
options.fn = Ember.Handlebars.compile("{{view.content}}")
|
||||||
|
|
||||||
Ember.Handlebars.helpers.view.call(this, view, options)
|
Ember.Handlebars.helpers.view.call(this, view, options)
|
||||||
)
|
)
|
||||||
|
|
|
@ -61,6 +61,7 @@ require 'routes/getting_started'
|
||||||
require 'routes/insufficient_oauth_permissions'
|
require 'routes/insufficient_oauth_permissions'
|
||||||
require 'routes/job'
|
require 'routes/job'
|
||||||
require 'routes/main/index'
|
require 'routes/main/index'
|
||||||
|
require 'routes/main/error'
|
||||||
require 'routes/main/my_repositories'
|
require 'routes/main/my_repositories'
|
||||||
require 'routes/main/recent'
|
require 'routes/main/recent'
|
||||||
require 'routes/main/repositories'
|
require 'routes/main/repositories'
|
||||||
|
|
|
@ -15,11 +15,11 @@ Route = TravisRoute.extend
|
||||||
|
|
||||||
actions:
|
actions:
|
||||||
afterSignIn: ->
|
afterSignIn: ->
|
||||||
@transitionTo('index')
|
@transitionTo('main')
|
||||||
return true
|
return true
|
||||||
|
|
||||||
redirect: ->
|
redirect: ->
|
||||||
if @signedIn()
|
if @signedIn()
|
||||||
@transitionTo('index')
|
@transitionTo('main')
|
||||||
|
|
||||||
Travis.AuthRoute = Route
|
Travis.AuthRoute = Route
|
||||||
|
|
|
@ -8,12 +8,14 @@
|
||||||
<li class="home">
|
<li class="home">
|
||||||
{{#link-to "main"}}Home{{/link-to}}
|
{{#link-to "main"}}Home{{/link-to}}
|
||||||
</li>
|
</li>
|
||||||
<li>
|
{{#unless config.enterprise}}
|
||||||
<a href="http://blog.travis-ci.com">Blog</a>
|
<li>
|
||||||
</li>
|
<a href="http://blog.travis-ci.com">Blog</a>
|
||||||
<li>
|
</li>
|
||||||
<a href="http://traviscistatus.com">Status</a>
|
<li>
|
||||||
</li>
|
<a href="http://traviscistatus.com">Status</a>
|
||||||
|
</li>
|
||||||
|
{{/unless}}
|
||||||
{{#unless config.pro}}
|
{{#unless config.pro}}
|
||||||
<li class="menu community">
|
<li class="menu community">
|
||||||
<p class="handle">
|
<p class="handle">
|
||||||
|
|
|
@ -82,7 +82,10 @@ $.extend Travis,
|
||||||
show_repos_hint: 'private'
|
show_repos_hint: 'private'
|
||||||
avatar_default_url: 'https://travis-ci.org/images/ui/default-avatar.png'
|
avatar_default_url: 'https://travis-ci.org/images/ui/default-avatar.png'
|
||||||
pusher_log_fallback: $('meta[name="travis.pusher_log_fallback"]').attr('value') == 'true'
|
pusher_log_fallback: $('meta[name="travis.pusher_log_fallback"]').attr('value') == 'true'
|
||||||
pro: $('meta[name="travis.pro"]').attr('value') == 'true'
|
# for now I set pro to true also for enterprise, but it should be changed
|
||||||
|
# to allow more granular config later
|
||||||
|
pro: $('meta[name="travis.pro"]').attr('value') == 'true' || $('meta[name="travis.enterprise"]').attr('value') == 'true'
|
||||||
|
enterprise: $('meta[name="travis.enterprise"]').attr('value') == 'true'
|
||||||
|
|
||||||
pages_endpoint: pages_endpoint || billing_endpoint
|
pages_endpoint: pages_endpoint || billing_endpoint
|
||||||
billing_endpoint: billing_endpoint
|
billing_endpoint: billing_endpoint
|
||||||
|
|
|
@ -44,6 +44,11 @@ if ENV['TRAVIS_PRO']
|
||||||
ENV['CODE_CLIMATE'] = 'true' unless ENV.has_key?('CODE_CLIMATE')
|
ENV['CODE_CLIMATE'] = 'true' unless ENV.has_key?('CODE_CLIMATE')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if ENV['TRAVIS_ENTERPRISE']
|
||||||
|
ENV['SSH_KEY_ENABLED'] = 'true' unless ENV.has_key?('SSH_KEY_ENABLED')
|
||||||
|
ENV['CACHES_ENABLED'] = 'true' unless ENV.has_key?('CACHES_ENABLED')
|
||||||
|
end
|
||||||
|
|
||||||
run Travis::Web::App.build(
|
run Travis::Web::App.build(
|
||||||
environment: ENV['RACK_ENV'] || 'development',
|
environment: ENV['RACK_ENV'] || 'development',
|
||||||
api_endpoint: ENV['API_ENDPOINT'],
|
api_endpoint: ENV['API_ENDPOINT'],
|
||||||
|
@ -62,6 +67,8 @@ run Travis::Web::App.build(
|
||||||
charm_key: ENV['CHARM_KEY'],
|
charm_key: ENV['CHARM_KEY'],
|
||||||
customer_io_site_id: ENV['CUSTOMER_IO_SITE_ID'],
|
customer_io_site_id: ENV['CUSTOMER_IO_SITE_ID'],
|
||||||
pro: ENV['TRAVIS_PRO'],
|
pro: ENV['TRAVIS_PRO'],
|
||||||
|
enterprise: ENV['TRAVIS_ENTERPRISE'],
|
||||||
code_climate: ENV['CODE_CLIMATE'],
|
code_climate: ENV['CODE_CLIMATE'],
|
||||||
code_climate_url: ENV['CODE_CLIMATE_URL']
|
code_climate_url: ENV['CODE_CLIMATE_URL'],
|
||||||
|
assets_host: ENV['ASSETS_HOST']
|
||||||
)
|
)
|
||||||
|
|
|
@ -158,13 +158,24 @@ class Travis::Web::App
|
||||||
content.gsub!(/\{\{title\}\}/, ENV['SITE_TITLE'] || default_title)
|
content.gsub!(/\{\{title\}\}/, ENV['SITE_TITLE'] || default_title)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def set_assets_host(content)
|
||||||
|
content.gsub!(/\{\{assets_host\}\}/, ENV['ASSETS_HOST'] || '')
|
||||||
|
end
|
||||||
|
|
||||||
def set_config(string, opts = {})
|
def set_config(string, opts = {})
|
||||||
string.gsub! %r(<meta (rel|name)="travis\.([^"]*)" (href|value)="([^"]*)"[^>]*>) do
|
string.gsub! %r(<meta (rel|name)="travis\.([^"]*)" (href|value)="([^"]*)"[^>]*>) do
|
||||||
%(<meta #{$1}="travis.#{$2}" #{$3}="#{options[$2.to_sym] || $4}">)
|
%(<meta #{$1}="travis.#{$2}" #{$3}="#{options[$2.to_sym] || $4}">)
|
||||||
end
|
end
|
||||||
|
|
||||||
string.gsub! %r{(src|href)="(?:\/?)((styles|scripts)\/[^"]*)"} do
|
string.gsub! %r{(src|href)="(?:\/?)((styles|scripts)\/[^"]*)"} do
|
||||||
%(#{$1}=#{opts[:alt] ? "#{S3_URL}/#{opts[:alt]}/#{$2}":"/#{$2}"})
|
src = if options[:assets_host]
|
||||||
|
"#{options[:assets_host].chomp('/')}/#{$2}"
|
||||||
|
elsif opts[:alt]
|
||||||
|
"#{S3_URL}/#{opts[:alt]}/#{$2}"
|
||||||
|
else
|
||||||
|
"/#{$2}"
|
||||||
|
end
|
||||||
|
%(#{$1}="#{src}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
<meta name="travis.pusher_log_fallback" value="false">
|
<meta name="travis.pusher_log_fallback" value="false">
|
||||||
<meta name="travis.charm_key" value="gy5gx7dy6dh86hxzkz1wmtvupwvievu">
|
<meta name="travis.charm_key" value="gy5gx7dy6dh86hxzkz1wmtvupwvievu">
|
||||||
<meta name="travis.pro" value="false">
|
<meta name="travis.pro" value="false">
|
||||||
|
<meta name="travis.enterprise" value="false">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>{{title}}</title>
|
<title>{{title}}</title>
|
||||||
<link rel="dns-prefetch" href="//api.travis-ci.org">
|
<link rel="dns-prefetch" href="//api.travis-ci.org">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user