Merge pull request #323 from travis-ci/ps-travis-pro-merge
Update to Ember 1.9.1, merge Travis CI Pro
This commit is contained in:
commit
84878e9394
|
@ -1,12 +1,19 @@
|
|||
language: ruby
|
||||
rvm:
|
||||
- 2.1.2
|
||||
|
||||
|
||||
sudo: false
|
||||
|
||||
cache:
|
||||
bundler: true
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- rvm: 2.1.2
|
||||
env: 'TEST_SUITE=phantomjs'
|
||||
- rvm: 2.1.2
|
||||
env: "TEST_SUITE=saucelabs BROWSER='firefox::Windows XP'"
|
||||
|
||||
env:
|
||||
global:
|
||||
- secure: "RFuCOppyjWHC4XWKtQlgS4zO4B6KVxytdX8+G5jRY3XM+OEGte8VDD88gZLM\nKDpkqMFDbNJAVTsh1kMANCTct2ONi30RTxuJWLtRyK7RE5zCcaGbAkTNZgXo\nOR5OWLEPJZbNfbh17H6J7izTy6yiLR+CsVP1wMgeVusP0eoDhCA="
|
||||
|
|
BIN
assets/images/ui/activated.png
Normal file
BIN
assets/images/ui/activated.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 137 B |
BIN
assets/images/ui/charmtab.png
Normal file
BIN
assets/images/ui/charmtab.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.0 KiB |
BIN
assets/images/ui/slider-closed.png
Normal file
BIN
assets/images/ui/slider-closed.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 119 B |
BIN
assets/images/ui/slider-open.png
Normal file
BIN
assets/images/ui/slider-open.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 118 B |
|
@ -145,3 +145,45 @@ unless window.TravisApplication
|
|||
currentDate: ->
|
||||
new Date()
|
||||
)
|
||||
|
||||
onUserUpdate: (user) ->
|
||||
if Travis.config.pro
|
||||
@identifyCustomer(user)
|
||||
@subscribePusher(user)
|
||||
@setupCharm(user)
|
||||
|
||||
subscribePusher: (user) ->
|
||||
channels = user.channels
|
||||
channels = channels.map (channel) ->
|
||||
if channel.match /^private-/
|
||||
channel
|
||||
else
|
||||
"private-#{channel}"
|
||||
Travis.pusher.subscribeAll(channels)
|
||||
|
||||
setupCharm: (user) ->
|
||||
$.extend window.__CHARM,
|
||||
customer: user.login,
|
||||
customer_id: user.id,
|
||||
email: user.email
|
||||
|
||||
displayCharm: ->
|
||||
__CHARM.show()
|
||||
|
||||
identifyCustomer: (user) ->
|
||||
if _cio && _cio.identify
|
||||
_cio.identify
|
||||
id: user.id
|
||||
email: user.email
|
||||
name: user.name
|
||||
created_at: (Date.parse(user.created_at) / 1000) || null
|
||||
login: user.login
|
||||
|
||||
@on 'user:signed_in', (user) ->
|
||||
Travis.onUserUpdate(user)
|
||||
|
||||
@on 'user:synced', (user) ->
|
||||
Travis.onUserUpdate(user)
|
||||
|
||||
@_super.apply this, arguments
|
||||
|
||||
|
|
|
@ -46,7 +46,11 @@ window.Auth = Ember.Object.extend
|
|||
null
|
||||
|
||||
validateUser: (user) ->
|
||||
@validateHas('id', user) && @validateHas('login', user) && @validateHas('token', user) && @validateHas('correct_scopes', user) && user.correct_scopes
|
||||
fieldsToValidate = ['id', 'login', 'token', 'correct_scopes']
|
||||
if Travis.config.pro
|
||||
fieldsToValidate.push 'channels'
|
||||
|
||||
fieldsToValidate.every( (field) => @validateHas(field, user) ) && user.correct_scopes
|
||||
|
||||
validateHas: (field, user) ->
|
||||
if user[field]
|
||||
|
|
|
@ -25,20 +25,12 @@ Travis.TopController = Em.Controller.extend
|
|||
Travis.get('authState') == 'signing-in'
|
||||
).property('Travis.authState')
|
||||
|
||||
Travis.ApplicationController = Em.Controller.extend
|
||||
templateName: 'layouts/home'
|
||||
|
||||
connectLayout: (name) ->
|
||||
name = "layouts/#{name}"
|
||||
if @get('templateName') != name
|
||||
@set('templateName', name)
|
||||
|
||||
Travis.MainController = Em.Controller.extend()
|
||||
Travis.StatsLayoutController = Em.Controller.extend()
|
||||
Travis.ProfileLayoutController = Em.Controller.extend()
|
||||
Travis.AuthLayoutController = Em.Controller.extend()
|
||||
|
||||
Travis.ProfileInfoController = Em.Controller.extend
|
||||
Travis.AccountsInfoController = Em.Controller.extend
|
||||
needs: ['currentUser', 'repos']
|
||||
userBinding: 'controllers.currentUser'
|
||||
|
||||
|
@ -49,6 +41,33 @@ Travis.FirstSyncController = Em.Controller.extend
|
|||
isSyncing: Ember.computed.alias('user.isSyncing')
|
||||
|
||||
Travis.IndexErrorController = Em.Controller.extend()
|
||||
Travis.BuildsItemController = Em.ObjectController.extend(Travis.GithubUrlProperties)
|
||||
|
||||
Travis.QueuesController = Em.ArrayController.extend
|
||||
content: (->
|
||||
Travis.Job.queued()
|
||||
).property()
|
||||
|
||||
Travis.RunningJobsController = Em.ArrayController.extend
|
||||
content: (->
|
||||
Travis.Job.running()
|
||||
).property()
|
||||
|
||||
Travis.SidebarController = Em.ArrayController.extend
|
||||
init: ->
|
||||
@_super.apply this, arguments
|
||||
@tickables = []
|
||||
|
||||
tips: [
|
||||
"Did you know that you can parallelize tests on Travis CI? <a href=\"http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM?utm_source=tips\">Learn more</a>"
|
||||
"Did you know that you can split a build into several smaller pieces? <a href=\"http://docs.travis-ci.com/user/speeding-up-the-build/#Parallelizing-your-builds-across-virtual-machines?utm_source=tips\">Learn more</a>"
|
||||
"Did you know that you can skip a build? <a href=\"http://docs.travis-ci.com/user/how-to-skip-a-build/?utm_source=tips\">Learn more</a>"
|
||||
]
|
||||
|
||||
tip: (->
|
||||
if tips = @get('tips')
|
||||
tips[Math.floor(Math.random()*tips.length)]
|
||||
).property().volatile()
|
||||
|
||||
require 'controllers/accounts'
|
||||
require 'controllers/auth'
|
||||
|
|
|
@ -11,8 +11,12 @@ Travis.AccountController = Ember.ObjectController.extend
|
|||
self.reloadHooks()
|
||||
))
|
||||
|
||||
toggle: (hook) ->
|
||||
hook.toggle()
|
||||
actions:
|
||||
sync: ->
|
||||
@get('user').sync()
|
||||
|
||||
toggle: (hook) ->
|
||||
hook.toggle()
|
||||
|
||||
reloadHooks: ->
|
||||
if login = @get('login')
|
||||
|
@ -35,8 +39,3 @@ Travis.AccountController = Ember.ObjectController.extend
|
|||
showPublicReposHint: (->
|
||||
Travis.config.show_repos_hint == 'public'
|
||||
) .property()
|
||||
|
||||
actions:
|
||||
sync: ->
|
||||
@get('user').sync()
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Travis.BuildController = Ember.Controller.extend
|
||||
Travis.BuildController = Ember.Controller.extend Travis.GithubUrlProperties,
|
||||
needs: ['repo']
|
||||
repoBinding: 'controllers.repo.repo'
|
||||
commitBinding: 'build.commit'
|
||||
|
@ -10,7 +10,3 @@ Travis.BuildController = Ember.Controller.extend
|
|||
loading: (->
|
||||
@get('build.isLoading')
|
||||
).property('build.isLoading')
|
||||
|
||||
urlGithubCommit: (->
|
||||
Travis.Urls.githubCommit(@get('repo.slug'), @get('commit.sha'))
|
||||
).property('repo.slug', 'commit.sha')
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
Travis.BuildsController = Em.ArrayController.extend
|
||||
isPullRequestsList: false
|
||||
|
||||
sortAscending: false
|
||||
sortProperties: ['number']
|
||||
|
||||
|
|
|
@ -1,19 +1,11 @@
|
|||
delegate = (name, options) ->
|
||||
options ||= options
|
||||
->
|
||||
target = @get(options.to)
|
||||
target[name].apply(target, arguments)
|
||||
|
||||
Travis.CurrentUserController = Em.ObjectController.extend
|
||||
sync: ->
|
||||
@get('content').sync()
|
||||
@get('model').sync()
|
||||
|
||||
content: (->
|
||||
@get('auth.currentUser')
|
||||
).property('auth.currentUser')
|
||||
model: Ember.computed.alias('auth.currentUser')
|
||||
|
||||
syncingDidChange: (->
|
||||
if (user = @get('content')) && user.get('isSyncing') && !user.get('syncedAt')
|
||||
if (user = @get('model')) && user.get('isSyncing') && !user.get('syncedAt')
|
||||
Ember.run.scheduleOnce 'routerTransitions', this, ->
|
||||
@container.lookup('router:main').send('renderFirstSync')
|
||||
).observes('isSyncing', 'content')
|
||||
).observes('isSyncing', 'auth.currentUser')
|
||||
|
|
|
@ -6,13 +6,13 @@ Travis.FlashController = Ember.ArrayController.extend
|
|||
@_super.apply this, arguments
|
||||
@set('flashes', Travis.LimitedArray.create(limit: 2, content: []))
|
||||
|
||||
content: (->
|
||||
model: (->
|
||||
broadcasts = @get('unseenBroadcasts')
|
||||
flashes = @get('flashes')
|
||||
content = []
|
||||
content = content.concat(broadcasts.toArray()) if broadcasts
|
||||
content = content.concat(flashes.toArray().reverse()) if flashes
|
||||
content.uniq()
|
||||
model = []
|
||||
model = model.concat(broadcasts.toArray()) if broadcasts
|
||||
model = model.concat(flashes.toArray().reverse()) if flashes
|
||||
model.uniq()
|
||||
).property('unseenBroadcasts.length', 'flashes.length')
|
||||
|
||||
unseenBroadcasts: (->
|
||||
|
@ -30,10 +30,11 @@ Travis.FlashController = Ember.ArrayController.extend
|
|||
@get('flashes').unshiftObject(msg)
|
||||
Ember.run.later(this, (-> @get('flashes.content').removeObject(msg)), 15000)
|
||||
|
||||
close: (msg) ->
|
||||
if msg instanceof Travis.Broadcast
|
||||
msg.setSeen()
|
||||
@notifyPropertyChange('unseenBroadcasts')
|
||||
else
|
||||
@get('flashes').removeObject(msg)
|
||||
actions:
|
||||
close: (msg) ->
|
||||
if msg instanceof Travis.Broadcast
|
||||
msg.setSeen()
|
||||
@notifyPropertyChange('unseenBroadcasts')
|
||||
else
|
||||
@get('flashes').removeObject(msg)
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
Travis.JobController = Em.Controller.extend
|
||||
needs: ['repo']
|
||||
|
||||
jobBinding: 'controllers.repo.job'
|
||||
repoBinding: 'controllers.repo.repo'
|
||||
commitBinding: 'job.commit'
|
||||
annotationsBinding: 'job.annotations'
|
||||
|
|
|
@ -16,5 +16,14 @@ Travis.ProfileController = Travis.Controller.extend
|
|||
@connectTab('user')
|
||||
|
||||
connectTab: (tab) ->
|
||||
viewClass = Travis["#{$.camelize(tab)}View"]
|
||||
if tab == 'user'
|
||||
view = 'AccountsInfoView'
|
||||
else
|
||||
view = "#{$.camelize(tab)}View"
|
||||
viewClass = Travis[view]
|
||||
@set('tab', tab)
|
||||
|
||||
billingUrl: (->
|
||||
id = if @get('account.type') == 'user' then 'user' else @get('account.login')
|
||||
"#{Travis.config.billing_endpoint}/subscriptions/#{id}"
|
||||
).property('account.login', 'account.type')
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
Travis.RepoController = Travis.Controller.extend
|
||||
needs: ['repos', 'currentUser', 'build', 'request']
|
||||
needs: ['repos', 'currentUser', 'build', 'request', 'job']
|
||||
currentUserBinding: 'controllers.currentUser'
|
||||
|
||||
build: Ember.computed.alias('controllers.build.build')
|
||||
job: Ember.computed.alias('controllers.job.job')
|
||||
request: Ember.computed.alias('controllers.request.model')
|
||||
|
||||
slug: (-> @get('repo.slug') ).property('repo.slug')
|
||||
|
@ -10,7 +11,8 @@ Travis.RepoController = Travis.Controller.extend
|
|||
|
||||
init: ->
|
||||
@_super.apply this, arguments
|
||||
Visibility.every Travis.INTERVALS.updateTimes, @updateTimes.bind(this)
|
||||
if !Ember.testing
|
||||
Visibility.every Travis.INTERVALS.updateTimes, @updateTimes.bind(this)
|
||||
|
||||
updateTimes: ->
|
||||
Ember.run this, ->
|
||||
|
@ -23,6 +25,9 @@ Travis.RepoController = Travis.Controller.extend
|
|||
if build && jobs = build.get('jobs')
|
||||
jobs.forEach (j) -> j.updateTimes()
|
||||
|
||||
deactivate: ->
|
||||
@stopObservingLastBuild()
|
||||
|
||||
activate: (action) ->
|
||||
@stopObservingLastBuild()
|
||||
this["view#{$.camelize(action)}"]()
|
||||
|
|
|
@ -1,19 +1,9 @@
|
|||
require 'travis/limited_array'
|
||||
|
||||
Travis.ReposController = Ember.ArrayController.extend
|
||||
defaultTab: ( ->
|
||||
if @get('currentUser.id')
|
||||
'owned'
|
||||
else
|
||||
'recent'
|
||||
).property('currentUser.id')
|
||||
|
||||
currentUserIdDidChange: (->
|
||||
if @get('currentUser.id')
|
||||
@activate('owned')
|
||||
else if @get('tab') == 'owned'
|
||||
@activate('recent')
|
||||
).observes('currentUser.id')
|
||||
actions:
|
||||
activate: (name) ->
|
||||
@activate(name)
|
||||
|
||||
tabOrIsLoadedDidChange: (->
|
||||
@possiblyRedirectToGettingStartedPage()
|
||||
|
@ -36,7 +26,8 @@ Travis.ReposController = Ember.ArrayController.extend
|
|||
|
||||
init: ->
|
||||
@_super.apply this, arguments
|
||||
Visibility.every Travis.INTERVALS.updateTimes, @updateTimes.bind(this)
|
||||
if !Ember.testing
|
||||
Visibility.every Travis.INTERVALS.updateTimes, @updateTimes.bind(this)
|
||||
|
||||
recentRepos: (->
|
||||
Ember.ArrayProxy.extend(
|
||||
|
@ -53,13 +44,8 @@ Travis.ReposController = Ember.ArrayController.extend
|
|||
if content = @get('content')
|
||||
content.forEach (r) -> r.updateTimes()
|
||||
|
||||
transitionToRoot: ->
|
||||
@container.lookup('router:main').send('renderDefaultTemplate')
|
||||
@container.lookup('router:main').transitionTo('index.current')
|
||||
|
||||
activate: (tab, params) ->
|
||||
@set('sortProperties', ['sortOrder'])
|
||||
tab ||= @get('defaultTab')
|
||||
@set('tab', tab)
|
||||
this["view#{$.camelize(tab)}"](params)
|
||||
|
||||
|
@ -76,22 +62,20 @@ Travis.ReposController = Ember.ArrayController.extend
|
|||
[]
|
||||
).property('currentUser.login')
|
||||
|
||||
viewSearch: (params) ->
|
||||
@set('content', Travis.Repo.search(params.search))
|
||||
viewSearch: (phrase) ->
|
||||
@set('search', phrase)
|
||||
@set('content', Travis.Repo.search(phrase))
|
||||
|
||||
searchObserver: (->
|
||||
search = @get('search')
|
||||
if search
|
||||
@searchFor search
|
||||
else
|
||||
@activate 'recent'
|
||||
'recent'
|
||||
).observes('search')
|
||||
|
||||
searchFor: (phrase) ->
|
||||
Ember.run.cancel(@searchLater) if @searchLater
|
||||
@searchLater = Ember.run.later(this, (->
|
||||
@activate 'search', search: phrase
|
||||
@transitionTo('index.search', phrase)
|
||||
), 500)
|
||||
|
||||
noReposMessage: (->
|
||||
|
|
|
@ -19,3 +19,13 @@ Travis.RequestController = Ember.ObjectController.extend
|
|||
else
|
||||
'Rejected'
|
||||
).property('isAccepted')
|
||||
|
||||
message: (->
|
||||
message = @get('model.message')
|
||||
if Travis.features.pro && message == "private repository"
|
||||
''
|
||||
else
|
||||
message
|
||||
).property('model.message')
|
||||
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ Travis.SettingsIndexController = Em.ObjectController.extend
|
|||
@set('settings.maximum_number_of_builds_valid', 'invalid')
|
||||
).observes('settings.maximum_number_of_builds')
|
||||
|
||||
save: ->
|
||||
@get('model').saveSettings(@get('settings')).then null, ->
|
||||
Travis.flash(error: 'There was an error while saving settings. Please try again.')
|
||||
actions:
|
||||
save: ->
|
||||
@get('model').saveSettings(@get('settings')).then null, ->
|
||||
Travis.flash(error: 'There was an error while saving settings. Please try again.')
|
||||
|
|
|
@ -2,3 +2,4 @@ require 'helpers/handlebars'
|
|||
require 'helpers/helpers'
|
||||
require 'helpers/urls'
|
||||
require 'helpers/status_image_formatter'
|
||||
require 'helpers/github_url_properties'
|
||||
|
|
8
assets/scripts/app/helpers/github_url_properties.coffee
Normal file
8
assets/scripts/app/helpers/github_url_properties.coffee
Normal file
|
@ -0,0 +1,8 @@
|
|||
Travis.GithubUrlProperties = Ember.Mixin.create
|
||||
urlGithubCommit: (->
|
||||
Travis.Urls.githubCommit(@get('repo.slug'), @get('commit.sha'))
|
||||
).property('repo.slug', 'commit.sha')
|
||||
|
||||
urlGithubPullRequest: (->
|
||||
Travis.Urls.githubPullRequest(@get('repo.slug'), @get('build.pullRequestNumber'))
|
||||
).property('repo.slug', 'build.pullRequestNumber')
|
|
@ -1,5 +1,3 @@
|
|||
require 'ext/ember/bound_helper'
|
||||
|
||||
safe = (string) ->
|
||||
new Handlebars.SafeString(string)
|
||||
|
||||
|
@ -50,6 +48,7 @@ Ember.Handlebars.registerHelper('label', (options) ->
|
|||
options.hash.for = id
|
||||
options.hashTypes.for = 'STRING'
|
||||
options.hashContexts.for = this
|
||||
options.fn = Ember.Handlebars.compile("{{view.content}}")
|
||||
|
||||
Ember.Handlebars.helpers.view.call(this, view, options)
|
||||
)
|
||||
|
@ -112,7 +111,7 @@ Travis.ErrorsView = Ember.View.extend
|
|||
).property('@errors')
|
||||
show: Ember.computed.notEmpty('errors.[]')
|
||||
|
||||
Ember.Handlebars.helper('travis-errors', (name, options) ->
|
||||
Ember.Handlebars.registerHelper('travis-errors', (name, options) ->
|
||||
errors = @get('errors').for(name)
|
||||
view = Travis.ErrorsView.create(
|
||||
controller: this
|
||||
|
@ -125,7 +124,7 @@ Ember.Handlebars.helper('travis-errors', (name, options) ->
|
|||
Handlebars.registerHelper 'tipsy', (text, tip) ->
|
||||
safe '<span class="tool-tip" original-title="' + tip + '">' + text + '</span>'
|
||||
|
||||
Ember.registerBoundHelper 'capitalize', (value, options) ->
|
||||
Ember.Handlebars.registerBoundHelper 'capitalize', (value, options) ->
|
||||
if value?
|
||||
safe $.capitalize(value)
|
||||
else
|
||||
|
@ -140,10 +139,10 @@ Ember.Handlebars.helper('githubCommitLink', (slug, commitSha) ->
|
|||
safe '<a class="github-link only-on-hover" href="' + url + '">' + sha + '</a>'
|
||||
)
|
||||
|
||||
Ember.registerBoundHelper 'formatTime', (value, options) ->
|
||||
Ember.Handlebars.registerBoundHelper 'formatTime', (value, options) ->
|
||||
safe Travis.Helpers.timeAgoInWords(value) || '-'
|
||||
|
||||
Ember.registerBoundHelper 'formatDuration', (duration, options) ->
|
||||
Ember.Handlebars.registerBoundHelper 'formatDuration', (duration, options) ->
|
||||
safe Travis.Helpers.timeInWords(duration)
|
||||
|
||||
Ember.Handlebars.helper('formatCommit', (commit) ->
|
||||
|
@ -153,16 +152,16 @@ Ember.Handlebars.helper('formatCommit', (commit) ->
|
|||
Ember.Handlebars.helper 'formatSha', (sha) ->
|
||||
safe Travis.Helpers.formatSha(sha)
|
||||
|
||||
Ember.registerBoundHelper 'pathFrom', (url, options) ->
|
||||
Ember.Handlebars.registerBoundHelper 'pathFrom', (url, options) ->
|
||||
safe Travis.Helpers.pathFrom(url)
|
||||
|
||||
Ember.Handlebars.helper 'formatMessage', (message, options) ->
|
||||
safe Travis.Helpers.formatMessage(message, options.hash)
|
||||
|
||||
Ember.registerBoundHelper 'formatConfig', (config, options) ->
|
||||
Ember.Handlebars.registerBoundHelper 'formatConfig', (config, options) ->
|
||||
safe Travis.Helpers.formatConfig(config)
|
||||
|
||||
Ember.registerBoundHelper 'shortCompareShas', (url, options) ->
|
||||
Ember.Handlebars.registerBoundHelper 'shortCompareShas', (url, options) ->
|
||||
path = Travis.Helpers.pathFrom(url)
|
||||
if path.indexOf('...') >= 0
|
||||
shas = path.split('...')
|
||||
|
@ -170,7 +169,7 @@ Ember.registerBoundHelper 'shortCompareShas', (url, options) ->
|
|||
else
|
||||
path
|
||||
|
||||
Ember.registerBoundHelper 'formatLog', (log, options) ->
|
||||
Ember.Handlebars.registerBoundHelper 'formatLog', (log, options) ->
|
||||
parentView = @get 'parentView'
|
||||
repo = parentView.get(options.repo)
|
||||
item = parentView.get(options.item)
|
||||
|
|
|
@ -21,10 +21,18 @@
|
|||
"#{Travis.config.source_endpoint}/#{slug}/settings/hooks#travis_minibucket"
|
||||
|
||||
statusImage: (slug, branch) ->
|
||||
"#{location.protocol}//#{location.host}/#{slug}.svg" + if branch then "?branch=#{encodeURIComponent(branch)}" else ''
|
||||
if Travis.config.pro
|
||||
token = Travis.__container__.lookup('controller:currentUser').get('token')
|
||||
"#{location.protocol}//#{location.host}/#{slug}.svg?token=#{token}" + if branch then "&branch=#{branch}" else ''
|
||||
else
|
||||
"#{location.protocol}//#{location.host}/#{slug}.svg" + if branch then "?branch=#{encodeURIComponent(branch)}" else ''
|
||||
|
||||
ccXml: (slug) ->
|
||||
"#{Travis.config.api_endpoint}/repos/#{slug}/cc.xml"
|
||||
if Travis.config.pro
|
||||
token = Travis.__container__.lookup('controller:currentUser').get('token')
|
||||
"##{Travis.config.api_endpoint}/repos/#{slug}/cc.xml?token=#{token}"
|
||||
else
|
||||
"#{Travis.config.api_endpoint}/repos/#{slug}/cc.xml"
|
||||
|
||||
email: (email) ->
|
||||
"mailto:#{email}"
|
||||
|
|
|
@ -5,6 +5,8 @@ require 'travis/model'
|
|||
name: Ember.attr('string')
|
||||
type: Ember.attr('string')
|
||||
_reposCount: Ember.attr(Number, key: 'repos_count')
|
||||
subscribed: Ember.attr(Boolean)
|
||||
education: Ember.attr(Boolean)
|
||||
|
||||
urlGithub: (->
|
||||
"#{Travis.config.source_endpoint}/#{@get('login')}"
|
||||
|
|
|
@ -23,7 +23,14 @@ require 'travis/model'
|
|||
jobs: Ember.hasMany('Travis.Job')
|
||||
|
||||
config: (->
|
||||
Travis.Helpers.compact(@get('_config'))
|
||||
console.log('config')
|
||||
if config = @get('_config')
|
||||
Travis.Helpers.compact(config)
|
||||
else
|
||||
return if @get('isFetchingConfig')
|
||||
@set 'isFetchingConfig', true
|
||||
|
||||
@reload()
|
||||
).property('_config')
|
||||
|
||||
# TODO add eventType to the api for api build requests
|
||||
|
@ -92,12 +99,6 @@ require 'travis/model'
|
|||
requeue: ->
|
||||
Travis.ajax.post "/builds/#{@get('id')}/restart"
|
||||
|
||||
isPropertyLoaded: (key) ->
|
||||
if ['_duration', '_finishedAt'].contains(key) && !@get('isFinished')
|
||||
return true
|
||||
else
|
||||
@_super(key)
|
||||
|
||||
formattedFinishedAt: (->
|
||||
if finishedAt = @get('finishedAt')
|
||||
moment(finishedAt).format('lll')
|
||||
|
|
|
@ -6,11 +6,3 @@ Travis.EnvVar = Travis.Model.extend
|
|||
public: Ember.attr('boolean')
|
||||
|
||||
repo: Ember.belongsTo('Travis.Repo', key: 'repository_id')
|
||||
|
||||
isPropertyLoaded: (key) ->
|
||||
if key == 'value'
|
||||
return true
|
||||
else
|
||||
@_super(key)
|
||||
|
||||
|
||||
|
|
|
@ -42,7 +42,13 @@ require 'travis/model'
|
|||
).property('repositorySlug')
|
||||
|
||||
config: (->
|
||||
Travis.Helpers.compact(@get('_config'))
|
||||
if config = @get('_config')
|
||||
Travis.Helpers.compact(config)
|
||||
else
|
||||
return if @get('isFetchingConfig')
|
||||
@set 'isFetchingConfig', true
|
||||
|
||||
@reload()
|
||||
).property('_config')
|
||||
|
||||
isFinished: (->
|
||||
|
@ -113,14 +119,6 @@ require 'travis/model'
|
|||
@unsubscribe() if @get('state') == 'finished' && Travis.pusher
|
||||
).observes('state')
|
||||
|
||||
isPropertyLoaded: (key) ->
|
||||
if ['_finishedAt'].contains(key) && !@get('isFinished')
|
||||
return true
|
||||
else if key == '_startedAt' && @get('state') == 'created'
|
||||
return true
|
||||
else
|
||||
@_super(key)
|
||||
|
||||
isFinished: (->
|
||||
@get('state') in ['passed', 'failed', 'errored', 'canceled']
|
||||
).property('state')
|
||||
|
@ -139,6 +137,10 @@ require 'travis/model'
|
|||
true
|
||||
).property()
|
||||
|
||||
slug: (->
|
||||
"#{@get('repo.slug')} ##{@get('number')}"
|
||||
).property()
|
||||
|
||||
@Travis.Job.reopenClass
|
||||
queued: ->
|
||||
filtered = Ember.FilteredRecordArray.create(
|
||||
|
|
|
@ -6,9 +6,6 @@ require 'travis/log_chunks'
|
|||
isLoaded: false
|
||||
length: 0
|
||||
|
||||
init: ->
|
||||
@setParts()
|
||||
|
||||
fetchMissingParts: (partNumbers, after) ->
|
||||
return if @get('notStarted')
|
||||
|
||||
|
@ -27,31 +24,31 @@ require 'travis/log_chunks'
|
|||
for part in parts
|
||||
@append part
|
||||
|
||||
setParts: ->
|
||||
if parts = @get('parts')
|
||||
parts.destroy()
|
||||
parts: (->
|
||||
#if Travis.config.pusher_log_fallback
|
||||
# Travis.LogChunks.create(content: [], missingPartsCallback: => @fetchMissingParts.apply(this, arguments))
|
||||
#else
|
||||
Ember.ArrayProxy.create(content: [])
|
||||
).property()
|
||||
|
||||
if Travis.config.pusher_log_fallback
|
||||
parts = Travis.LogChunks.create(content: [], missingPartsCallback: => @fetchMissingParts.apply(this, arguments))
|
||||
else
|
||||
parts = Ember.ArrayProxy.create(content: [])
|
||||
|
||||
@set 'parts', parts
|
||||
# @set 'parts', Travis.ChunkBuffer.create(content: [])
|
||||
clearParts: ->
|
||||
parts = @get('parts')
|
||||
parts.set('content', [])
|
||||
|
||||
fetch: ->
|
||||
console.log 'log model: fetching log' if Log.DEBUG
|
||||
@setParts()
|
||||
@clearParts()
|
||||
handlers =
|
||||
json: (json) => @loadParts(json['log']['parts'])
|
||||
text: (text) => @loadText(text)
|
||||
Travis.Log.Request.create(id: id, handlers: handlers).run() if id = @get('job.id')
|
||||
|
||||
clear: ->
|
||||
@setParts()
|
||||
@clearParts()
|
||||
@incrementProperty('version')
|
||||
|
||||
append: (part) ->
|
||||
return if @get('parts').isDestroying || @get('parts').isDestroyed
|
||||
@get('parts').pushObject(part)
|
||||
|
||||
loadParts: (parts) ->
|
||||
|
@ -75,6 +72,9 @@ Travis.Log.Request = Em.Object.extend
|
|||
success: (body, status, xhr) => Ember.run(this, -> @handle(body, status, xhr))
|
||||
|
||||
handle: (body, status, xhr) ->
|
||||
if Travis.config.pro
|
||||
Travis.Job.find(@get('id')).get('log').set('token', xhr.getResponseHeader('X-Log-Access-Token'))
|
||||
|
||||
if xhr.status == 204
|
||||
$.ajax(url: @redirectTo(xhr), type: 'GET', success: @handlers.text)
|
||||
else if @isJson(xhr, body)
|
||||
|
|
|
@ -24,6 +24,9 @@ require 'travis/model'
|
|||
}
|
||||
).property('lastBuildId', 'lastBuildNumber')
|
||||
|
||||
withLastBuild: ->
|
||||
@filter( (repo) -> repo.get('lastBuildId') )
|
||||
|
||||
sshKey: (->
|
||||
Travis.SshKey.find(@get('id'))
|
||||
)
|
||||
|
|
|
@ -3,11 +3,3 @@ Travis.SshKey = Travis.Model.extend
|
|||
value: Ember.attr('string')
|
||||
description: Ember.attr('string')
|
||||
fingerprint: Ember.attr('string')
|
||||
|
||||
isPropertyLoaded: (key) ->
|
||||
if key == 'value'
|
||||
return true
|
||||
else
|
||||
@_super(key)
|
||||
|
||||
|
||||
|
|
|
@ -2,10 +2,17 @@ Travis.Pusher = (config) ->
|
|||
@init(config)
|
||||
this
|
||||
|
||||
$.extend Travis.Pusher,
|
||||
CHANNELS: ['common']
|
||||
CHANNEL_PREFIX: ''
|
||||
ENCRYPTED: false
|
||||
if Travis.config.pro
|
||||
$.extend Travis.Pusher,
|
||||
CHANNELS: []
|
||||
CHANNEL_PREFIX: 'private-'
|
||||
ENCRYPTED: true
|
||||
KEY: ''
|
||||
else
|
||||
$.extend Travis.Pusher,
|
||||
CHANNELS: ['common']
|
||||
CHANNEL_PREFIX: ''
|
||||
ENCRYPTED: false
|
||||
|
||||
$.extend Travis.Pusher.prototype,
|
||||
active_channels: []
|
||||
|
@ -101,3 +108,73 @@ $.extend Travis.Pusher.prototype,
|
|||
ignoreMessage: (message) ->
|
||||
message.indexOf('Existing subscription') == 0 or message.indexOf('No current subscription') == 0
|
||||
|
||||
pusher_host = $('meta[name="travis.pusher_host"]').attr('value')
|
||||
pusher_path = $('meta[name="travis.pusher_path"]').attr('value')
|
||||
|
||||
Pusher.SockJSTransport.isSupported = -> false if pusher_host != 'ws.pusherapp.com'
|
||||
|
||||
if Travis.config.pro
|
||||
Pusher.channel_auth_transport = 'bulk_ajax'
|
||||
|
||||
Pusher.authorizers.bulk_ajax = (socketId, _callback) ->
|
||||
channels = Travis.pusher.pusher.channels
|
||||
channels.callbacks ||= []
|
||||
|
||||
name = this.channel.name
|
||||
names = $.keys(channels.channels)
|
||||
|
||||
channels.callbacks.push (auths) ->
|
||||
_callback(false, auth: auths[name])
|
||||
|
||||
unless channels.fetching
|
||||
channels.fetching = true
|
||||
Travis.ajax.post Pusher.channel_auth_endpoint, { socket_id: socketId, channels: names }, (data) ->
|
||||
channels.fetching = false
|
||||
callback(data.channels) for callback in channels.callbacks
|
||||
|
||||
|
||||
Pusher.getDefaultStrategy = (config) ->
|
||||
[
|
||||
[":def", "ws_options", {
|
||||
hostUnencrypted: config.wsHost + ":" + config.wsPort + (pusher_path && "/#{pusher_path}" || ''),
|
||||
hostEncrypted: config.wsHost + ":" + config.wssPort + (pusher_path && "/#{pusher_path}" || '')
|
||||
path: config.path
|
||||
}],
|
||||
[":def", "sockjs_options", {
|
||||
hostUnencrypted: config.httpHost + ":" + config.httpPort,
|
||||
hostEncrypted: config.httpHost + ":" + config.httpsPort
|
||||
}],
|
||||
[":def", "timeouts", {
|
||||
loop: true,
|
||||
timeout: 15000,
|
||||
timeoutLimit: 60000
|
||||
}],
|
||||
|
||||
[":def", "ws_manager", [":transport_manager", {
|
||||
lives: 2,
|
||||
minPingDelay: 10000,
|
||||
maxPingDelay: config.activity_timeout
|
||||
}]],
|
||||
|
||||
[":def_transport", "ws", "ws", 3, ":ws_options", ":ws_manager"],
|
||||
[":def_transport", "flash", "flash", 2, ":ws_options", ":ws_manager"],
|
||||
[":def_transport", "sockjs", "sockjs", 1, ":sockjs_options"],
|
||||
[":def", "ws_loop", [":sequential", ":timeouts", ":ws"]],
|
||||
[":def", "flash_loop", [":sequential", ":timeouts", ":flash"]],
|
||||
[":def", "sockjs_loop", [":sequential", ":timeouts", ":sockjs"]],
|
||||
|
||||
[":def", "strategy",
|
||||
[":cached", 1800000,
|
||||
[":first_connected",
|
||||
[":if", [":is_supported", ":ws"], [
|
||||
":best_connected_ever", ":ws_loop", [":delayed", 2000, [":sockjs_loop"]]
|
||||
], [":if", [":is_supported", ":flash"], [
|
||||
":best_connected_ever", ":flash_loop", [":delayed", 2000, [":sockjs_loop"]]
|
||||
], [
|
||||
":sockjs_loop"
|
||||
]
|
||||
]]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
|
|
|
@ -18,9 +18,22 @@ Travis.Route = Ember.Route.extend
|
|||
@_super.apply(this, arguments)
|
||||
|
||||
signedIn: ->
|
||||
@controllerFor('currentUser').get('content')
|
||||
@controllerFor('currentUser').get('model')
|
||||
|
||||
needsAuth: (->
|
||||
# on pro, we need to auth on every route
|
||||
Travis.config.pro
|
||||
).property()
|
||||
|
||||
Travis.ApplicationRoute = Travis.Route.extend
|
||||
needsAuth: false
|
||||
|
||||
renderTemplate: ->
|
||||
if Travis.config.pro
|
||||
$('body').addClass('pro')
|
||||
|
||||
@_super.apply(this, arguments)
|
||||
|
||||
actions:
|
||||
redirectToGettingStarted: ->
|
||||
# do nothing, we handle it only in index path
|
||||
|
@ -43,14 +56,21 @@ Travis.ApplicationRoute = Travis.Route.extend
|
|||
if transition = @auth.get('afterSignInTransition')
|
||||
@auth.set('afterSignInTransition', null)
|
||||
transition.retry()
|
||||
else
|
||||
@transitionTo('index')
|
||||
|
||||
afterSignOut: ->
|
||||
@transitionTo('index.current')
|
||||
if Travis.config.pro
|
||||
@transitionTo('auth')
|
||||
else
|
||||
@transitionTo('index')
|
||||
|
||||
Travis.Router.map ->
|
||||
@resource 'index', path: '/', ->
|
||||
@resource 'getting_started'
|
||||
@route 'current', path: '/'
|
||||
@route 'recent'
|
||||
@route 'my_repositories'
|
||||
@route 'search', path: '/search/:phrase'
|
||||
@resource 'repo', path: '/:owner/:name', ->
|
||||
@route 'index', path: '/'
|
||||
@resource 'build', path: '/builds/:build_id'
|
||||
|
@ -74,8 +94,9 @@ Travis.Router.map ->
|
|||
@route 'auth', path: '/auth'
|
||||
|
||||
@resource 'profile', path: '/profile', ->
|
||||
@resource 'account', path: '/:login'
|
||||
@route 'info', path: '/info'
|
||||
@resource 'accounts', path: '/', ->
|
||||
@resource 'account', path: '/:login'
|
||||
@route 'info', path: '/info'
|
||||
|
||||
@route 'notFound', path: "/*path"
|
||||
|
||||
|
@ -129,8 +150,8 @@ Travis.GettingStartedRoute = Travis.Route.extend
|
|||
Travis.SimpleLayoutRoute = Travis.Route.extend
|
||||
setupController: ->
|
||||
$('body').attr('id', 'home')
|
||||
@container.lookup('controller:repos').activate()
|
||||
@container.lookup('controller:application').connectLayout 'simple'
|
||||
toActivate = if @signedIn() then 'owned' else 'recent'
|
||||
@container.lookup('controller:repos').activate(toActivate)
|
||||
@_super.apply(this, arguments)
|
||||
|
||||
renderTemplate: ->
|
||||
|
@ -148,31 +169,60 @@ Travis.InsufficientOauthPermissionsRoute = Travis.SimpleLayoutRoute.extend
|
|||
existingUser = document.location.hash.match(/#existing[_-]user/)
|
||||
controller.set('existingUser', existingUser)
|
||||
|
||||
Travis.IndexCurrentRoute = Travis.Route.extend
|
||||
Travis.IndexTabRoute = Travis.Route.extend
|
||||
renderTemplate: ->
|
||||
@render 'repo'
|
||||
@render 'build', into: 'repo'
|
||||
|
||||
setupController: ->
|
||||
@_super.apply this, arguments
|
||||
@currentRepoDidChange()
|
||||
|
||||
@controllerFor('repo').activate('index')
|
||||
@controllerFor('repos').addObserver('firstObject', this, 'currentRepoDidChange')
|
||||
@controllerFor('repos').activate(@get('reposTabName'))
|
||||
|
||||
afterModel: ->
|
||||
@controllerFor('repos').possiblyRedirectToGettingStartedPage()
|
||||
@currentRepoDidChange()
|
||||
@controllerFor('repos').addObserver('firstObject', this, 'currentRepoDidChange')
|
||||
|
||||
deactivate: ->
|
||||
@controllerFor('repos').removeObserver('firstObject', this, 'currentRepoDidChange')
|
||||
|
||||
currentRepoDidChange: ->
|
||||
@controllerFor('repo').set('repo', @controllerFor('repos').get('firstObject'))
|
||||
if repo = @controllerFor('repos').get('firstObject')
|
||||
@controllerFor('repo').set('repo', repo)
|
||||
|
||||
actions:
|
||||
redirectToGettingStarted: ->
|
||||
@transitionTo('getting_started')
|
||||
|
||||
Travis.IndexMyRepositoriesRoute = Travis.IndexTabRoute.extend
|
||||
reposTabName: 'owned'
|
||||
afterModel: ->
|
||||
@controllerFor('repos').possiblyRedirectToGettingStartedPage()
|
||||
|
||||
Travis.IndexRecentRoute = Travis.IndexTabRoute.extend
|
||||
reposTabName: 'recent'
|
||||
|
||||
Travis.IndexSearchRoute = Travis.IndexTabRoute.extend
|
||||
renderTemplate: ->
|
||||
@render 'repo'
|
||||
@render 'build', into: 'repo'
|
||||
|
||||
setupController: (controller, searchPhrase) ->
|
||||
# TODO: this method is almost the same as _super, refactor this
|
||||
@controllerFor('repo').activate('index')
|
||||
@controllerFor('repos').activate('search', searchPhrase)
|
||||
|
||||
@currentRepoDidChange()
|
||||
@controllerFor('repos').addObserver('firstObject', this, 'currentRepoDidChange')
|
||||
|
||||
model: (params) ->
|
||||
params.phrase
|
||||
|
||||
deactivate: ->
|
||||
@_super.apply(this, arguments)
|
||||
|
||||
@controllerFor('repos').set('search', undefined)
|
||||
|
||||
Travis.AbstractBuildsRoute = Travis.Route.extend
|
||||
renderTemplate: ->
|
||||
@render 'builds'
|
||||
|
@ -187,7 +237,7 @@ Travis.AbstractBuildsRoute = Travis.Route.extend
|
|||
|
||||
contentDidChange: ->
|
||||
path = @get('path')
|
||||
@controllerFor('builds').set('content', @controllerFor('repo').get(path))
|
||||
@controllerFor('builds').set('model', @controllerFor('repo').get(path))
|
||||
|
||||
path: (->
|
||||
type = @get('contentType')
|
||||
|
@ -195,8 +245,19 @@ Travis.AbstractBuildsRoute = Travis.Route.extend
|
|||
).property('contentType')
|
||||
|
||||
Travis.BuildsRoute = Travis.AbstractBuildsRoute.extend(contentType: 'builds')
|
||||
Travis.PullRequestsRoute = Travis.AbstractBuildsRoute.extend(contentType: 'pull_requests')
|
||||
Travis.BranchesRoute = Travis.AbstractBuildsRoute.extend(contentType: 'branches')
|
||||
Travis.PullRequestsRoute = Travis.AbstractBuildsRoute.extend(
|
||||
contentType: 'pull_requests'
|
||||
|
||||
# TODO: it would be better to have separate controller for branches and PRs list
|
||||
setupController: (controller, model) ->
|
||||
@_super(controller, model)
|
||||
|
||||
this.controllerFor('builds').set('isPullRequestsList', true)
|
||||
|
||||
deactivate: ->
|
||||
this.controllerFor('builds').set('isPullRequestsList', false)
|
||||
)
|
||||
|
||||
Travis.BuildRoute = Travis.Route.extend
|
||||
serialize: (model, params) ->
|
||||
|
@ -208,18 +269,17 @@ Travis.BuildRoute = Travis.Route.extend
|
|||
model = Travis.Build.find(model) if model && !model.get
|
||||
|
||||
repo = @controllerFor('repo')
|
||||
repo.set('build', model)
|
||||
repo.activate('build')
|
||||
#repo.set('build', model)
|
||||
@controllerFor('build').set('build', model)
|
||||
repo.set('build', model)
|
||||
repo.activate('build')
|
||||
#repo.set('build', model)
|
||||
|
||||
model: (params) ->
|
||||
Travis.Build.fetch(params.build_id)
|
||||
|
||||
deactivate: ->
|
||||
repo = @controllerFor('repo')
|
||||
repo.set('build', null)
|
||||
repo.set('job', null)
|
||||
@controllerFor('job').set('job', null)
|
||||
@controllerFor('build').set('build', null)
|
||||
|
||||
Travis.JobRoute = Travis.Route.extend
|
||||
serialize: (model, params) ->
|
||||
|
@ -231,19 +291,19 @@ Travis.JobRoute = Travis.Route.extend
|
|||
model = Travis.Job.find(model) if model && !model.get
|
||||
|
||||
repo = @controllerFor('repo')
|
||||
repo.set('job', model)
|
||||
@controllerFor('job').set('job', model)
|
||||
repo.activate('job')
|
||||
|
||||
if build = model.get('build')
|
||||
@controllerFor('build').set('build', build)
|
||||
repo.set('build', build)
|
||||
|
||||
model: (params) ->
|
||||
Travis.Job.fetch(params.job_id)
|
||||
|
||||
deactivate: ->
|
||||
repo = @controllerFor('repo')
|
||||
repo.set('job', null)
|
||||
@controllerFor('build').set('build', null)
|
||||
@controllerFor('job').set('job', null)
|
||||
|
||||
|
||||
Travis.RepoIndexRoute = Travis.Route.extend
|
||||
setupController: (controller, model) ->
|
||||
|
@ -258,8 +318,8 @@ Travis.RepoIndexRoute = Travis.Route.extend
|
|||
|
||||
deactivate: ->
|
||||
repo = @controllerFor('repo')
|
||||
repo.set('build', null)
|
||||
repo.set('job', null)
|
||||
@controllerFor('build').set('build', null)
|
||||
@controllerFor('job').set('job', null)
|
||||
|
||||
Travis.RepoRoute = Travis.Route.extend
|
||||
renderTemplate: ->
|
||||
|
@ -280,6 +340,9 @@ Travis.RepoRoute = Travis.Route.extend
|
|||
slug = "#{params.owner}/#{params.name}"
|
||||
Travis.Repo.fetchBySlug(slug)
|
||||
|
||||
resetController: ->
|
||||
@controllerFor('repo').deactivate()
|
||||
|
||||
actions:
|
||||
error: (error) ->
|
||||
# if error throwed has a slug (ie. it was probably repo not found)
|
||||
|
@ -291,15 +354,25 @@ Travis.RepoRoute = Travis.Route.extend
|
|||
# bubble to the top
|
||||
return true
|
||||
|
||||
# Obviously Index route should be renamed to something
|
||||
# like "main" or "home"
|
||||
Travis.IndexIndexRoute = Travis.Route.extend
|
||||
redirect: ->
|
||||
target = if @signedIn() then 'my_repositories' else 'recent'
|
||||
@transitionTo("index.#{target}")
|
||||
|
||||
Travis.IndexRoute = Travis.Route.extend
|
||||
renderTemplate: ->
|
||||
$('body').attr('id', 'home')
|
||||
|
||||
@render 'repos', outlet: 'left'
|
||||
@_super.apply this, arguments
|
||||
|
||||
@render 'repos', outlet: 'left', into: 'index'
|
||||
|
||||
setupController: (controller)->
|
||||
@container.lookup('controller:repos').activate()
|
||||
@container.lookup('controller:application').connectLayout 'home'
|
||||
# TODO: this is redundant with my_repositories and recent routes
|
||||
toActivate = if @signedIn() then 'owned' else 'recent'
|
||||
@container.lookup('controller:repos').activate(toActivate)
|
||||
|
||||
Travis.StatsRoute = Travis.Route.extend
|
||||
renderTemplate: ->
|
||||
|
@ -307,42 +380,39 @@ Travis.StatsRoute = Travis.Route.extend
|
|||
|
||||
@render 'stats'
|
||||
|
||||
setupController: ->
|
||||
@container.lookup('controller:application').connectLayout('simple')
|
||||
|
||||
Travis.NotFoundRoute = Travis.Route.extend
|
||||
renderTemplate: ->
|
||||
$('body').attr('id', 'not-found')
|
||||
|
||||
@render 'not_found'
|
||||
|
||||
setupController: ->
|
||||
@container.lookup('controller:application').connectLayout('simple')
|
||||
|
||||
Travis.ProfileRoute = Travis.Route.extend
|
||||
needsAuth: true
|
||||
|
||||
setupController: (controller, model) ->
|
||||
@container.lookup('controller:application').connectLayout('profile')
|
||||
@controllerFor('accounts').set('model', model)
|
||||
|
||||
renderTemplate: ->
|
||||
$('body').attr('id', 'profile')
|
||||
@_super.apply(this, arguments)
|
||||
@render 'loading', outlet: 'left', into: 'profile'
|
||||
|
||||
Travis.AccountsRoute = Travis.Route.extend
|
||||
model: ->
|
||||
Travis.Account.fetch(all: true)
|
||||
|
||||
renderTemplate: ->
|
||||
$('body').attr('id', 'profile')
|
||||
@render 'accounts', outlet: 'left'
|
||||
|
||||
@_super.apply(this, arguments)
|
||||
@render 'profile_accounts', outlet: 'left', into: 'profile'
|
||||
|
||||
Travis.ProfileIndexRoute = Travis.Route.extend
|
||||
Travis.AccountsIndexRoute = Travis.Route.extend
|
||||
redirect: ->
|
||||
# TODO: setting accounts model in ProfileRoute is wrong, but
|
||||
# at this stage it's better than what we had before
|
||||
accounts = @modelFor('profile')
|
||||
accounts = @modelFor('accounts')
|
||||
login = @controllerFor('currentUser').get('login')
|
||||
account = accounts.find (account) -> account.get('login') == login
|
||||
@transitionTo 'account', account
|
||||
@replaceWith 'account', account
|
||||
|
||||
Travis.AccountRoute = Travis.Route.extend
|
||||
setupController: (controller, account) ->
|
||||
|
@ -351,7 +421,7 @@ Travis.AccountRoute = Travis.Route.extend
|
|||
@controllerFor('profile').activate 'hooks'
|
||||
|
||||
model: (params) ->
|
||||
@modelFor('profile').find (account) -> account.get('login') == params.login
|
||||
@modelFor('accounts').find (account) -> account.get('login') == params.login
|
||||
|
||||
serialize: (account) ->
|
||||
if account && account.get
|
||||
|
@ -359,30 +429,35 @@ Travis.AccountRoute = Travis.Route.extend
|
|||
else
|
||||
{}
|
||||
|
||||
Travis.ProfileInfoRoute = Travis.Route.extend
|
||||
Travis.AccountsInfoRoute = Travis.Route.extend
|
||||
setupController: ->
|
||||
@container.lookup('controller:profile').activate 'user'
|
||||
user = @controllerFor('currentUser').get('model')
|
||||
@controllerFor('account').set('model', user)
|
||||
@controllerFor('profile').activate 'user'
|
||||
|
||||
renderTemplate: ->
|
||||
@render 'user'
|
||||
@render 'accounts_info'
|
||||
|
||||
Travis.AuthRoute = Travis.Route.extend
|
||||
needsAuth: false
|
||||
|
||||
renderTemplate: ->
|
||||
$('body').attr('id', 'auth')
|
||||
|
||||
@render 'auth.signin'
|
||||
|
||||
setupController: ->
|
||||
@container.lookup('controller:application').connectLayout('simple')
|
||||
|
||||
deactivate: ->
|
||||
@controllerFor('auth').set('redirected', false)
|
||||
|
||||
actions:
|
||||
afterSignIn: ->
|
||||
@transitionTo('index.current')
|
||||
@transitionTo('index')
|
||||
return true
|
||||
|
||||
redirect: ->
|
||||
if @signedIn()
|
||||
@transitionTo('index')
|
||||
|
||||
Travis.SettingsRoute = Travis.Route.extend
|
||||
needsAuth: true
|
||||
setupController: (controller, model) ->
|
||||
|
@ -403,7 +478,7 @@ Travis.SshKeyRoute = Travis.Route.extend
|
|||
model: (params) ->
|
||||
repo = @modelFor('repo')
|
||||
self = this
|
||||
Travis.SshKey.fetch(repo.get('id')).then ( (result) -> result ), (xhr) ->
|
||||
Travis.SshKey.fetch(repo.get('id')).then ( (result) -> result unless result.get('isNew') ), (xhr) ->
|
||||
if xhr.status == 404
|
||||
# if there is no model, just return null. I'm not sure if this is the
|
||||
# best answer, maybe we should just redirect to different route, like
|
||||
|
@ -422,3 +497,8 @@ Travis.SshKeyRoute = Travis.Route.extend
|
|||
if @defaultKey
|
||||
controller.set('defaultKey', @defaultKey)
|
||||
@defaultKey = null
|
||||
|
||||
deactivate: ->
|
||||
@_super.apply(this, arguments)
|
||||
|
||||
@controllerFor('ssh_key').send('cancel')
|
||||
|
|
1
assets/scripts/app/templates/accounts.hbs
Normal file
1
assets/scripts/app/templates/accounts.hbs
Normal file
|
@ -0,0 +1 @@
|
|||
{{outlet}}
|
1
assets/scripts/app/templates/application.hbs
Normal file
1
assets/scripts/app/templates/application.hbs
Normal file
|
@ -0,0 +1 @@
|
|||
{{outlet}}
|
|
@ -10,7 +10,7 @@
|
|||
<th class="committer">
|
||||
Committer
|
||||
</th>
|
||||
{{#if view.isPullRequestsList}}
|
||||
{{#if isPullRequestsList}}
|
||||
<th>
|
||||
PR
|
||||
</th>
|
||||
|
@ -21,7 +21,7 @@
|
|||
</thead>
|
||||
|
||||
<tbody>
|
||||
{{#each build in controller}}
|
||||
{{#each build in controller itemController="buildsItem"}}
|
||||
{{#view Travis.BuildsItemView contextBinding="build"}}
|
||||
<td class="number">
|
||||
<span class="status"></span>
|
||||
|
@ -35,16 +35,16 @@
|
|||
{{{formatMessage commit.message short="true" repoBinding=build.repo}}}
|
||||
</td>
|
||||
<td class="commit">
|
||||
<a {{bind-attr href="view.urlGithubCommit"}}>
|
||||
<a {{bind-attr href="urlGithubCommit"}}>
|
||||
{{formatCommit commit}}
|
||||
</a>
|
||||
</td>
|
||||
<td class="committer">
|
||||
{{commit.committerName}}
|
||||
</td>
|
||||
{{#if view.isPullRequestsList}}
|
||||
{{#if isPullRequestsList}}
|
||||
<td>
|
||||
<a {{bind-attr href="view.urlGithubPullRequest"}}>
|
||||
<a {{bind-attr href="urlGithubPullRequest"}}>
|
||||
#{{pullRequestNumber}}
|
||||
</a>
|
||||
</td>
|
||||
|
|
|
@ -64,13 +64,13 @@
|
|||
</div>
|
||||
|
||||
{{#unless build.isMatrix}}
|
||||
{{view Travis.AnnotationsView annotationsBinding="build.jobs.firstObject.annotations"}}
|
||||
{{view 'annotations' annotations=build.jobs.firstObject.annotations}}
|
||||
{{/unless}}
|
||||
|
||||
{{#if build.isMatrix}}
|
||||
{{view Travis.JobsView jobsBinding="build.requiredJobs" required="true"}}
|
||||
{{view Travis.JobsView jobsBinding="build.allowedFailureJobs"}}
|
||||
{{view 'jobs' jobs=build.requiredJobs required="true"}}
|
||||
{{view 'jobs' jobs=build.allowedFailureJobs}}
|
||||
{{else}}
|
||||
{{view Travis.LogView jobBinding="build.jobs.firstObject"}}
|
||||
{{view 'log' job=build.jobs.firstObject}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
|
1
assets/scripts/app/templates/index.hbs
Normal file
1
assets/scripts/app/templates/index.hbs
Normal file
|
@ -0,0 +1 @@
|
|||
{{outlet}}
|
17
assets/scripts/app/templates/jobs.hbs
Normal file
17
assets/scripts/app/templates/jobs.hbs
Normal file
|
@ -0,0 +1,17 @@
|
|||
<h4>Running Jobs ({{controller.length}})</h4>
|
||||
|
||||
<ul class="jobs">
|
||||
{{#if controller.length}}
|
||||
{{#each job in controller}}
|
||||
<li {{bind-attr title="job.slug"}}">
|
||||
{{#if job.repo.slug}}
|
||||
{{#link-to "job" job.repo job}}
|
||||
{{job.repo.slug}} #{{job.number}}
|
||||
{{/link-to}}
|
||||
{{/if}}
|
||||
</li>
|
||||
{{/each}}
|
||||
{{else}}
|
||||
There are no jobs
|
||||
{{/if}}
|
||||
</ul>
|
|
@ -1,15 +1,14 @@
|
|||
{{#if view.jobs.length}}
|
||||
<table {{bind-attr id=view.jobTableId}} class="list">
|
||||
{{#if view.required}}
|
||||
<table id="jobs" class="list">
|
||||
<caption>
|
||||
Build Matrix
|
||||
</caption>
|
||||
<caption>
|
||||
Build Matrix
|
||||
</caption>
|
||||
{{else}}
|
||||
<table id="allowed_failure_jobs" class="list">
|
||||
<caption>
|
||||
Allowed Failures
|
||||
<a title="What's this?" class="help open-popup" name="help-allowed_failures" {{action "popup" target="view"}}></a>
|
||||
</caption>
|
||||
<caption>
|
||||
Allowed Failures
|
||||
<a title="What's this?" class="help open-popup" name="help-allowed_failures" {{action "popup" target=view}}></a>
|
||||
</caption>
|
||||
{{/if}}
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -20,7 +19,7 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
{{#each job in view.jobs}}
|
||||
{{#view Travis.JobsItemView contextBinding="job"}}
|
||||
{{#view 'jobs-item' context=job}}
|
||||
<td class="number">
|
||||
<span class="status"></span>
|
||||
{{#if job.id}}
|
||||
|
@ -45,7 +44,7 @@
|
|||
|
||||
{{#unless view.required}}
|
||||
<div id="help-allowed_failures" class="popup">
|
||||
<a href="#" class="close" {{action "popupClose" target="view"}}></a>
|
||||
<a href="#" class="close" {{action "popupClose" target=view}}></a>
|
||||
<h4></h4>
|
||||
<p>
|
||||
Allowed Failures are items in your build matrix that are allowed to
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{#if view.log.isLoaded}}
|
||||
{{view Travis.PreView jobBinding="view.job" logBinding="view.log"}}
|
||||
{{view 'pre' job=view.job log=view.log}}
|
||||
{{else}}
|
||||
<div id="log" class="loading">
|
||||
<span>Loading</span>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div id="log-container">
|
||||
<a href="#" id="tail" {{action "toggleTailing" target="view"}}>
|
||||
<a href="#" id="tail" {{action "toggleTailing" target=view}}>
|
||||
<span class="status"></span>
|
||||
|
||||
<label>
|
||||
|
@ -12,7 +12,7 @@
|
|||
</a>
|
||||
<pre id="log" class="ansi"></pre>
|
||||
|
||||
<a href='#' class="to-top" {{action "toTop" target="view"}}>To Top</a>
|
||||
<a href='#' class="to-top" {{action "toTop" target=view}}>To Top</a>
|
||||
|
||||
{{#if view.job.sponsor.name}}
|
||||
<p class="sponsor">
|
||||
|
|
|
@ -62,9 +62,9 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{{view Travis.AnnotationsView annotationsBinding="view.annotations"}}
|
||||
{{view 'annotations' annotations=view.annotations}}
|
||||
|
||||
{{view Travis.LogView jobBinding="job"}}
|
||||
{{view 'log' job=job}}
|
||||
</div>
|
||||
{{else}}
|
||||
<div id="job" class="loading">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{#each flash in controller}}
|
||||
{{#view Travis.FlashItemView flashBinding="flash"}}
|
||||
<p>{{{flash.message}}}</p>
|
||||
<a class="close" {{action "close" target="view"}}></a>
|
||||
<a class="close" {{action "close" target=view}}></a>
|
||||
{{/view}}
|
||||
{{/each}}
|
||||
|
|
|
@ -3,10 +3,16 @@
|
|||
</div>
|
||||
|
||||
<div id="left">
|
||||
{{outlet left}}
|
||||
{{outlet "left"}}
|
||||
</div>
|
||||
|
||||
<div id="main">
|
||||
{{render "flash"}}
|
||||
{{outlet}}
|
||||
{{yield}}
|
||||
</div>
|
||||
|
||||
{{#if config.pro}}
|
||||
<div id="right">
|
||||
{{render "layouts/sidebar"}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
|
|
@ -3,16 +3,16 @@
|
|||
</div>
|
||||
|
||||
<div id="left">
|
||||
{{outlet left}}
|
||||
{{outlet "left"}}
|
||||
</div>
|
||||
|
||||
<div id="main">
|
||||
{{render "flash"}}
|
||||
{{outlet main}}
|
||||
{{yield}}
|
||||
</div>
|
||||
|
||||
<div id="right">
|
||||
<div id="slider" {{action "toggle" target="Travis.slider"}}>
|
||||
<div id="slider" {{action "toggle" target=Travis.slider}}>
|
||||
<div class='icon'></div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
<div id="slider" {{action toggle target="Travis.slider"}}>
|
||||
<div class='icon'></div>
|
||||
</div>
|
||||
|
||||
{{#if tip}}
|
||||
<div class="tip box">
|
||||
<h4>Tip:</h4>
|
||||
|
||||
<p>{{{tip}}}</p>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if config.pages_endpoint}}
|
||||
{{view templateName="layouts/support"}}
|
||||
{{/if}}
|
||||
|
||||
{{render "runningJobs"}}
|
||||
|
||||
{{view Travis.QueueView}}
|
|
@ -4,5 +4,5 @@
|
|||
|
||||
<div id="main">
|
||||
{{render "flash"}}
|
||||
{{outlet main}}
|
||||
{{yield}}
|
||||
</div>
|
||||
|
|
12
assets/scripts/app/templates/layouts/support.hbs
Normal file
12
assets/scripts/app/templates/layouts/support.hbs
Normal file
|
@ -0,0 +1,12 @@
|
|||
<div id="about" class="box">
|
||||
<h4>How can we help?</h4>
|
||||
<ul>
|
||||
{{#if config.billing_endpoint}}
|
||||
<li><a href="#" {{action displayCharm target="Travis"}}>Support Ticket</a></li>
|
||||
{{/if}}
|
||||
<li><a href="http://chat.travis-ci.com">Live Chat</a></li>
|
||||
<li><a href="mailto:support@travis-ci.com">E-Mail us</a></li>
|
||||
<li><a href="http://docs.travis-ci.com/user/travis-pro">Documentation</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
{{#link-to "index.current"}}
|
||||
{{#link-to "index"}}
|
||||
<div id="home">
|
||||
<h1>Travis</h1>
|
||||
</div>
|
||||
|
@ -6,7 +6,7 @@
|
|||
|
||||
<ul id="navigation">
|
||||
<li class="home">
|
||||
{{#link-to "index.current"}}Home{{/link-to}}
|
||||
{{#link-to "index"}}Home{{/link-to}}
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://blog.travis-ci.com">Blog</a>
|
||||
|
@ -14,24 +14,56 @@
|
|||
<li>
|
||||
<a href="http://traviscistatus.com">Status</a>
|
||||
</li>
|
||||
<li class="menu community">
|
||||
<p class="handle">
|
||||
<a href="#">Help</a>
|
||||
</p>
|
||||
<ul>
|
||||
<li><a href="http://docs.travis-ci.com">Docs</a></li>
|
||||
<li><a href="http://stackoverflow.com/questions/ask?tags=travis-ci">Ask a Question</a></li>
|
||||
<li><a href="irc://irc.freenode.net/#travis">IRC</a></li>
|
||||
<li><a href="mailto:support@travis-ci.com">E-Mail us</a></li>
|
||||
<li><a href="http://docs.travis-ci.com/imprint.html" alt="Imprint">Imprint</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{{#unless config.pro}}
|
||||
<li class="menu community">
|
||||
<p class="handle">
|
||||
<a href="#">Help</a>
|
||||
</p>
|
||||
<ul>
|
||||
<li><a href="http://docs.travis-ci.com">Docs</a></li>
|
||||
<li><a href="http://stackoverflow.com/questions/ask?tags=travis-ci">Ask a Question</a></li>
|
||||
<li><a href="irc://irc.freenode.net/#travis">IRC</a></li>
|
||||
<li><a href="mailto:support@travis-ci.com">E-Mail us</a></li>
|
||||
<li><a href="http://docs.travis-ci.com/imprint.html" alt="Imprint">Imprint</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{{/unless}}
|
||||
|
||||
{{#if config.pages_endpoint}}
|
||||
<li>
|
||||
<a href="http://traviscistatus.com">Status</a>
|
||||
</li>
|
||||
<li class="menu legal">
|
||||
<p class="handle">
|
||||
<a {{bind-attr href="config.url_legal"}}>Legal</a>
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<a {{bind-attr href="config.url_imprint"}}>Imprint</a>
|
||||
</li>
|
||||
<li>
|
||||
<a {{bind-attr href="config.url_security"}}>Security</a>
|
||||
</li>
|
||||
<li>
|
||||
<a {{bind-attr href="config.url_terms"}}>Terms</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
{{/if}}
|
||||
|
||||
|
||||
<!-- hiding for now
|
||||
<li>
|
||||
<a href="https://travisci.workable.com" class="werehiring" target="_blank">We're Hiring!</a>
|
||||
</li>
|
||||
<li class="traviscicom">
|
||||
<a href="http://travis-ci.com">Travis CI for Private Repositories</a>
|
||||
</li>
|
||||
hiding for now -->
|
||||
|
||||
{{#unless config.pro}}
|
||||
<li class="traviscicom">
|
||||
<a href="http://travis-ci.com">Travis CI for Private Repositories</a>
|
||||
</li>
|
||||
{{/unless}}
|
||||
|
||||
<li {{bind-attr class="view.classProfile"}}>
|
||||
<p class="handle">
|
||||
{{#if auth.signedOut}}
|
||||
|
@ -46,8 +78,13 @@
|
|||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
{{#link-to "profile.index" class="signed-in"}}Accounts{{/link-to}}
|
||||
{{#link-to "profile" class="signed-in"}}Accounts{{/link-to}}
|
||||
</li>
|
||||
{{#if Travis.config.billing_endpoint}}
|
||||
<li>
|
||||
<a {{bind-attr href="Travis.config.billing_endpoint"}}>Billing</a>
|
||||
</li>
|
||||
{{/if}}
|
||||
<li>
|
||||
<a href="/" {{action "signOut" target="auth"}}>Sign Out</a>
|
||||
</li>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<div class="column-right">
|
||||
<span class="steps">Step 1: Enabling your projects</span>
|
||||
<p>
|
||||
Start by going to your {{#link-to "profile.index"}}profile{{/link-to}} and enable one of your projects. We've been
|
||||
Start by going to your {{#link-to "profile"}}profile{{/link-to}} and enable one of your projects. We've been
|
||||
synchronizing all repositories you have administrative access to. Pick one and flip the switch next to it.
|
||||
</p>
|
||||
</div>
|
||||
|
|
77
assets/scripts/app/templates/pro/no_owned_repos.hbs
Normal file
77
assets/scripts/app/templates/pro/no_owned_repos.hbs
Normal file
|
@ -0,0 +1,77 @@
|
|||
<div id="getting-started">
|
||||
<h3>Welcome to Travis CI!</h3>
|
||||
|
||||
<h2>Hey, it looks like you're new around here and have yet to set up your first<br>repository on Travis CI. We're here to help you get started, it's easy!</h2>
|
||||
|
||||
<div class="getting-started-row">
|
||||
<div class="column">
|
||||
<img src="/images/getting-started/project-switch.png">
|
||||
</div>
|
||||
|
||||
<div class="column-right">
|
||||
<span class="steps">Step 1: Enabling your projects</span>
|
||||
<p>
|
||||
Start by going to your {{#link-to "profile.index"}}profile{{/link-to}} and enable one of your projects. We've been
|
||||
synchronizing all repositories you have administrative access to. Pick one and flip the switch next to it.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="getting-started-row">
|
||||
<div class="column">
|
||||
<img src="/images/getting-started/first-build.png">
|
||||
</div>
|
||||
|
||||
<div class="column-right">
|
||||
<span class="steps">Step 2: Adding Travis</span>
|
||||
<p>
|
||||
Once you've enabled one of your projects, add a <a
|
||||
href="http://about.travis-ci.org/docs/user/build-configuration/#.travis.yml-file%3A-what-it-is-and-how-it-is-used"><code>.travis.yml</code></a> to your project, push some code, and we'll start processing your builds. Wait a
|
||||
whee while and reload the page, and your newly setup and built project will show up on the right.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="getting-started-row">
|
||||
<div class="column">
|
||||
<img src="/images/getting-started/build-email.png">
|
||||
</div>
|
||||
|
||||
<div class="column-right">
|
||||
<span class="steps">Step 3: Wait for your build to finish</span>
|
||||
<p>
|
||||
We'll be sending you an email once the build has finished. Then, it's up to you to do the happy dance.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="getting-started-row">
|
||||
<span class="after-steps steps">Build Configuration</span>
|
||||
<p>
|
||||
We use sensible defaults for <a href="http://about.travis-ci.org/docs/">most languages</a>, but you can customize
|
||||
both the <a href="http://about.travis-ci.org/docs/user/build-configuration/">build process</a> and the <a
|
||||
href="http://about.travis-ci.org/docs/user/build-configuration/">build
|
||||
environment</a> to fit your project's needs.
|
||||
</p>
|
||||
|
||||
<span class="steps">Notifications</span>
|
||||
<p>
|
||||
You can also configure how you want to be notified of build results. Email is only one channel you can use. We
|
||||
support <a href="http://about.travis-ci.org/docs/user/notifications/#Campfire-notification">Campfire</a>, <a
|
||||
href="http://about.travis-ci.org/docs/user/notifications/#HipChat-notification">HipChat</a>, <a
|
||||
href="http://about.travis-ci.org/docs/user/notifications/#Flowdock-notification">Flowdock</a>, <a
|
||||
href="http://about.travis-ci.org/docs/user/notifications/#IRC-notification">IRC</a>, and <a
|
||||
href="http://about.travis-ci.org/docs/user/notifications/#Webhook-notification">webhooks</a>. To avoid
|
||||
exposing any private credentials, you can shield them from the public using <a
|
||||
href="http://about.travis-ci.org/docs/user/build-configuration/#Secure-environment-variables">encrypted
|
||||
configuration settings</a>.
|
||||
</p>
|
||||
|
||||
<span class="steps">Questions</span>
|
||||
<p>
|
||||
Should you have any questions or issues, have a look at <a href="http://about.travis-ci.org/docs/" location="_top">our
|
||||
documentation</a>, <a href="https://github.com/travis-ci/travis-ci/issues/new" location="_top">open an issue</a> or
|
||||
<a href="mailto:support@travis-ci.com">send us an email</a>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
17
assets/scripts/app/templates/pro/repos/show/empty.hbs
Normal file
17
assets/scripts/app/templates/pro/repos/show/empty.hbs
Normal file
|
@ -0,0 +1,17 @@
|
|||
<div id="empty">
|
||||
<h2>Welcome to Travis CI!</h2>
|
||||
|
||||
<p>It looks like you're new around here. Let's get you started, shall we?</p>
|
||||
|
||||
<p>You're only two steps away from using Travis:</p>
|
||||
|
||||
<ul>
|
||||
<li> Hook up {{#link-to "profile.index" class="signed-in"}}one or more of your GitHub repositories{{/link-to}} with Travis.</li>
|
||||
<li> Push some code!</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
If you have any questions or issues, hop on our <a href="https://travisci.campfirenow.com/10e50">Campfire support room</a> or
|
||||
contact <a href="mailto:support@travis-ci.com">support</a> directly.
|
||||
</p>
|
||||
</div>
|
1
assets/scripts/app/templates/profile.hbs
Normal file
1
assets/scripts/app/templates/profile.hbs
Normal file
|
@ -0,0 +1 @@
|
|||
{{outlet}}
|
1
assets/scripts/app/templates/profile/loading.hbs
Normal file
1
assets/scripts/app/templates/profile/loading.hbs
Normal file
|
@ -0,0 +1 @@
|
|||
<div class="loading"><span>Loading</span></div>
|
|
@ -1,8 +1,25 @@
|
|||
<h3>{{view.name}}</h3>
|
||||
|
||||
{{#if config.billing_endpoint}}
|
||||
{{#if view.subscribed}}
|
||||
<a class="button activated" {{bind-attr href="billingUrl"}}>
|
||||
Subscription active!
|
||||
</a>
|
||||
{{else}}
|
||||
{{#if view.education}}
|
||||
<a class="button activated" {{bind-attr href="billingUrl"}}>
|
||||
Educational account!
|
||||
</a>
|
||||
{{else}}
|
||||
<a class="button activate" {{bind-attr href="billingUrl"}}>
|
||||
Sign up this account!
|
||||
</a>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{view Travis.ProfileTabsView}}
|
||||
|
||||
<div class="tab">
|
||||
{{outlet}}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -7,7 +7,14 @@
|
|||
{{#if view.displayUser}}
|
||||
<li id="tab_user" {{bind-attr class="view.classUser"}}>
|
||||
<h5>
|
||||
{{#link-to "profile.info"}}Profile{{/link-to}}
|
||||
{{#link-to "accounts.info"}}Profile{{/link-to}}
|
||||
</h5>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{#if config.billing_endpoint}}
|
||||
<li id="tab_billing" class="right">
|
||||
<h5>
|
||||
<a {{bind-attr href="billingUrl"}}>Billing</a>
|
||||
</h5>
|
||||
</li>
|
||||
{{/if}}
|
||||
|
|
23
assets/scripts/app/templates/queues/show.hbs
Normal file
23
assets/scripts/app/templates/queues/show.hbs
Normal file
|
@ -0,0 +1,23 @@
|
|||
<ul id="queues">
|
||||
<li class="queue">
|
||||
<h4>Queue ({{controller.length}})</h4>
|
||||
<ul>
|
||||
{{#if controller.length}}
|
||||
{{#each job in controller}}
|
||||
{{#view Travis.QueueItemView jobBinding="job"}}
|
||||
{{#if job.repo.slug}}
|
||||
{{#link-to "job" job.repo job}}
|
||||
<span class="slug" {{bind-attr title="job.slug"}}>
|
||||
{{job.repo.slug}}
|
||||
</span>
|
||||
#{{job.number}}
|
||||
{{/link-to}}
|
||||
{{/if}}
|
||||
{{/view}}
|
||||
{{/each}}
|
||||
{{else}}
|
||||
There are no jobs
|
||||
{{/if}}
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
|
@ -1,33 +1,38 @@
|
|||
<div id="search_box">
|
||||
{{view Ember.TextField valueBinding="controller.search" placeholder="Search all repositories"}}
|
||||
{{input value=controller.search placeholder="Search all repositories"}}
|
||||
</div>
|
||||
|
||||
{{view Travis.ReposListTabsView}}
|
||||
{{view 'repos-list-tabs'}}
|
||||
|
||||
<div class="tab">
|
||||
{{#if isLoaded}}
|
||||
{{#collection Travis.ReposListView contentBinding="this"}}
|
||||
{{#with view.repo}}
|
||||
{{#collection 'repos-list' content=this}}
|
||||
{{#with view.repo as repo}}
|
||||
<div class="slug-and-status">
|
||||
<span class="status"></span>
|
||||
{{#if slug}}
|
||||
{{#link-to "repo" this class="slug"}}{{slug}}{{/link-to}}
|
||||
{{#if repo.slug}}
|
||||
{{#link-to "repo" repo class="slug"}}{{repo.slug}}{{/link-to}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{#with lastBuildHash}}
|
||||
{{#with repo.lastBuildHash as lastBuild}}
|
||||
{{#if repo.slug}}
|
||||
{{#link-to "build" repo id class="last_build"}}{{number}}{{/link-to}}
|
||||
{{#link-to "build" repo lastBuild.id
|
||||
class="last_build"}}{{lastBuild.number}}{{/link-to}}
|
||||
{{/if}}
|
||||
{{/with}}
|
||||
|
||||
{{#if lastBuildHash.number }}
|
||||
{{#if repo.lastBuildHash.number }}
|
||||
<p class="summary">
|
||||
<span class="duration_label">Duration:</span>
|
||||
<abbr class="duration" {{bind-attr title="lastBuildStartedAt"}}>{{formatDuration lastBuildDuration}}</abbr>
|
||||
<abbr class="duration" {{bind-attr title="lastBuildStartedAt"}}>
|
||||
{{formatDuration repo.lastBuildDuration}}
|
||||
</abbr>
|
||||
</p>
|
||||
<p class="summary">
|
||||
<span class="finished-icon"></span><span class="finished_at_label">Finished:</span>
|
||||
<abbr class="finished_at timeago" {{bind-attr title="lastBuildFinishedAt"}}>{{formatTime lastBuildFinishedAt}}</abbr>
|
||||
<abbr class="finished_at timeago" {{bind-attr title="lastBuildFinishedAt"}}>
|
||||
{{formatTime repo.lastBuildFinishedAt}}
|
||||
</abbr>
|
||||
</p>
|
||||
{{/if}}
|
||||
|
||||
|
|
|
@ -1,17 +1,19 @@
|
|||
<ul class="tabs">
|
||||
<li id="tab_owned" {{bind-attr class="view.classOwned"}}>
|
||||
<h5><a {{action "activate" "owned" target="view"}}>My Repositories</a></h5>
|
||||
<h5>{{#link-to "index.my_repositories"}}My Repositories{{/link-to}}</h5>
|
||||
</li>
|
||||
|
||||
<li id="tab_recent" {{bind-attr class="view.classRecent"}}>
|
||||
<h5><a {{action "activate" "recent" target="view"}}>Recent</a></h5>
|
||||
</li>
|
||||
{{#unless config.pro}}
|
||||
<li id="tab_recent" {{bind-attr class="view.classRecent"}}>
|
||||
<h5>{{#link-to "index.recent"}}Recent{{/link-to}}</h5>
|
||||
</li>
|
||||
{{/unless}}
|
||||
|
||||
<li id="tab_search" {{bind-attr class="view.classSearch"}}>
|
||||
<h5><a {{action "activate" "search" target="view"}}>Search</a></h5>
|
||||
<h5>Search</h5>
|
||||
</li>
|
||||
|
||||
<li id="tab_new" {{bind-attr class="view.classNew"}}>
|
||||
<h5>{{#link-to "profile.index" trackEvent="add-repository-from-list" title="Add New Repository"}}+{{/link-to}}</h5>
|
||||
<h5>{{#link-to "profile" trackEvent="add-repository-from-list" title="Add New Repository"}}+{{/link-to}}</h5>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -3,25 +3,22 @@
|
|||
{{view Travis.ReposEmptyView}}
|
||||
{{else}}
|
||||
{{#if repo.isLoaded}}
|
||||
{{#with repo}}
|
||||
<div id="repo-header">
|
||||
<h3>{{#link-to "repo" this}}{{slug}}{{/link-to}}</h3>
|
||||
<div class="github-icon"><a {{bind-attr href="controller.urlGithub"}}><img src="/images/icons/github.svg" width="21" height="21"/></a></div>
|
||||
|
||||
<div class="status-image">
|
||||
<a href="#" id="status-image-popup" name="status-images" class="open-popup" {{action "statusImages" target="view"}}>
|
||||
<img {{bind-attr src="view.statusImageUrl"}} title="Build Status Images"/>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{{view Travis.RepoShowToolsView}}
|
||||
<div id="repo-header">
|
||||
<h3>{{#link-to "repo" repo}}{{repo.slug}}{{/link-to}}</h3>
|
||||
<div class="github-icon"><a {{bind-attr href="controller.urlGithub"}}><img src="/images/icons/github.svg" width="21" height="21"/></a></div>
|
||||
<div class="status-image">
|
||||
<a href="#" id="status-image-popup" name="status-images" class="open-popup" {{action "statusImages" target=view}}>
|
||||
<img {{bind-attr src="view.statusImageUrl"}} title="Build Status Images"/>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<p class="description">{{description}}</p>
|
||||
{{view 'repo-show-tools'}}
|
||||
</div>
|
||||
|
||||
{{view Travis.RepoShowTabsView}}
|
||||
{{view Travis.RepoActionsView}}
|
||||
{{/with}}
|
||||
<p class="description">{{description}}</p>
|
||||
|
||||
{{view 'repo-show-tabs'}}
|
||||
{{view 'repo-actions'}}
|
||||
|
||||
<div class="tab">
|
||||
{{outlet}}
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
<ul>
|
||||
{{#if view.displayCancelBuild}}
|
||||
<li class="icon cancel-build" title="Cancel Build">
|
||||
<a href="#" {{action "cancelBuild" target="view"}}
|
||||
<a href="#" {{action "cancelBuild" target=view}}
|
||||
{{bind-attr class="view.canCancelBuild::disabled"}}></a>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{#if view.displayCancelJob}}
|
||||
<li class="icon cancel-job" title="Cancel Job">
|
||||
<a href="#" {{action "cancelJob" target="view"}}
|
||||
<a href="#" {{action "cancelJob" target=view}}
|
||||
{{bind-attr class="view.canCancelJob::disabled"}}></a>
|
||||
</li>
|
||||
{{/if}}
|
||||
|
@ -17,7 +17,7 @@
|
|||
{{#if view.requeueing}}
|
||||
<span class="icon loading"></span>
|
||||
{{else}}
|
||||
<a href="#" {{action "requeueBuild" target="view"}}
|
||||
<a href="#" {{action "requeueBuild" target=view}}
|
||||
{{bind-attr class="view.canRequeueBuild::disabled"}}></a>
|
||||
{{/if}}
|
||||
</li>
|
||||
|
@ -27,7 +27,7 @@
|
|||
{{#if view.requeueing}}
|
||||
<span class="icon loading"></span>
|
||||
{{else}}
|
||||
<a href="#" {{action "requeueJob" target="view"}}
|
||||
<a href="#" {{action "requeueJob" target=view}}
|
||||
{{bind-attr class="view.canRequeueJob::disabled"}}></a>
|
||||
{{/if}}
|
||||
</li>
|
||||
|
@ -42,7 +42,7 @@
|
|||
{{#if view.displayCodeClimate}}
|
||||
<li class="icon code-climate" title="Test Coverage with Code Climate">
|
||||
<a href="#" name="code-climate"
|
||||
{{action "codeClimatePopup" target="view"}}
|
||||
{{action "codeClimatePopup" target=view}}
|
||||
{{bind-attr class=":open-popup"}}></a>
|
||||
</li>
|
||||
{{/if}}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<li id="tab_current" {{bind-attr class="view.classCurrent"}}>
|
||||
<h5>
|
||||
{{#if repo.slug}}
|
||||
{{#link-to "repo" repo currentWhen="repo.index"}}
|
||||
{{#link-to "repo" repo current-when="repo.index"}}
|
||||
Current
|
||||
{{/link-to}}
|
||||
{{/if}}
|
||||
|
@ -75,7 +75,7 @@
|
|||
{{/if}}
|
||||
</h5>
|
||||
</li>
|
||||
{{#if Travis.config.caches_enabled}}
|
||||
{{#if config.caches_enabled}}
|
||||
<li id="tab_caches" {{bind-attr class="view.classCaches"}}>
|
||||
<h5>
|
||||
{{#if repo.slug}}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<div id="tools">
|
||||
<a href="#" {{action "menu" target="view"}} class="menu-popup-button">Settings</a>
|
||||
<a href="#" {{action "menu" target=view}} class="menu-popup-button">Settings</a>
|
||||
|
||||
<ul class="menu">
|
||||
{{#if view.displayRegenerateKey}}
|
||||
<li>
|
||||
<a href="#" name="regenerate-key"
|
||||
{{action "regenerateKeyPopup" target="view"}}
|
||||
{{action "regenerateKeyPopup" target=view}}
|
||||
{{bind-attr class=":open-popup view.canRegenerateKey::disabled"}}>
|
||||
Regenerate Key
|
||||
</a>
|
||||
|
@ -19,7 +19,7 @@
|
|||
<li>
|
||||
{{#link-to "requests" view.repo}}Requests{{/link-to}}
|
||||
</li>
|
||||
{{#if Travis.config.caches_enabled}}
|
||||
{{#if config.caches_enabled}}
|
||||
<li>
|
||||
{{#link-to "caches" view.repo}}Caches{{/link-to}}
|
||||
</li>
|
||||
|
@ -29,7 +29,7 @@
|
|||
</div>
|
||||
|
||||
<div id="regenerate-key" class="popup">
|
||||
<a href="#" class="close" {{action "popupClose" target="view"}}></a>
|
||||
<a href="#" class="close" {{action "popupClose" target=view}}></a>
|
||||
<p>
|
||||
Do you really want to regenerate ssl keys for this repository? Please note that
|
||||
any data, which is encrypted, such as notification services credentials or secure
|
||||
|
@ -38,14 +38,14 @@
|
|||
</p>
|
||||
|
||||
<p>
|
||||
<a class="sync_now button" {{action "regenerateKey" target="view"}}>Yes, do it!</a>
|
||||
<a class="sync_now button" {{action "regenerateKey" target=view}}>Yes, do it!</a>
|
||||
<span class="or">or</span>
|
||||
<a href="#" class="cancel" {{action "popupClose" target="view"}}>Cancel</a>
|
||||
<a href="#" class="cancel" {{action "popupClose" target=view}}>Cancel</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div id="regeneration-success" class="popup">
|
||||
<a href="#" class="close" {{action "popupClose" target="view"}}></a>
|
||||
<a href="#" class="close" {{action "popupClose" target=view}}></a>
|
||||
<p>
|
||||
Key for this repository has been regenerated. If you used previous key
|
||||
for encryption, you will need encrypt your data again with the new key.
|
||||
|
@ -58,14 +58,14 @@
|
|||
|
||||
<div id="code-climate" class="popup">
|
||||
<img src="/images/icons/code-climate-logo.svg" id="code-climate-logo"/>
|
||||
<a href="#" class="close" {{action "popupClose" target="view"}}></a>
|
||||
<a href="#" class="close" {{action "popupClose" target=view}}></a>
|
||||
<p>
|
||||
<b>Want test coverage for your tests?</b>
|
||||
</p>
|
||||
<p>
|
||||
Integrating <a href="https://codeclimate.com">Code Climate's test coverage</a> reporting with your test
|
||||
suite on Travis CI allows to track changes in coverage over time. If you haven't tried it out already, <a
|
||||
{{bind-attr href="Travis.config.code_climate_url"}}" target="_blank">sign
|
||||
{{bind-attr href=config.code_climate_url}}" target="_blank">sign
|
||||
up today</a> to improve your code's quality. New customers get 20% off for the first three months!
|
||||
</p>
|
||||
|
||||
|
@ -98,4 +98,5 @@ addons:
|
|||
repo_token: adf08323...
|
||||
</pre>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<ul class="navigation">
|
||||
<li>{{#link-to "settings.index"}}General Settings{{/link-to}}</li>
|
||||
<li>{{#link-to "env_vars"}}Environment Variables{{/link-to}}</li>
|
||||
{{#if Travis.config.ssh_key_enabled}}
|
||||
{{#if config.ssh_key_enabled}}
|
||||
<li>{{#link-to "ssh_key"}}SSH Key{{/link-to}}</li>
|
||||
{{/if}}
|
||||
</ul>
|
||||
|
|
|
@ -6,14 +6,15 @@
|
|||
<p>SSH key is set.</p>
|
||||
{{#if description}}
|
||||
<div class="row">
|
||||
<span class="label">Description:</label>
|
||||
<span class="label">Description:</span>
|
||||
<span class="value">{{description}}</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="row">
|
||||
<span class="label">Fingerprint:</label>
|
||||
<span class="label">Fingerprint:</span>
|
||||
<span class="value">{{fingerprint}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<a href="#" {{action "delete"}} {{bind-attr class=":delete-ssh-key isDeleting:deleting"}}>
|
||||
Delete
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<form class="ssh-key" {{action "save" on="submit"}}>
|
||||
<div class="field">
|
||||
<label>Description:</label>
|
||||
{{label for="description" content="Description:"}}
|
||||
{{input value=description}}
|
||||
</div>
|
||||
{{#travis-field "value"}}
|
||||
<label class="value">Private Key:</label>
|
||||
{{label for="value" class="value" content="Private key:"}}
|
||||
{{textarea value=value}} {{travis-errors "value"}}
|
||||
{{/travis-field}}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<a href="#" class="close" {{action "close" target="view"}}></a>
|
||||
<a href="#" class="close" {{action "close" target=view}}></a>
|
||||
<p>
|
||||
<label>Branch:</label>
|
||||
{{#if view.branches.isLoaded}}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{{#view Travis.WorkersView}}
|
||||
<a id="toggle-workers" {{action "toggleWorkers" target="view"}}></a>
|
||||
<a id="toggle-workers" {{action "toggleWorkers" target=view}}></a>
|
||||
<ul id="workers">
|
||||
{{#each group in controller.groups}}
|
||||
{{#view Travis.WorkersListView}}
|
||||
<li class="group">
|
||||
<h5 {{action "toggle" target="view"}}>
|
||||
<h5 {{action "toggle" target=view}}>
|
||||
{{group.firstObject.host}}
|
||||
</h5>
|
||||
<ul>
|
||||
|
|
|
@ -6,8 +6,15 @@ Em.View.reopen
|
|||
|
||||
@_super.apply(this, arguments)
|
||||
|
||||
Travis.NotFoundView = Ember.View.extend
|
||||
layoutName: 'layouts/simple'
|
||||
|
||||
@Travis.reopen
|
||||
View: Em.View.extend
|
||||
actions:
|
||||
popup: (name) -> @popup(name)
|
||||
popupClose: -> @popupClose()
|
||||
|
||||
popup: (name) ->
|
||||
@popupCloseAll()
|
||||
name = event?.target?.name || name
|
||||
|
@ -21,10 +28,31 @@ Em.View.reopen
|
|||
|
||||
$('.popup').removeClass('display')
|
||||
|
||||
Travis.IndexView = Travis.View.extend
|
||||
layoutName: 'layouts/home'
|
||||
classNames: ['application']
|
||||
|
||||
@Travis.NoOwnedReposView = Ember.View.extend
|
||||
templateName: 'pro/no_owned_repos'
|
||||
|
||||
Travis.GettingStartedView = Travis.View.extend
|
||||
templateName: 'no_owned_repos'
|
||||
templateName: (->
|
||||
if Travis.config.pro
|
||||
'pro/no_owned_repos'
|
||||
else
|
||||
'no_owned_repos'
|
||||
).property()
|
||||
|
||||
Travis.AuthSigninView = Travis.View.extend
|
||||
layoutName: 'layouts/simple'
|
||||
|
||||
Travis.InsufficientOauthPermissionsView = Travis.View.extend
|
||||
layoutName: 'layouts/simple'
|
||||
classNames: ['application']
|
||||
|
||||
Travis.FirstSyncView = Travis.View.extend
|
||||
layoutName: 'layouts/simple'
|
||||
classNames: ['application']
|
||||
didInsertElement: ->
|
||||
this.addObserver('controller.isSyncing', this, this.isSyncingDidChange)
|
||||
|
||||
|
@ -37,7 +65,7 @@ Travis.FirstSyncView = Travis.View.extend
|
|||
Ember.run.later this, ->
|
||||
Travis.Repo.fetch(member: @get('controller.user.login')).then( (repos) ->
|
||||
if repos.get('length')
|
||||
self.get('controller').transitionToRoute('index.current')
|
||||
self.get('controller').transitionToRoute('index')
|
||||
else
|
||||
self.get('controller').transitionToRoute('profile')
|
||||
).then(null, (e) ->
|
||||
|
@ -46,6 +74,37 @@ Travis.FirstSyncView = Travis.View.extend
|
|||
, Travis.config.syncingPageRedirectionTime
|
||||
|
||||
|
||||
Travis.SidebarView = Travis.View.extend
|
||||
templateName: 'layouts/sidebar'
|
||||
|
||||
didInsertElement: ->
|
||||
@_super.apply this, arguments
|
||||
|
||||
classQueues: (->
|
||||
'active' if @get('activeTab') == 'queues'
|
||||
).property('activeTab')
|
||||
|
||||
classWorkers: (->
|
||||
'active' if @get('activeTab') == 'workers'
|
||||
).property('activeTab')
|
||||
|
||||
classJobs: (->
|
||||
'active' if @get('activeTab') == 'jobs'
|
||||
).property('activeTab')
|
||||
|
||||
Travis.QueueItemView = Travis.View.extend
|
||||
tagName: 'li'
|
||||
|
||||
Travis.RunningJobsView = Em.View.extend
|
||||
templateName: 'jobs'
|
||||
elementId: 'running-jobs'
|
||||
|
||||
Travis.QueueView = Em.View.extend
|
||||
templateName: 'queues/show'
|
||||
init: ->
|
||||
@_super.apply this, arguments
|
||||
@set 'controller', @get('controller').container.lookup('controller:queues')
|
||||
|
||||
require 'views/accounts'
|
||||
require 'views/annotation'
|
||||
require 'views/application'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
@Travis.reopen
|
||||
AccountsView: Travis.View.extend
|
||||
ProfileAccountsView: Travis.View.extend
|
||||
tabBinding: 'controller.tab'
|
||||
templateName: 'profile/accounts'
|
||||
classAccounts: (->
|
||||
|
|
|
@ -1,12 +1,5 @@
|
|||
Travis.reopen
|
||||
ApplicationView: Travis.View.extend
|
||||
templateName: (-> @get 'controller.templateName' ).property('controller.templateName')
|
||||
classNames: ['application']
|
||||
|
||||
templateNameDidChange: (->
|
||||
@rerender()
|
||||
).observes('templateName')
|
||||
|
||||
click: (event) ->
|
||||
# TODO: this solves the case of closing menus and popups,
|
||||
# but I would like to rewrite it later, not sure how
|
||||
|
|
|
@ -3,10 +3,6 @@ Travis.reopen
|
|||
templateName: 'builds/list'
|
||||
buildsBinding: 'controller.builds'
|
||||
|
||||
isPullRequestsList: (->
|
||||
@get('controller.tab') == 'pull_requests'
|
||||
).property('controller.tab')
|
||||
|
||||
ShowMoreButton: Em.View.extend
|
||||
tagName: 'button'
|
||||
classNameBindings: ['isLoading', 'showMore']
|
||||
|
@ -37,14 +33,6 @@ Travis.reopen
|
|||
Travis.Helpers.colorForState(@get('build.state'))
|
||||
).property('build.state')
|
||||
|
||||
urlGithubCommit: (->
|
||||
Travis.Urls.githubCommit(@get('repo.slug'), @get('commit.sha'))
|
||||
).property('repo.slug', 'commit.sha')
|
||||
|
||||
urlGithubPullRequest: (->
|
||||
Travis.Urls.githubPullRequest(@get('repo.slug'), @get('build.pullRequestNumber'))
|
||||
).property('repo.slug', 'build.pullRequestNumber')
|
||||
|
||||
BuildView: Travis.View.extend
|
||||
templateName: 'builds/show'
|
||||
classNameBindings: ['color', 'loading']
|
||||
|
|
|
@ -12,5 +12,6 @@
|
|||
@get('flash.type') || 'broadcast'
|
||||
).property('flash.type')
|
||||
|
||||
close: ->
|
||||
@get('controller').close(@get('flash'))
|
||||
actions:
|
||||
close: ->
|
||||
@get('controller').close(@get('flash'))
|
||||
|
|
|
@ -3,6 +3,13 @@ Travis.reopen
|
|||
templateName: 'jobs/list'
|
||||
buildBinding: 'controller.build'
|
||||
|
||||
jobTableId: Ember.computed(->
|
||||
if @get('required')
|
||||
'jobs'
|
||||
else
|
||||
'allowed_failure_jobs'
|
||||
)
|
||||
|
||||
JobsItemView: Travis.View.extend
|
||||
tagName: 'tr'
|
||||
classNameBindings: ['color']
|
||||
|
|
|
@ -9,21 +9,39 @@ Travis.reopen
|
|||
LogView: Travis.View.extend
|
||||
templateName: 'jobs/log'
|
||||
logBinding: 'job.log'
|
||||
contextBinding: 'job'
|
||||
|
||||
didInsertElement: ->
|
||||
@setupLog()
|
||||
|
||||
logDidChange: (->
|
||||
@setupLog()
|
||||
).observes('log')
|
||||
|
||||
logWillChange: (->
|
||||
@teardownLog()
|
||||
).observesBefore('log')
|
||||
|
||||
willDestroyElement: ->
|
||||
@teardownLog()
|
||||
|
||||
teardownLog: ->
|
||||
job = @get('job')
|
||||
job.unsubscribe() if job
|
||||
|
||||
setupLog: ->
|
||||
job = @get('job')
|
||||
if job
|
||||
job.get('log').fetch()
|
||||
job.subscribe()
|
||||
|
||||
willDestroyElement: ->
|
||||
job = @get('job')
|
||||
job.unsubscribe() if job
|
||||
|
||||
PreView: Em.View.extend
|
||||
templateName: 'jobs/pre'
|
||||
|
||||
logWillChange: (->
|
||||
console.log 'log view: log will change' if Log.DEBUG
|
||||
@teardownLog()
|
||||
).observesBefore('log')
|
||||
|
||||
didInsertElement: ->
|
||||
console.log 'log view: did insert' if Log.DEBUG
|
||||
@_super.apply this, arguments
|
||||
|
@ -31,37 +49,47 @@ Travis.reopen
|
|||
|
||||
willDestroyElement: ->
|
||||
console.log 'log view: will destroy' if Log.DEBUG
|
||||
parts = @get('log.parts')
|
||||
parts.removeArrayObserver(@, didChange: 'partsDidChange', willChange: 'noop')
|
||||
parts.destroy()
|
||||
@lineSelector?.willDestroy()
|
||||
@teardownLog()
|
||||
|
||||
versionDidChange: (->
|
||||
@rerender() if @get('state') == 'inDOM'
|
||||
@rerender() if @get('_state') == 'inDOM'
|
||||
).observes('log.version')
|
||||
|
||||
logDidChange: (->
|
||||
console.log 'log view: log did change: rerender' if Log.DEBUG
|
||||
@rerender() if @get('state') == 'inDOM'
|
||||
|
||||
if @get('log')
|
||||
@createEngine()
|
||||
@rerender() if @get('_state') == 'inDOM'
|
||||
).observes('log')
|
||||
|
||||
teardownLog: ->
|
||||
if log = @get('log')
|
||||
parts = log.get('parts')
|
||||
parts.removeArrayObserver(@, didChange: 'partsDidChange', willChange: 'noop')
|
||||
parts.destroy()
|
||||
log.notifyPropertyChange('parts')
|
||||
@lineSelector?.willDestroy()
|
||||
|
||||
createEngine: ->
|
||||
console.log 'log view: create engine' if Log.DEBUG
|
||||
@scroll = new Log.Scroll beforeScroll: =>
|
||||
@unfoldHighlight()
|
||||
@engine = Log.create(limit: Log.LIMIT, listeners: [@scroll])
|
||||
@logFolder = new Travis.LogFolder(@$().find('#log'))
|
||||
@lineSelector = new Travis.LinesSelector(@$().find('#log'), @scroll, @logFolder)
|
||||
@observeParts()
|
||||
if @get('log')
|
||||
console.log 'log view: create engine' if Log.DEBUG
|
||||
@scroll = new Log.Scroll beforeScroll: =>
|
||||
@unfoldHighlight()
|
||||
@engine = Log.create(limit: Log.LIMIT, listeners: [@scroll])
|
||||
@logFolder = new Travis.LogFolder(@$().find('#log'))
|
||||
@lineSelector = new Travis.LinesSelector(@$().find('#log'), @scroll, @logFolder)
|
||||
@observeParts()
|
||||
|
||||
unfoldHighlight: ->
|
||||
@lineSelector.unfoldLines()
|
||||
|
||||
observeParts: ->
|
||||
parts = @get('log.parts')
|
||||
parts.addArrayObserver(@, didChange: 'partsDidChange', willChange: 'noop')
|
||||
parts = parts.slice(0)
|
||||
@partsDidChange(parts, 0, null, parts.length)
|
||||
if log = @get('log')
|
||||
parts = log.get('parts')
|
||||
parts.addArrayObserver(@, didChange: 'partsDidChange', willChange: 'noop')
|
||||
parts = parts.slice(0)
|
||||
@partsDidChange(parts, 0, null, parts.length)
|
||||
|
||||
partsDidChange: (parts, start, _, added) ->
|
||||
console.log 'log view: parts did change' if Log.DEBUG
|
||||
|
@ -76,8 +104,12 @@ Travis.reopen
|
|||
).property()
|
||||
|
||||
plainTextLogUrl: (->
|
||||
Travis.Urls.plainTextLog(id) if id = @get('log.job.id')
|
||||
).property('job.log.id')
|
||||
if id = @get('log.job.id')
|
||||
url = Travis.Urls.plainTextLog(id)
|
||||
if Travis.config.pro
|
||||
url += "&access_token=#{@get('job.log.token')}"
|
||||
url
|
||||
).property('job.log.id', 'job.log.token')
|
||||
|
||||
toggleTailing: ->
|
||||
Travis.tailing.toggle()
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
Travis.reopen
|
||||
ProfileView: Travis.View.extend
|
||||
templateName: 'profile/show'
|
||||
layoutName: 'layouts/profile'
|
||||
classNames: ['application']
|
||||
accountBinding: 'controller.account'
|
||||
subscribedBinding: 'account.subscribed'
|
||||
educationBinding: 'account.education'
|
||||
|
||||
name: (->
|
||||
@get('account.name') || @get('account.login')
|
||||
|
@ -34,7 +38,7 @@ Travis.reopen
|
|||
Travis.Urls.githubAdmin(@get('hook.slug'))
|
||||
).property('hook.slug')
|
||||
|
||||
UserView: Travis.View.extend
|
||||
AccountsInfoView: Travis.View.extend
|
||||
templateName: 'profile/tabs/user'
|
||||
userBinding: 'controller.user'
|
||||
|
||||
|
|
|
@ -29,10 +29,6 @@
|
|||
tabBinding: 'controller.tab'
|
||||
currentUserBinding: 'controller.currentUser.id'
|
||||
|
||||
activate: (name) ->
|
||||
@get('controller').transitionToRoot()
|
||||
@get('controller').activate(name)
|
||||
|
||||
classRecent: (->
|
||||
'active' if @get('tab') == 'recent'
|
||||
).property('tab')
|
||||
|
|
|
@ -14,24 +14,6 @@ Travis.reopen
|
|||
@get('repos.isLoaded') && @get('repos.length') == 0
|
||||
).property('repos.isLoaded', 'repos.length')
|
||||
|
||||
repoIsLoadedDidChange: (->
|
||||
# Ember does not automatically rerender outlets and sometimes 'pane' outlet
|
||||
# in repos/show.hbs is empty when view is rerendered without routing
|
||||
# taking place. Try to render the default outlet in such case
|
||||
# TODO: look into fixing it in more general way
|
||||
Ember.run.schedule('afterRender', this, ->
|
||||
pane = Ember.get('_outlets.pane')
|
||||
if @get('controller.repo.isLoaded') && @state == 'inDOM' &&
|
||||
@get('controller.repo.lastBuild') &&
|
||||
@get('controller.tab') == 'current' && (!pane || pane.state == 'destroyed')
|
||||
view = @get('controller.container').lookup('view:build')
|
||||
view.set('controller', @get('controller.container').lookup('controller:build'))
|
||||
Ember.run.next =>
|
||||
@set('_outlets', {}) if !@get('_outlets') && !@isDestroyed
|
||||
@connectOutlet('pane', view) unless @isDestroyed
|
||||
)
|
||||
).observes('controller.repo.isLoaded')
|
||||
|
||||
statusImages: ->
|
||||
@popupCloseAll()
|
||||
view = Travis.StatusImagesView.create(toolsView: this)
|
||||
|
@ -44,7 +26,12 @@ Travis.reopen
|
|||
).property('controller.repo.slug')
|
||||
|
||||
ReposEmptyView: Travis.View.extend
|
||||
template: ''
|
||||
template: (->
|
||||
if Travis.config.pro
|
||||
'pro/repos/show/empty'
|
||||
else
|
||||
''
|
||||
).property()
|
||||
|
||||
RepoShowTabsView: Travis.View.extend
|
||||
templateName: 'repos/show/tabs'
|
||||
|
@ -124,26 +111,27 @@ Travis.reopen
|
|||
closeMenu: ->
|
||||
$('.menu').removeClass('display')
|
||||
|
||||
menu: ->
|
||||
@popupCloseAll()
|
||||
$('#tools .menu').toggleClass('display')
|
||||
event.stopPropagation()
|
||||
|
||||
regenerateKeyPopup: ->
|
||||
if @get('canRegenerateKey')
|
||||
@set('active', true)
|
||||
@closeMenu()
|
||||
@popup(event)
|
||||
actions:
|
||||
menu: ->
|
||||
@popupCloseAll()
|
||||
$('#tools .menu').toggleClass('display')
|
||||
event.stopPropagation()
|
||||
|
||||
regenerateKey: ->
|
||||
@popupCloseAll()
|
||||
regenerateKeyPopup: ->
|
||||
if @get('canRegenerateKey')
|
||||
@set('active', true)
|
||||
@closeMenu()
|
||||
@popup(event)
|
||||
event.stopPropagation()
|
||||
|
||||
(@get('repo.content') || @get('repo')).regenerateKey
|
||||
success: =>
|
||||
@popup('regeneration-success')
|
||||
error: ->
|
||||
Travis.lookup('controller:flash').loadFlashes([{ error: 'Travis encountered an error while trying to regenerate the key, please try again.'}])
|
||||
regenerateKey: ->
|
||||
@popupCloseAll()
|
||||
|
||||
(@get('repo.content') || @get('repo')).regenerateKey
|
||||
success: =>
|
||||
@popup('regeneration-success')
|
||||
error: ->
|
||||
Travis.lookup('controller:flash').loadFlashes([{ error: 'Travis encountered an error while trying to regenerate the key, please try again.'}])
|
||||
|
||||
canRegenerateKey: (->
|
||||
@get('hasAdminPermission')
|
||||
|
@ -185,45 +173,59 @@ Travis.reopen
|
|||
tabBinding: 'controller.tab'
|
||||
currentUserBinding: 'controller.currentUser'
|
||||
|
||||
cancelBuild: ->
|
||||
if @get('canCancelBuild')
|
||||
Travis.flash(notice: 'Build cancellation has been scheduled.')
|
||||
@get('build').cancel().then ->
|
||||
Travis.flash(success: 'Build has been successfully canceled.')
|
||||
, (xhr) ->
|
||||
if xhr.status == 422
|
||||
Travis.flash(error: 'This build can\'t be canceled')
|
||||
else if xhr.status == 403
|
||||
Travis.flash(error: 'You don\'t have sufficient access to cancel this build')
|
||||
else
|
||||
Travis.flash(error: 'An error occured when canceling the build')
|
||||
actions:
|
||||
requeueBuild: ->
|
||||
if @get('canRequeueBuild')
|
||||
@requeue @get('build')
|
||||
|
||||
requeueJob: ->
|
||||
if @get('canRequeueJob')
|
||||
@requeue @get('job')
|
||||
|
||||
cancelBuild: ->
|
||||
if @get('canCancelBuild')
|
||||
Travis.flash(notice: 'Build cancellation has been scheduled.')
|
||||
@get('build').cancel().then ->
|
||||
Travis.flash(success: 'Build has been successfully canceled.')
|
||||
, (xhr) ->
|
||||
if xhr.status == 422
|
||||
Travis.flash(error: 'This build can\'t be canceled')
|
||||
else if xhr.status == 403
|
||||
Travis.flash(error: 'You don\'t have sufficient access to cancel this build')
|
||||
else
|
||||
Travis.flash(error: 'An error occured when canceling the build')
|
||||
|
||||
|
||||
removeLog: ->
|
||||
if @get('canRemoveLog')
|
||||
job = @get('job') || @get('build.jobs.firstObject')
|
||||
job.removeLog().then ->
|
||||
Travis.flash(success: 'Log has been successfully removed.')
|
||||
, (xhr) ->
|
||||
if xhr.status == 409
|
||||
Travis.flash(error: 'Log can\'t be removed')
|
||||
else if xhr.status == 401
|
||||
Travis.flash(error: 'You don\'t have sufficient access to remove the log')
|
||||
else
|
||||
Travis.flash(error: 'An error occured when removing the log')
|
||||
removeLog: ->
|
||||
if @get('canRemoveLog')
|
||||
job = @get('job') || @get('build.jobs.firstObject')
|
||||
job.removeLog().then ->
|
||||
Travis.flash(success: 'Log has been successfully removed.')
|
||||
, (xhr) ->
|
||||
if xhr.status == 409
|
||||
Travis.flash(error: 'Log can\'t be removed')
|
||||
else if xhr.status == 401
|
||||
Travis.flash(error: 'You don\'t have sufficient access to remove the log')
|
||||
else
|
||||
Travis.flash(error: 'An error occured when removing the log')
|
||||
|
||||
cancelJob: ->
|
||||
if @get('canCancelJob')
|
||||
Travis.flash(notice: 'Job cancellation has been scheduled.')
|
||||
@get('job').cancel().then ->
|
||||
Travis.flash(success: 'Job has been successfully canceled.')
|
||||
, (xhr) ->
|
||||
if xhr.status == 422
|
||||
Travis.flash(error: 'This job can\'t be canceled')
|
||||
else if xhr.status == 403
|
||||
Travis.flash(error: 'You don\'t have sufficient access to cancel this job')
|
||||
else
|
||||
Travis.flash(error: 'An error occured when canceling the job')
|
||||
cancelJob: ->
|
||||
if @get('canCancelJob')
|
||||
Travis.flash(notice: 'Job cancellation has been scheduled.')
|
||||
@get('job').cancel().then ->
|
||||
Travis.flash(success: 'Job has been successfully canceled.')
|
||||
, (xhr) ->
|
||||
if xhr.status == 422
|
||||
Travis.flash(error: 'This job can\'t be canceled')
|
||||
else if xhr.status == 403
|
||||
Travis.flash(error: 'You don\'t have sufficient access to cancel this job')
|
||||
else
|
||||
Travis.flash(error: 'An error occured when canceling the job')
|
||||
|
||||
codeClimatePopup: ->
|
||||
@popupCloseAll()
|
||||
@popup('code-climate')
|
||||
event.stopPropagation() if event?
|
||||
|
||||
hasPermission: (->
|
||||
if permissions = @get('currentUser.permissions')
|
||||
|
@ -260,10 +262,20 @@ Travis.reopen
|
|||
(@get('build.jobs.length') == 1 && @get('build.jobs.firstObject.id'))
|
||||
).property('job.id', 'build.jobs.firstObject.id', 'build.jobs.length')
|
||||
|
||||
job: (->
|
||||
if id = @get('jobIdForLog')
|
||||
Travis.Job.find(id)
|
||||
).property('jobIdForLog')
|
||||
|
||||
|
||||
plainTextLogUrl: (->
|
||||
if id = @get('jobIdForLog')
|
||||
Travis.Urls.plainTextLog(id)
|
||||
).property('jobIdForLog')
|
||||
url = Travis.Urls.plainTextLog(id)
|
||||
if Travis.config.pro
|
||||
token = @get('job.log.token') || @get('build.jobs.firstObject.log.token')
|
||||
url += "&access_token=#{token}"
|
||||
url
|
||||
).property('jobIdForLog', 'job.log.token', 'build.jobs.firstObject.log.token')
|
||||
|
||||
canRemoveLog: (->
|
||||
@get('displayRemoveLog') && @get('hasPermission')
|
||||
|
@ -301,11 +313,6 @@ Travis.reopen
|
|||
Travis.config.code_climate == "true" and @get('repo.githubLanguage') == 'Ruby'
|
||||
).property('repo.githubLanguage')
|
||||
|
||||
codeClimatePopup: ->
|
||||
@popupCloseAll()
|
||||
@popup('code-climate')
|
||||
event.stopPropagation() if event?
|
||||
|
||||
requeueFinished: ->
|
||||
@set('requeueing', false)
|
||||
|
||||
|
@ -314,12 +321,3 @@ Travis.reopen
|
|||
@set('requeueing', true)
|
||||
thing.requeue().then(this.requeueFinished.bind(this), this.requeueFinished.bind(this))
|
||||
|
||||
requeueBuild: ->
|
||||
if @get('canRequeueBuild')
|
||||
@requeue @get('build')
|
||||
|
||||
requeueJob: ->
|
||||
if @get('canRequeueJob')
|
||||
@requeue @get('job')
|
||||
|
||||
|
||||
|
|
|
@ -30,8 +30,9 @@ Travis.StatusImagesView = Em.View.extend
|
|||
show: ->
|
||||
@set('display', true)
|
||||
|
||||
close: ->
|
||||
@destroy()
|
||||
actions:
|
||||
close: ->
|
||||
@destroy()
|
||||
|
||||
setStatusImageFormat: (->
|
||||
@set('statusImageFormat', @formats[0])
|
||||
|
|
|
@ -1,68 +0,0 @@
|
|||
// https://gist.github.com/2018185
|
||||
// For reference: https://github.com/wagenet/ember.js/blob/ac66dcb8a1cbe91d736074441f853e0da474ee6e/packages/ember-handlebars/lib/views/bound_property_view.js
|
||||
var BoundHelperView = Ember.View.extend(Ember._Metamorph, {
|
||||
|
||||
context: null,
|
||||
options: null,
|
||||
property: null,
|
||||
// paths of the property that are also observed
|
||||
propertyPaths: [],
|
||||
|
||||
value: Ember.K,
|
||||
|
||||
valueForRender: function() {
|
||||
var value = this.value(Ember.get(this.context, this.property), this.options);
|
||||
if (this.options.escaped) { value = Handlebars.Utils.escapeExpression(value); }
|
||||
return value;
|
||||
},
|
||||
|
||||
render: function(buffer) {
|
||||
buffer.push(this.valueForRender());
|
||||
},
|
||||
|
||||
valueDidChange: function() {
|
||||
if (this.morph.isRemoved()) { return; }
|
||||
this.morph.html(this.valueForRender());
|
||||
},
|
||||
|
||||
didInsertElement: function() {
|
||||
this.valueDidChange();
|
||||
},
|
||||
|
||||
init: function() {
|
||||
this._super();
|
||||
Ember.addObserver(this.context, this.property, this, 'valueDidChange');
|
||||
this.get('propertyPaths').forEach(function(propName) {
|
||||
Ember.addObserver(this.context, this.property + '.' + propName, this, 'valueDidChange');
|
||||
}, this);
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
Ember.removeObserver(this.context, this.property, this, 'valueDidChange');
|
||||
this.get('propertyPaths').forEach(function(propName) {
|
||||
this.context.removeObserver(this.property + '.' + propName, this, 'valueDidChange');
|
||||
}, this);
|
||||
this._super();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Ember.registerBoundHelper = function(name, func) {
|
||||
var propertyPaths = Array.prototype.slice.call(arguments, 2);
|
||||
Ember.Handlebars.registerHelper(name, function(property, options) {
|
||||
var data = options.data,
|
||||
view = data.view,
|
||||
ctx = this;
|
||||
|
||||
var bindView = view.createChildView(BoundHelperView, {
|
||||
property: property,
|
||||
propertyPaths: propertyPaths,
|
||||
context: ctx,
|
||||
options: options.hash,
|
||||
value: func
|
||||
});
|
||||
|
||||
view.appendChild(bindView);
|
||||
});
|
||||
};
|
||||
|
|
@ -76,6 +76,7 @@ Travis.LogChunks = Em.ArrayProxy.extend
|
|||
if part.final
|
||||
@notifyPropertyChange('final')
|
||||
|
||||
Ember.run.once this, ->
|
||||
@tryFinalizing()
|
||||
@resetTimeout()
|
||||
Ember.run this, ->
|
||||
Ember.run.once this, ->
|
||||
@tryFinalizing()
|
||||
@resetTimeout()
|
||||
|
|
|
@ -34,84 +34,19 @@ Array.prototype.diff = (a) ->
|
|||
|
||||
@_super(key)
|
||||
|
||||
load: (id, hash) ->
|
||||
@loadedAttributes = []
|
||||
@loadedRelationships = []
|
||||
|
||||
attributes = this.constructor.getAttributes() || []
|
||||
relationships = this.constructor.getRelationships() || []
|
||||
|
||||
if hash
|
||||
for key in attributes
|
||||
dataKey = @dataKey(key)
|
||||
if hash.hasOwnProperty(dataKey)
|
||||
@loadedAttributes.pushObject(key)
|
||||
|
||||
for key in relationships
|
||||
dataKey = @dataKey(key)
|
||||
if hash.hasOwnProperty(dataKey)
|
||||
@loadedRelationships.pushObject(key)
|
||||
|
||||
incomplete = Ember.EnumerableUtils.intersection(@loadedAttributes, attributes).length != attributes.length ||
|
||||
Ember.EnumerableUtils.intersection(@loadedRelationships, relationships).length != relationships.length
|
||||
|
||||
#if incomplete
|
||||
# properties = attributes.concat(relationships)
|
||||
# loadedProperties = @loadedAttributes.concat(@loadedRelationships)
|
||||
# diff = properties.diff(loadedProperties)
|
||||
# #console.log(@constructor, 'with id', id, 'loaded as incomplete, info:', { diff: diff, attributes: loadedProperties, data: hash})
|
||||
|
||||
@set('incomplete', incomplete)
|
||||
|
||||
@_super(id, hash)
|
||||
|
||||
getAttr: (key, options) ->
|
||||
@needsCompletionCheck(key)
|
||||
@_super.apply this, arguments
|
||||
|
||||
getBelongsTo: (key, type, meta) ->
|
||||
unless key
|
||||
key = type.singularName() + '_id'
|
||||
@needsCompletionCheck(key)
|
||||
@_super(key, type, meta)
|
||||
|
||||
getHasMany: (key, type, meta) ->
|
||||
unless key
|
||||
key = type.singularName() + '_ids'
|
||||
@needsCompletionCheck(key)
|
||||
@_super(key, type, meta)
|
||||
|
||||
needsCompletionCheck: (key) ->
|
||||
if key && (@isAttribute(key) || @isRelationship(key)) &&
|
||||
@get('incomplete') && !@isPropertyLoaded(key)
|
||||
@loadTheRest(key)
|
||||
|
||||
isAttribute: (name) ->
|
||||
this.constructor.getAttributes().contains(name)
|
||||
|
||||
isRelationship: (name) ->
|
||||
this.constructor.getRelationships().contains(name)
|
||||
|
||||
loadTheRest: (key) ->
|
||||
# for some weird reason key comes changed to a string and for some weird reason it even is called with
|
||||
# undefined key
|
||||
return if !key || key == 'undefined'
|
||||
|
||||
message = "Load missing fields for #{@constructor.toString()} because of missing key '#{key}', cid: #{@get('clientId')}, id: #{@get('id')}"
|
||||
if @isAttribute('state') && key != 'state'
|
||||
message += ", in state: #{@get('state')}"
|
||||
console.log message
|
||||
return if @get('isCompleting')
|
||||
@set 'isCompleting', true
|
||||
|
||||
@reload()
|
||||
|
||||
select: ->
|
||||
@constructor.select(@get('id'))
|
||||
|
||||
isPropertyLoaded: (name) ->
|
||||
@loadedAttributes.contains(name) || @loadedRelationships.contains(name)
|
||||
|
||||
@Travis.Model.reopenClass
|
||||
select: (id) ->
|
||||
@find().forEach (record) ->
|
||||
|
|
|
@ -5,53 +5,56 @@ module "Build page",
|
|||
Ember.run -> Travis.reset()
|
||||
|
||||
test "displaying information on build page", ->
|
||||
visit('/travis-ci/travis-core/builds').then ->
|
||||
visit('/travis-ci/travis-core/builds/1').then ->
|
||||
listsRepos [
|
||||
{ slug: 'travis-ci/travis-hub', build: { number: 4, url: '/travis-ci/travis-hub/builds/4', duration: '1 min', finishedAt: '-' } }
|
||||
{ slug: 'travis-ci/travis-core', build: { number: 1, url: '/travis-ci/travis-core/builds/1', duration: '30 sec', finishedAt: '3 minutes ago' } }
|
||||
{ slug: 'travis-ci/travis-assets', build: { number: 3, url: '/travis-ci/travis-assets/builds/3', duration: '30 sec', finishedAt: 'a day ago' } }
|
||||
visit('/travis-ci/travis-core/builds')
|
||||
visit('/travis-ci/travis-core/builds/1')
|
||||
andThen(->
|
||||
listsRepos [
|
||||
{ slug: 'travis-ci/travis-hub', build: { number: 4, url: '/travis-ci/travis-hub/builds/4', duration: '1 min', finishedAt: '-' } }
|
||||
{ slug: 'travis-ci/travis-core', build: { number: 1, url: '/travis-ci/travis-core/builds/1', duration: '30 sec', finishedAt: '3 minutes ago' } }
|
||||
{ slug: 'travis-ci/travis-assets', build: { number: 3, url: '/travis-ci/travis-assets/builds/3', duration: '30 sec', finishedAt: 'a day ago' } }
|
||||
]
|
||||
|
||||
displaysRepository
|
||||
href: '/travis-ci/travis-core'
|
||||
|
||||
displaysSummary
|
||||
type: 'build'
|
||||
id: 1
|
||||
repo: 'travis-ci/travis-core'
|
||||
commit: '1234567'
|
||||
branch: 'master'
|
||||
compare: '0123456..1234567'
|
||||
finishedAt: '3 minutes ago'
|
||||
duration: '30 sec'
|
||||
message: 'commit message 1'
|
||||
|
||||
displaysSummaryGravatars
|
||||
authorEmail: 'author@email.com'
|
||||
committerEmail: 'committer@email.com'
|
||||
|
||||
|
||||
displaysTabs
|
||||
current: { href: '/travis-ci/travis-core' }
|
||||
builds: { href: '/travis-ci/travis-core/builds' }
|
||||
build: { href: '/travis-ci/travis-core/builds/1', active: true }
|
||||
job: { hidden: true }
|
||||
|
||||
listsJobs
|
||||
table: '#jobs'
|
||||
headers: ['Job', 'Duration', 'Finished', 'Ruby']
|
||||
jobs: [
|
||||
{ color: 'green', id: 1, number: '1.1', repo: 'travis-ci/travis-core', finishedAt: '3 minutes ago', duration: '30 sec', rvm: 'rbx' }
|
||||
{ color: 'red', id: 2, number: '1.2', repo: 'travis-ci/travis-core', finishedAt: '2 minutes ago', duration: '40 sec', rvm: '1.9.3' }
|
||||
]
|
||||
|
||||
displaysRepository
|
||||
href: '/travis-ci/travis-core'
|
||||
listsJobs
|
||||
table: '#allowed_failure_jobs'
|
||||
headers: ['Job', 'Duration', 'Finished', 'Ruby']
|
||||
jobs: [
|
||||
{ color: '', id: 3, number: '1.3', repo: 'travis-ci/travis-core', finishedAt: '-', duration: '-', rvm: 'jruby' }
|
||||
]
|
||||
)
|
||||
|
||||
displaysSummary
|
||||
type: 'build'
|
||||
id: 1
|
||||
repo: 'travis-ci/travis-core'
|
||||
commit: '1234567'
|
||||
branch: 'master'
|
||||
compare: '0123456..1234567'
|
||||
finishedAt: '3 minutes ago'
|
||||
duration: '30 sec'
|
||||
message: 'commit message 1'
|
||||
|
||||
displaysSummaryGravatars
|
||||
authorEmail: 'author@email.com'
|
||||
committerEmail: 'committer@email.com'
|
||||
|
||||
|
||||
displaysTabs
|
||||
current: { href: '/travis-ci/travis-core' }
|
||||
builds: { href: '/travis-ci/travis-core/builds' }
|
||||
build: { href: '/travis-ci/travis-core/builds/1', active: true }
|
||||
job: { hidden: true }
|
||||
|
||||
listsJobs
|
||||
table: '#jobs'
|
||||
headers: ['Job', 'Duration', 'Finished', 'Ruby']
|
||||
jobs: [
|
||||
{ color: 'green', id: 1, number: '1.1', repo: 'travis-ci/travis-core', finishedAt: '3 minutes ago', duration: '30 sec', rvm: 'rbx' }
|
||||
{ color: 'red', id: 2, number: '1.2', repo: 'travis-ci/travis-core', finishedAt: '2 minutes ago', duration: '40 sec', rvm: '1.9.3' }
|
||||
]
|
||||
|
||||
listsJobs
|
||||
table: '#allowed_failure_jobs'
|
||||
headers: ['Job', 'Duration', 'Finished', 'Ruby']
|
||||
jobs: [
|
||||
{ color: '', id: 3, number: '1.3', repo: 'travis-ci/travis-core', finishedAt: '-', duration: '-', rvm: 'jruby' }
|
||||
]
|
||||
|
||||
test "updating current build", ->
|
||||
visit('/travis-ci/travis-core').then ->
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
module "Router",
|
||||
setup: ->
|
||||
Ember.run -> Travis.advanceReadiness()
|
||||
teardown: ->
|
||||
Ember.run -> Travis.reset()
|
||||
|
||||
|
|
|
@ -62,8 +62,8 @@
|
|||
|
||||
equal($('a.slug', row).attr('href'), "/#{repo.slug}")
|
||||
equal($('a.last_build', row).attr('href'), repo.build.url)
|
||||
equal($('.duration', row).text(), repo.build.duration)
|
||||
equal($('.finished_at', row).text(), repo.build.finishedAt)
|
||||
equal($('.duration', row).text().trim(), repo.build.duration)
|
||||
equal($('.finished_at', row).text().trim(), repo.build.finishedAt)
|
||||
|
||||
@listsBuilds = (builds) ->
|
||||
listsItems('build', builds)
|
||||
|
@ -105,7 +105,7 @@
|
|||
element = $("td.finished_at", row)
|
||||
equal(element.text().trim(), job.finishedAt)
|
||||
|
||||
element = $("td:nth-child(6)", row)
|
||||
element = $("td:nth-child(4)", row)
|
||||
equal(element.text().trim(), job.rvm)
|
||||
|
||||
@listsQueuedJobs = (jobs) ->
|
||||
|
|
|
@ -6,37 +6,6 @@ module "Travis.Build",
|
|||
Travis.Build.resetData()
|
||||
Travis.Job.resetData()
|
||||
|
||||
test 'it does not load record on duration, finishedAt and result if job is not in finished state', ->
|
||||
Travis.Build.load [{ id: 1, state: 'started', started_at: null }]
|
||||
|
||||
Ember.run ->
|
||||
record = Travis.Build.find 1
|
||||
|
||||
record.loadTheRest = ->
|
||||
ok(false, 'loadTheRest should not be called')
|
||||
|
||||
record.get('duration')
|
||||
record.get('finishedAt')
|
||||
record.get('result')
|
||||
|
||||
wait().then ->
|
||||
ok(true, 'loadTheRest was not called')
|
||||
|
||||
test 'it loads record on duration, finishedAt and result if job is in finished state', ->
|
||||
expect(1)
|
||||
|
||||
Travis.Build.load [{ id: 1, state: 'passed', started_at: null }]
|
||||
|
||||
Ember.run ->
|
||||
record = Travis.Build.find 1
|
||||
|
||||
record.loadTheRest = ->
|
||||
ok(true, 'loadTheRest should be called')
|
||||
|
||||
record.get('finishedAt')
|
||||
|
||||
wait()
|
||||
|
||||
test 'it takes into account all the jobs when getting config keys', ->
|
||||
buildConfig = { rvm: ['1.9.3', '2.0.0'] }
|
||||
Travis.Build.load [{ id: '1', job_ids: ['1', '2', '3'], config: buildConfig }]
|
||||
|
|
|
@ -1,83 +0,0 @@
|
|||
fullPostHash = null
|
||||
Post = null
|
||||
Author = null
|
||||
|
||||
module "Travis.Model - incomplete",
|
||||
setup: ->
|
||||
fullPostHash = {
|
||||
id: '1',
|
||||
title: 'foo',
|
||||
published_at: 'today',
|
||||
|
||||
author_id: '1'
|
||||
}
|
||||
|
||||
Author = Travis.Model.extend()
|
||||
|
||||
Post = Travis.Model.extend(
|
||||
title: Ember.attr('string'),
|
||||
publishedAt: Ember.attr('string', key: 'published_at'),
|
||||
|
||||
author: Ember.belongsTo(Author, { key: 'author_id' })
|
||||
)
|
||||
|
||||
Post.adapter = Ember.FixtureAdapter.create()
|
||||
|
||||
test "record is marked as incomplete if attributes are missing when loading a record", ->
|
||||
Post.load([{ id: '1', title: 'foo' }])
|
||||
|
||||
record = Post.find('1')
|
||||
ok(record.get('incomplete'), 'record should be incomplete')
|
||||
equal(record.get('title'), 'foo', 'attributes should be accessible')
|
||||
|
||||
test "record is marked as complete if missing attributes are loaded", ->
|
||||
Post.load([{ id: '1', title: 'foo' }])
|
||||
|
||||
record = Post.find('1')
|
||||
ok(record.get('incomplete'), 'record should be complete')
|
||||
equal(record.get('title'), 'foo', 'attributes should be accessible')
|
||||
|
||||
record.load('1', fullPostHash)
|
||||
|
||||
ok(!record.get('incomplete'), 'record should be complete')
|
||||
|
||||
test "record is marked as incomplete if belongsTo key is missing", ->
|
||||
delete(fullPostHash.author_id)
|
||||
Post.load([fullPostHash])
|
||||
|
||||
record = Post.find('1')
|
||||
ok(record.get('incomplete'), 'record should be incomplete')
|
||||
|
||||
test "proeperty can be loaded as null, which means that the property is still loaded", ->
|
||||
fullPostHash.author_id = null
|
||||
fullPostHash.title = null
|
||||
|
||||
Post.load([fullPostHash])
|
||||
|
||||
record = Post.find('1')
|
||||
ok(!record.get('incomplete'), 'record should be complete')
|
||||
equal(record.get('title'), null, 'title should be null')
|
||||
|
||||
test "when accessing missing property, record is loaded", ->
|
||||
Post.FIXTURES = [fullPostHash]
|
||||
Post.load([{ id: '1' }])
|
||||
|
||||
record = null
|
||||
Ember.run -> record = Post.find('1')
|
||||
|
||||
ok(record.get('incomplete'), 'record should be incomplete')
|
||||
|
||||
publishedAt = null
|
||||
Ember.run -> publishedAt = record.get('publishedAt')
|
||||
|
||||
ok(!publishedAt, 'publishedAt should be missing')
|
||||
|
||||
stop()
|
||||
setTimeout( ->
|
||||
start()
|
||||
|
||||
Ember.run -> publishedAt = record.get('publishedAt')
|
||||
equal(publishedAt, 'today', 'publishedAt should be loaded')
|
||||
ok(!record.get('incomplete'), 'record should be complete')
|
||||
, 50)
|
||||
|
|
@ -1 +0,0 @@
|
|||
|
|
@ -36,37 +36,6 @@ test 'configKeys takes into account the keys of other jobs', ->
|
|||
deepEqual( configValues2, [ '2.0.0', undefined, 'Gemfile.1', undefined ] )
|
||||
deepEqual( configValues3, [ '1.9.3', undefined, undefined, 'OpenJDK' ] )
|
||||
|
||||
test 'it does not load record on duration, finishedAt and result if job is not in finished state', ->
|
||||
Travis.Job.load [{ id: 1, state: 'started', started_at: null }]
|
||||
|
||||
Ember.run ->
|
||||
record = Travis.Job.find 1
|
||||
|
||||
record.loadTheRest = ->
|
||||
ok(false, 'loadTheRest should not be called')
|
||||
|
||||
record.get('_duration')
|
||||
record.get('finishedAt')
|
||||
record.get('result')
|
||||
|
||||
wait().then ->
|
||||
ok(true, 'loadTheRest was not called')
|
||||
|
||||
test 'it loads record on duration, finishedAt and result if job is in finished state', ->
|
||||
expect(1)
|
||||
|
||||
Travis.Job.load [{ id: 1, state: 'passed', started_at: null }]
|
||||
|
||||
Ember.run ->
|
||||
record = Travis.Job.find 1
|
||||
|
||||
record.loadTheRest = ->
|
||||
ok(true, 'loadTheRest should be called')
|
||||
|
||||
record.get('finishedAt')
|
||||
|
||||
wait()
|
||||
|
||||
test 'returns config values for all keys available on build with different number of config keys in sibling jobs', ->
|
||||
buildAttrs =
|
||||
id: 1
|
||||
|
|
|
@ -6,30 +6,31 @@ test "it doesn't trigger downloading missing parts if they come in timely fashio
|
|||
|
||||
callback = -> ok false, 'callback should not be called'
|
||||
|
||||
chunks = Travis.LogChunks.create(timeout: 15, missingPartsCallback: callback, content: [])
|
||||
chunks = Travis.LogChunks.create(timeout: 20, missingPartsCallback: callback, content: [])
|
||||
|
||||
setTimeout (-> chunks.pushObject(number: 1, final: false)), 10
|
||||
setTimeout (-> chunks.pushObject(number: 2, final: false)), 20
|
||||
Ember.run.later (-> chunks.pushObject(number: 1, final: false)), 10
|
||||
Ember.run.later (-> chunks.pushObject(number: 2, final: false)), 20
|
||||
setTimeout ->
|
||||
ok true
|
||||
chunks.pushObject(number: 3, final: true)
|
||||
Ember.run ->
|
||||
chunks.pushObject(number: 3, final: true)
|
||||
start()
|
||||
|
||||
equal(chunks.get('finalized'), true, 'log should be finalized')
|
||||
, 30
|
||||
|
||||
test "it triggers downloading missing parts if there is a missing part, even though final part arrived", ->
|
||||
expect(2)
|
||||
expect(3)
|
||||
stop()
|
||||
|
||||
callback = (missingNumbers) ->
|
||||
deepEqual(missingNumbers, [2, 3], 'callback should be called with missing numbers')
|
||||
|
||||
chunks = Travis.LogChunks.create(timeout: 15, missingPartsCallback: callback, content: [])
|
||||
chunks = Travis.LogChunks.create(timeout: 20, missingPartsCallback: callback, content: [])
|
||||
|
||||
chunks.pushObject(number: 1, final: false)
|
||||
Ember.run -> chunks.pushObject(number: 1, final: false)
|
||||
setTimeout ->
|
||||
chunks.pushObject(number: 4, final: true)
|
||||
Ember.run -> chunks.pushObject(number: 4, final: true)
|
||||
|
||||
ok(!chunks.get('finalized'), "log shouldn't be finalized")
|
||||
, 10
|
||||
|
@ -37,10 +38,10 @@ test "it triggers downloading missing parts if there is a missing part, even tho
|
|||
setTimeout ->
|
||||
Ember.run -> chunks.destroy() # destroy object to not fire more callbacks
|
||||
start()
|
||||
, 40
|
||||
, 60
|
||||
|
||||
test "it triggers downloading next parts if there is no final part", ->
|
||||
expect(2)
|
||||
expect(4)
|
||||
stop()
|
||||
|
||||
callback = (missingNumbers, after) ->
|
||||
|
@ -49,8 +50,9 @@ test "it triggers downloading next parts if there is no final part", ->
|
|||
|
||||
chunks = Travis.LogChunks.create(timeout: 15, missingPartsCallback: callback, content: [])
|
||||
|
||||
chunks.pushObject(number: 1, final: false)
|
||||
chunks.pushObject(number: 3, final: false)
|
||||
Ember.run ->
|
||||
chunks.pushObject(number: 1, final: false)
|
||||
chunks.pushObject(number: 3, final: false)
|
||||
|
||||
setTimeout ->
|
||||
Ember.run -> chunks.destroy() # destroy object to not fire more callbacks
|
||||
|
@ -58,7 +60,7 @@ test "it triggers downloading next parts if there is no final part", ->
|
|||
, 35
|
||||
|
||||
test "it triggers downloading all available parts if there is no parts yet", ->
|
||||
expect(1)
|
||||
expect(2)
|
||||
stop()
|
||||
|
||||
callback = (missingNumbers, after) ->
|
||||
|
|
|
@ -71,6 +71,11 @@ window.Travis = TravisApplication.create(
|
|||
|
||||
Travis.deferReadiness()
|
||||
|
||||
pages_endpoint = $('meta[rel="travis.pages_endpoint"]').attr('href')
|
||||
billing_endpoint = $('meta[rel="travis.billing_endpoint"]').attr('href')
|
||||
customer_io_site_id = $('meta[name="travis.customer_io_site_id"]').attr('value')
|
||||
setupCustomerio(customer_io_site_id) if customer_io_site_id
|
||||
|
||||
$.extend Travis,
|
||||
run: ->
|
||||
Travis.advanceReadiness() # bc, remove once merged to master
|
||||
|
@ -89,6 +94,16 @@ $.extend Travis,
|
|||
show_repos_hint: 'private'
|
||||
avatar_default_url: 'https://travis-ci.org/images/ui/default-avatar.png'
|
||||
pusher_log_fallback: $('meta[name="travis.pusher_log_fallback"]').attr('value') == 'true'
|
||||
pro: $('meta[name="travis.pro"]').attr('value') == 'true'
|
||||
|
||||
pages_endpoint: pages_endpoint || billing_endpoint
|
||||
billing_endpoint: billing_endpoint
|
||||
|
||||
url_legal: "#{billing_endpoint}/pages/legal"
|
||||
url_imprint: "#{billing_endpoint}/pages/imprint"
|
||||
url_security: "#{billing_endpoint}/pages/security"
|
||||
url_terms: "#{billing_endpoint}/pages/terms"
|
||||
customer_io_site_id: customer_io_site_id
|
||||
|
||||
CONFIG_KEYS_MAP: {
|
||||
go: 'Go'
|
||||
|
@ -158,6 +173,15 @@ Travis.initializer
|
|||
s = document.getElementsByTagName('script')[0]
|
||||
s.parentNode.insertBefore(ga, s)
|
||||
|
||||
Travis.initializer
|
||||
name: 'inject-config'
|
||||
|
||||
initialize: (container, application) ->
|
||||
application.register 'config:main', Travis.config, { instantiate: false }
|
||||
|
||||
application.inject('controller', 'config', 'config:main')
|
||||
|
||||
|
||||
Travis.Router.reopen
|
||||
didTransition: ->
|
||||
@_super.apply @, arguments
|
||||
|
@ -168,7 +192,17 @@ Travis.Router.reopen
|
|||
Ember.LinkView.reopen
|
||||
loadingClass: 'loading_link'
|
||||
|
||||
if charm_key = $('meta[name="travis.charm_key"]').attr('value')
|
||||
@__CHARM =
|
||||
key: $('meta[name="travis.charm_key"]').attr('value')
|
||||
url: "https://charmscout.herokuapp.com/feedback"
|
||||
|
||||
$('head').append $('<script src="https://charmscout.herokuapp.com/charmeur.js?v=2" async defer></script>')
|
||||
|
||||
require 'travis/ajax'
|
||||
|
||||
Travis.ajax.pro = Travis.config.pro
|
||||
|
||||
require 'travis/adapter'
|
||||
require 'travis/adapters/env_vars'
|
||||
require 'travis/adapters/ssh_key'
|
||||
|
|
14
assets/scripts/vendor/customerio.js
vendored
Normal file
14
assets/scripts/vendor/customerio.js
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
var _cio = _cio || [];
|
||||
|
||||
function setupCustomerio(siteId) {
|
||||
var a,b,c;a=function(f){return function(){_cio.push([f].
|
||||
concat(Array.prototype.slice.call(arguments,0)))}};b=["load","identify",
|
||||
"sidentify","track","page"];for(c=0;c<b.length;c++){_cio[b[c]]=a(b[c])};
|
||||
var t = document.createElement('script'),
|
||||
s = document.getElementsByTagName('script')[0];
|
||||
t.async = true;
|
||||
t.id = 'cio-tracker';
|
||||
t.setAttribute('data-site-id', siteId);
|
||||
t.src = 'https://assets.customer.io/assets/track.js';
|
||||
s.parentNode.insertBefore(t, s);
|
||||
}
|
53065
assets/scripts/vendor/ember.js
vendored
53065
assets/scripts/vendor/ember.js
vendored
File diff suppressed because it is too large
Load Diff
51213
assets/scripts/vendor/ember.prod.js
vendored
51213
assets/scripts/vendor/ember.prod.js
vendored
File diff suppressed because it is too large
Load Diff
2518
assets/scripts/vendor/handlebars.js
vendored
2518
assets/scripts/vendor/handlebars.js
vendored
File diff suppressed because one or more lines are too long
|
@ -17,3 +17,5 @@ span.loading, span.saving
|
|||
color: $color-text-lighter
|
||||
background: inline-image('ui/spinner.svg') no-repeat right 4px
|
||||
|
||||
#profile #left .loading
|
||||
padding-top: 30px
|
||||
|
|
14
assets/styles/charm.sass
Normal file
14
assets/styles/charm.sass
Normal file
|
@ -0,0 +1,14 @@
|
|||
#CHARM_TAB
|
||||
-webkit-transform: translateY(0) rotate(270deg) !important
|
||||
-moz-transform: translateY(0) rotate(270deg) !important
|
||||
transform: translateY(0) rotate(270deg) !important
|
||||
background-image: url(/images/ui/charmtab.png)
|
||||
margin-left: -135px !important
|
||||
margin-top: -112px !important
|
||||
top: 100% !important
|
||||
left: 100% !important
|
||||
|
||||
#CHARM_TAB:hover
|
||||
-webkit-transform: translateY(-7px) rotate(270deg) !important
|
||||
-moz-transform: translateY(-7px) rotate(270deg) !important
|
||||
transform: translateY(-7px) rotate(270deg) !important
|
206
assets/styles/forms.scss
Normal file
206
assets/styles/forms.scss
Normal file
|
@ -0,0 +1,206 @@
|
|||
@import "compass";
|
||||
|
||||
.pro {
|
||||
form.subscription-form {
|
||||
display: inline-block;
|
||||
width: 900px;
|
||||
|
||||
h2 {
|
||||
margin-bottom: 13px;
|
||||
}
|
||||
h3 {
|
||||
margin: 24px 0 0 0;
|
||||
}
|
||||
p {
|
||||
line-height: 160%;
|
||||
font-size: 16px;
|
||||
color: #666;
|
||||
}
|
||||
ul {
|
||||
list-style-type: disc;
|
||||
margin-left: 20px;
|
||||
|
||||
li {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
ul.footnotes {
|
||||
margin: 36px 60px 0 85px;
|
||||
list-style-type: none;
|
||||
}
|
||||
sup.required {
|
||||
color: #c00;
|
||||
font-size: 15px;
|
||||
}
|
||||
.message {
|
||||
float: left;
|
||||
display: none;
|
||||
padding-left: 24px;
|
||||
background: url(/images/spinner.gif) no-repeat left center;
|
||||
color: #999;
|
||||
}
|
||||
.note {
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
width: 840px;
|
||||
}
|
||||
|
||||
& > div {
|
||||
display: inline-block;
|
||||
height: 1%;
|
||||
}
|
||||
|
||||
fieldset + p {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
padding: 0;
|
||||
border: 0;
|
||||
margin: 12px 36px 0 0;
|
||||
|
||||
&:nth-child(odd) {
|
||||
margin-right: 0;
|
||||
}
|
||||
&.wide {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
legend {
|
||||
padding-bottom: 10px;
|
||||
color: #666;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.input {
|
||||
position: relative;
|
||||
height: 20px;
|
||||
margin-bottom: 11px;
|
||||
}
|
||||
|
||||
label {
|
||||
float: left;
|
||||
clear: both;
|
||||
width: 100px;
|
||||
margin-right: 14px;
|
||||
padding-top: 5px;
|
||||
line-height: 20px;
|
||||
text-align: right;
|
||||
font-size: 14px;
|
||||
text-shadow: 2px 2px 0px #fff;
|
||||
color: #666;
|
||||
|
||||
&.required:after {
|
||||
content: '*';
|
||||
top: 17px;
|
||||
right: -10px;
|
||||
padding-left: 3px;
|
||||
color: #c00;
|
||||
}
|
||||
}
|
||||
input, textarea, select {
|
||||
float: left;
|
||||
font-family: "Helvetica Neue", Helvetica, Arial;
|
||||
}
|
||||
input, textarea {
|
||||
border: 1px solid #ddd;
|
||||
font-size: 13px;
|
||||
@include border-radius(1px);
|
||||
}
|
||||
input {
|
||||
margin-top: 4px;
|
||||
height: 20px;
|
||||
width: 270px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
textarea {
|
||||
margin-top: 8px;
|
||||
height: 20px;
|
||||
width: 270px;
|
||||
}
|
||||
&.wide textarea {
|
||||
width: 740px;
|
||||
}
|
||||
select {
|
||||
font-size: 14px;
|
||||
margin-top: 5px;
|
||||
height: 20px;
|
||||
}
|
||||
.boolean {
|
||||
input {
|
||||
margin: 8px 8px 0 86px;
|
||||
width: auto;
|
||||
clear: left;
|
||||
}
|
||||
label {
|
||||
clear: none;
|
||||
width: auto;
|
||||
margin-top: 8px;
|
||||
line-height: 16px;
|
||||
text-align: left;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
.country select {
|
||||
width: 275px;
|
||||
}
|
||||
.hint {
|
||||
display: none;
|
||||
}
|
||||
p {
|
||||
float: left;
|
||||
width: 740px;
|
||||
margin: 0 0 2px 0;
|
||||
line-height: 41px;
|
||||
font-size: 13px;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
#comment fieldset {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.actions {
|
||||
display: block;
|
||||
clear: both;
|
||||
height: 40px;
|
||||
line-height: 60px;
|
||||
|
||||
input, a {
|
||||
display: block;
|
||||
float: left;
|
||||
width: 184px;
|
||||
height: 40px;
|
||||
margin: 10px 20px 0 0px;
|
||||
margin-left: 115px;
|
||||
border: 0;
|
||||
text-align: center;
|
||||
line-height: 37px;
|
||||
font-size: 20px;
|
||||
text-decoration: none;
|
||||
color: white;
|
||||
text-shadow: 2px 2px 0 #666;
|
||||
cursor: hand;
|
||||
@include border-radius(6px);
|
||||
background-color: #19A509;
|
||||
@include background-image(linear-gradient(#3f9c33 0%, #348629 100%));
|
||||
&:hover {
|
||||
@include background-image(linear-gradient(#1CBE0A 0%, #158F07 100%));
|
||||
}
|
||||
&[disabled] {
|
||||
@include background-image(linear-gradient(#ddd 0%, #ccc 100%));
|
||||
color: #f6f6f6;
|
||||
text-shadow: 2px 2px 0 #aaa;
|
||||
}
|
||||
}
|
||||
}
|
||||
.error, div.error > input {
|
||||
border-color: #c00;
|
||||
}
|
||||
.tipsy {
|
||||
margin-left: 20px;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -33,6 +33,9 @@ html, body
|
|||
height: 55px
|
||||
z-index: 1000
|
||||
|
||||
#auth #top
|
||||
top: 0
|
||||
|
||||
#left, #right
|
||||
position: relative
|
||||
min-height: 100%
|
||||
|
|
180
assets/styles/pro.sass
Normal file
180
assets/styles/pro.sass
Normal file
|
@ -0,0 +1,180 @@
|
|||
@import "_mixins/all"
|
||||
|
||||
.pro
|
||||
#log-container
|
||||
padding-bottom: 1.2em
|
||||
|
||||
.tip
|
||||
a
|
||||
text-decoration: underline
|
||||
p
|
||||
margin-top: 12px
|
||||
margin-bottom: 0px
|
||||
|
||||
#top
|
||||
li.stats
|
||||
display: none
|
||||
|
||||
.profile
|
||||
margin-right: 5px
|
||||
|
||||
.legal
|
||||
min-width: 110px
|
||||
ul
|
||||
margin-left: -20px
|
||||
a
|
||||
padding: 5px 35px
|
||||
|
||||
#github
|
||||
display: none
|
||||
|
||||
&#home #main
|
||||
padding-right: 30px
|
||||
|
||||
#repository .github-stats
|
||||
display: none
|
||||
|
||||
#empty
|
||||
font-size: $font-size-big
|
||||
|
||||
h2
|
||||
margin-bottom: 37px
|
||||
|
||||
ul
|
||||
list-style-type: disc
|
||||
padding-left: 18px
|
||||
|
||||
a
|
||||
text-decoration: underline
|
||||
|
||||
.sponsor
|
||||
display: none
|
||||
|
||||
&#profile #main
|
||||
.tabs .right
|
||||
float: right
|
||||
.tabs #tab_billing
|
||||
margin-right: 0
|
||||
|
||||
.activate,
|
||||
.activated
|
||||
position: absolute
|
||||
display: block
|
||||
right: 0
|
||||
margin: -45px 40px 0 0
|
||||
padding-right: 25px
|
||||
|
||||
&:before
|
||||
content: ""
|
||||
position: absolute
|
||||
top: 5px
|
||||
right: 7px
|
||||
width: 12px
|
||||
height: 12px
|
||||
|
||||
.activate:before
|
||||
background: inline-image('ui/activate.png') no-repeat 0 0
|
||||
|
||||
.activate:hover:before,
|
||||
.activate:focus:before,
|
||||
.activate:active:before
|
||||
background-position: -12px 0
|
||||
|
||||
.activated
|
||||
background: #44a057
|
||||
border: 0
|
||||
color: white
|
||||
|
||||
.activated:before
|
||||
background: url(/images/ui/activated.png) no-repeat 0 0
|
||||
|
||||
#running-jobs
|
||||
.jobs
|
||||
margin: 5px 0 5px
|
||||
.job
|
||||
list-style-type: disc
|
||||
list-style-position: inside
|
||||
.slug
|
||||
max-width: 150px
|
||||
overflow: hidden
|
||||
white-space: nowrap
|
||||
text-overflow: ellipsis
|
||||
display: inline-block
|
||||
display: -moz-inline-stack
|
||||
.group a
|
||||
cursor: pointer
|
||||
|
||||
@import "_mixins/all"
|
||||
|
||||
#right
|
||||
padding-bottom: 80px
|
||||
|
||||
h4
|
||||
margin: 24px 0 0 0
|
||||
|
||||
ul
|
||||
margin-top: 10px
|
||||
|
||||
li
|
||||
word-wrap: break-word
|
||||
|
||||
.box
|
||||
margin-top: 25px
|
||||
margin-left: -3px
|
||||
padding: 15px
|
||||
border: 1px solid #e0e0e0
|
||||
background-color: $color-bg-sidebar-box
|
||||
|
||||
h4
|
||||
margin: 0
|
||||
a
|
||||
text-decoration: underline
|
||||
li
|
||||
list-style-type: square
|
||||
margin-left: 15px
|
||||
|
||||
#queues
|
||||
ul
|
||||
margin: 5px 0 5px
|
||||
|
||||
|
||||
#slider
|
||||
position: absolute
|
||||
height: 99%
|
||||
top: 12px
|
||||
left: 0
|
||||
width: 10px
|
||||
background-color: $color-bg-slider
|
||||
cursor: pointer
|
||||
background: transparent url(/images/ui/slider-closed.png) no-repeat 3px 38px
|
||||
@include border-top-left-radius(4px)
|
||||
|
||||
&:hover
|
||||
background-color: $color-border-slider-hover
|
||||
|
||||
.maximized
|
||||
#slider
|
||||
top: 45px
|
||||
|
||||
#right .show-more-jobs
|
||||
text-decoration: underline
|
||||
cursor: pointer
|
||||
|
||||
@mixin flex($grow, $shrink, $size)
|
||||
-webkit-flex: $grow $shrink $size
|
||||
flex: $grow $shrink $size
|
||||
|
||||
#right
|
||||
@include flex(1, 1, 300px)
|
||||
max-width: 180px
|
||||
padding: 25px 20px 80px 20px
|
||||
background-color: #E9E9E7
|
||||
border-left: 1px solid $color-border-normal
|
||||
|
||||
#settings li.env-var span.name
|
||||
width: 210px
|
||||
|
||||
#settings li.env-var span.value
|
||||
max-width: 265px
|
||||
#settings
|
||||
min-width: 675px
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user